How to Reclaim Disk Space from Deleted XenServer Snapshots

When you create a shapshot of a virtual machine it creates a file on your xenserver which takes up disk space.  When you delete the snap shot sometimes the snapshot will not release all of the disk space that was used by the snapshot.  This was a known problem with xenserver 5.5 but I have seen this problem in xenserver 5.0 and 5.6.  In order to reclaim this disk space back do the following.

How to Reclaim Disk Space from Deleted XenServer Snapshots

In xenserver 5.5 update 1 and future releases an extra function has been added called “Off-line Coalesce tool” this tool will suspend the vm (Meaning there will be down time), it will then clean up the snapshot and reclaim the disk space back.
How to Reclaim Disk Space from Deleted XenServer Snapshots  – XenServer 5.5 Update 1 and later
I will recommend you power down the VM you want to reclaim disk space from and perform a backup of the server before you try the off-line coalesce tool.  Personally I have run this tool 100 times and have never had a problem, but would recommend you to backup first.
To run the tool First thing you need to do is get the UUID of the VM, to do this
1. In XenCenter, enable hidden objects (View menu > Hidden Objects).
2. In the Resource pane, select the VM for which you want to obtain the UUID. The UUID appears in the General tab. You can right click on the UUID and select copy if needed.
3. Run the following command from the XenServer CLI, (Be aware the VM will go in to suspended mode which will mean down time for your VM)
coalesce-leaf –u <uuid of VM> ( replace  <uuid of VM> with the UUID of the VM.)
How to Reclaim Disk Space from Deleted XenServer Snapshots  – XenServer 5.6
The process is simular to 5.5 bit a little bit more complicated. First thing you need to do is get the UUID of the XENSERVER Host and also the VM.
To get the UUID of the XENSERVER Host
1.  In XenCenter, enable hidden objects (View menu > Hidden Objects)
2.  The XENSERVERS Host UUID appears in the General tab.
To get the UUID of the VM
1. In XenCenter, enable hidden objects (View menu > Hidden Objects).
2. In the Resource pane, select the VM for which you want to obtain the UUID. The UUID appears in the General tab. You can right click on the UUID and select copy if needed.
Run the following command from the XenServer CLI, (Be aware the VM will go in to suspended mode which will mean down time for your VM)
xe host-call-plugin host-uuid=<host-UUID> plugin=coalesce-leaf fn=leaf-coalesce args:vm_uuid=<VM-UUID>
replace <host-UUID>  with the XENSERVERS Host UUID  and
replace <VM-UUID> with the VMs UUID
How to Reclaim Disk Space from Deleted XenServer Snapshots How to Reclaim Disk Space from Deleted XenServer Snapshots Reviewed by Citrix Tips on 11:40 Rating: 5