Recycle Freed Space After Deleting XenServer VM Snapshot

Explore method to recycle XenServer disk space after deleting VM snapshots. Offline consolidation is crucial for storage efficiency, ensuring data security and efficient resource utilization.

download-icon
Free Download
for VM, OS, DB, File, NAS, etc.
dan-zeng

Updated by Dan Zeng on 2024/01/24

Table of contents
  • How to recycle freed space in XenServer?

  • Enhancing VM backup in XenServer

  • Conclusion

Are you looking for a robust VM backup solution? Try Vinchin Backup & Recovery!↘ Download Free Trial

After deleting snapshots or cloning VMs on LVM-based Local EXT and NFS SRs, XenServer can automatically recycle disk space by freeing up unused data, a process called coalescing. XenServer can consolidate disk space while the VMs are running ( online consolidation).

However, XenServer 5.5 has a known limitation for coalescing. After deleting all snapshots on a VM disk or cloning a VM, some disk space may remain allocated. While the amount of space consumed by the deleted snapshots or cloned VMs for NFS and EXT-based SRs is very small, the amount of space consumed for iSCSI FCs and local SRs is huge.

How to recycle freed space in XenServer?

To eliminate this limitation, XenServer 5.5 Update 1 and higher versions introduce an offline consolidation tool. The tool can recover all previously allocated disk space for deleted snapshots or clones when the VM is temporarily shut down or suspended (offline). The following will introduce the offline coalescing tool and its usage.

Caution:

1. Running this script will cause the VM to be temporarily unavailable because a suspend/ resume operation was performed.

2. Before running this tool, you must delete all snapshots and clones associated with the virtual machine using the XenCenter or XenServer CLI. Otherwise, the script will fail and the tool will display an error message and exit.

3. All VM disks must be on shared storage or local storage on a single host. If VM disks are on the both types of storage, they cannot be consolidated.

4. It is recommended to backup the VM with XenCenter before recycling the freed space.

To recycle space in XenServer 5.5 Update 1 and higher version:

1. Get UUID:

1) In XenCenter, View menu > choose Hidden Objects

2) In Resource, select the VM corresponding to the requested UUID

2. Run the following command in the XenServer CLI:

coalesce-leaf -u <uuid of VM>

For example, if the UUID of the VM is

2a8d2815-c97e-245b-efe2- 389ba456bd7p

you need to run the following command: 

coalesce-leaf -u 2a8d2815-c97e-245b-efe2-389ba456bd7p

To recycle space in XenServer 5.6:

1. Get UUID:

1) In XenCenter, View menu > choose Hidden Objects

2) In Resource, select the VM corresponding to the requested UUID

3) In Resource, select the host of the pool (the first one in the list). Find the UUID in General. If you haven’t enable the resource pool, directly select the host of the VM.

2. Run the following command in the XenServer CLI:

xe host-call-plugin host-uuid=<host-UUID> plugin=coalesce-leaf fn=leaf-coalesce args:vm_uuid=<VM-UUID>

For example, if the VM UUID is

9bad4022-2c2d-dee6-abf5-1b6195b1dad5

and the host UUID is

b8722062-de95-4d95-9baa-a5fe343898ea

you need to run the following command:

xe host-call-plugin host-uuid=b8722062-de95-4d95-9baa-a5fe343898ea plugin=coalesce-leaf fn=leaf-coalesce args:vm_uuid=9bad4022-2c2d- dee6-abf5-1b6195b1dad5

Enhancing VM backup in XenServer

After deleting a VM snapshot or performing a VM clone, performing an offline consolidation tool to recycle disk space is a critical maintenance task to ensure that storage resources are used efficiently. However, at the same time, there is a need to ensure the security and recover ability of VM data. To fulfill this need, it is recommended to configure a VM backup solution to provide comprehensive data protection.

Vinchin Backup & Recovery

For VM backup, you can choose professional backup software, such as Vinchin Backup & Recovery. It provides comprehensive and powerful VM backup and recovery features designed to protect and manage critical data in the virtualization environment.

And Vinchin also provides a flexible and reliable backup solution that makes it easy to create backup schedules and enable deduplication and data compression to minimize the space occupied by the backup data.

Vinchin Backup & Recovery’s operation is very simple, just a few simple steps. Just select VMs on the host > then select backup destination > select strategies > finally submit the job

Vinchin offers a free 60-day trial for users to experience the functionality. For more information, please contact Vinchin directly or contact our local partners.

Conclusion

In conclusion, reccycling freed space XenServer after deleting VM snapshots is crucial for storage efficiency. Offline consolidation resolves limitations, and enhancing VM backup with solutions like Vinchin Backup & Recovery ensures data security and recover ability, offering comprehensive protection in virtual environments. 

Share on:

Categories: VM Tips
Free Trial Now close-icon