VMware ESXi: A (incomplete) list of host commands Part 4

Hi,

check if a storage LUN attached to an ESXi supports VAAI


~ # esxcli storage core device vaai status get
naa.600000e00d11000000111a4300020000
VAAI Plugin Name:
ATS Status: supported
Clone Status: supported
Zero Status: supported
Delete Status: unsupported

Check if a volume supports native respectively hardware snapshots

~ # vmkfstools -Ph /vmfs/volumes/esxdatastore0/
VMFS-5.58 file system spanning 1 partitions.
File system label (if any): esxdatastore0
Mode: public
Capacity 7.8 TB, 7.3 TB available, file block size 1 MB, max file size 62.9 TB
UUID: 51ac77f6-db23d28e-78ff-001999d8f065
Partitions spanned (on "lvm"):
naa.600000e00d11000000111a2400000000:1
Is Native Snapshot Capable: YES

Monitor deleting of Snapshots. Login to the host where the VM resides.

~ # vim-cmd vimsvc/task_list
(ManagedObjectReference) [
'vim.Task:haTask-32-vim.VirtualMachine.removeAllSnapshots-140465256'
]
~ # vim-cmd vimsvc/task_info haTask-32-vim.VirtualMachine.removeAllSnapshots-140465256
(vim.TaskInfo) {
dynamicType = ,
key = "haTask-32-vim.VirtualMachine.removeAllSnapshots-140465256",
task = 'vim.Task:haTask-32-vim.VirtualMachine.removeAllSnapshots-140465256',
description = (vmodl.LocalizableMessage) null,
name = "vim.VirtualMachine.removeAllSnapshots",
descriptionId = "VirtualMachine.removeAllSnapshots",
entity = 'vim.VirtualMachine:32',
entityName = "vm",
state = "running",
cancelled = false,
cancelable = true,
error = (vmodl.MethodFault) null,
result = ,
progress = 83,
reason = (vim.TaskReasonUser) {
dynamicType = ,
userName = "vpxuser",
},
queueTime = "2015-10-14T23:40:18.498385Z",
startTime = "2015-10-14T23:40:18.498862Z",
completeTime = ,
eventChainId = 140465256,
changeTag = ,
parentTaskKey = ,
rootTaskKey = ,
}

Jump to the directory of the VM and monitor the activity of the sesparse, delta and flat files

~ # cd /vmfs/volumes/esxdatastore0/vm
/vmfs/volumes/510a4e43-4bf56f05-5a34-0034791e8a3/vm # watch -d 'ls -luth | grep -E "delta|flat|sesparse"'
Every 2s: ls -luth | grep -E "delta|flat|sesparse" 2015-10-15 08:04:23
-rw------- 1 root root 128.0G Oct 14 23:03 vm_6-flat.vmdk
-rw------- 1 root root 500.0G Oct 14 23:03 vm_4-flat.vmdk
-rw------- 1 root root 500.0G Oct 14 23:01 vm_3-flat.vmdk
-rw------- 1 root root 500.0G Oct 14 23:01 vm_5-flat.vmdk

Convert VMs a thick provisioning disk to a thin disk. Delete all snapshots and Power off your virtual machine. Make sure enough free diskspace is available on the datestore. vmdisk.vmdk is the disk definition and refers to vmdisk-flat.vmdk.

~ # vmkfstools -i /vmfs/volumes/esxdatastore0/vm/vmdisk.vmdk -d thin /vmfs/volumes/esxdatastore0/vm/vmdisk-flat-thin.vmdk
Destination disk format: VMFS thin-provisioned
Cloning disk vmdisk-flat.vmdk'...
~ # mv /vmfs/volumes/esxdatastore0/vm/vmdisk-flat.vmdk /vmfs/volumes/esxdatastore0/vm/vmdisk-flat.vmdk.thick
~ # mv /vmfs/volumes/esxdatastore0/vm/vmdisk-flat-thin.vmdk /vmfs/volumes/esxdatastore0/vm/vmdisk-flat.vmdk

Start your virtual machine and check its running correctly. If yes delete the thick disk.

~ # rm /vmfs/volumes/esxdatastore0/vm/vmdisk-flat.vmdk.thick

Determine the configured and the currently used size of a thin disk. Query the configured size with

~ # ls -lh /vmfs/volumes/esxdatastore0/vm/vmdisk-flat.vmdk

for the used size use:

~ # du -h /vmfs/volumes/esxdatastore0/vm/vmdisk-flat.vmdk

Leave a Reply Cancel reply