Today we have another small script from the Quick and Dirty series. If you use VAAI-compatible storage and provision VMs thinly, you have to perform a space reclaim from time to time to be able to use the deleted VMFS blocks again.
In the VMware Knowledge Base describes the procedure using "esxcli", but I find the way via the PowerCLI somewhat more convenient and have therefore added a small text GUI:
All you have to do is start the script from the PowerCLI and then you can conveniently select the datastore on which the "UNMAP" command is to be executed.
The script works with the PowerCLI 6 and the EMC XtremIO and probably also with other VAAI compatible storage. The reclaim unit size can be adjusted in line 8. (Default is 200 for 1 MB blocks for VMFS3/5).
Here is the script:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
,
) {
{
=
=
,
) }
{ } } = -1
:
{
}
{
}
{
{
}
{
}
{
}
{
}
{
}
{
} }
|