Vmkfstools: Difference between revisions

Jump to navigation Jump to search
989 bytes added ,  16 February 2017
 
(3 intermediate revisions by the same user not shown)
Line 106: Line 106:
  Found 1 actively heartbeating hosts on volume '/vmfs/volumes/esx4-1-local-storage-1/'
  Found 1 actively heartbeating hosts on volume '/vmfs/volumes/esx4-1-local-storage-1/'
  (1): MAC address 00:50:56:92:3f:86
  (1): MAC address 00:50:56:92:3f:86
Displays the MAC address of the management interface of each host which is currently using the datastore.
This is also what vSphere HA uses to see if a host is still active.
==== punchzero ====
==== punchzero ====
Since vSphere 5.1 there's an option to shrink disks besides the normally required storage vmotion.
Since vSphere 5.1 there's an option to shrink disks besides the normally required storage vmotion.
Line 112: Line 117:


Reclaim disk space by returning unused blocks of data in the virtual disk to the host OS.  
Reclaim disk space by returning unused blocks of data in the virtual disk to the host OS.  
Note that this will only work if your virtual disk is of type thin.
Note that this will only work if your virtual disk is of type thin.
You will also need to zero out the unused blocks of data in the guest OS.
 
 
Before running it you will also need to zero out the unused blocks of data in the guest OS.


For a windows VM, you can use Microsoft's tool [http://technet.microsoft.com/en-us/sysinternals/bb897443.aspx sdelete].
For a windows VM, you can use Microsoft's tool [http://technet.microsoft.com/en-us/sysinternals/bb897443.aspx sdelete].
Line 123: Line 131:
  cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill
  cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill
to zero out the unused space.  
to zero out the unused space.  
Note of warning that you should stop database -and other disk intensive- services before running the above.
Note of warning that you should stop database -and other disk intensive- services before running the above.
Some more detailed descriptions and tips on zero-ing out data from your guest OS can be found at [[Shrink guest on hosted platform]]




Line 142: Line 153:
  0      disk.vmdk
  0      disk.vmdk


You can also use the vSphere Client data browser to see the effect of reclaiming disk space
You can also use the vSphere Client data browser to see the effect of reclaiming disk space.
 
If you try to run this command against a VM living on NFS storage you might end up seeing the following error:
vmkfstools --punchzero myvmdk.vmdk
Not a supported filesystem type
 
The error is a bit confusing as you might expect vmkfstools to talk about the guest OS here, but it is actually reporting that NFS does not support the punchzero option.
 
Your solution is to either move the vmdk by hand to storage not located on VMFS or use storage vmotion to migrate to non NFS storage. On moving using storage vmotion, the zero data is already being discarded. So you can just storage vmotion back afterwards and you have reclaimed the lost disk space.


=== Links ===
=== Links ===
1,274

edits

Navigation menu

Guest

Support my products