This is due to using snapshots. After you create the initial snapshot xen will continue writing to it even if it is not there.
To reclaim the space the VM's VDI need to go a proccess named "Coalesce" which integrates the data from the snapshot into the original VDI.
I used article CTX123400 to base my script on.
Also you will need to download "plink".
3 files:
- VM_List.txt - a list of the machine names (case sensitive)
- Step1.cmd
- Step2.cmd
Step1.cmd: replace [] with your own data
==========================
echo off
set user=[user]
set password=[password]
set server=[server ip]
del log_Coalesce.txt /q
for /f %%A in (vm_list.txt) do (step2.cmd %%A >>log_Coalesce.txt)
==========================
Step2.cmd:
==========================
title ***** Working on %1 *****
echo ***** Start working on %1 *****
echo.echo Start at:
echo %date% - %time%
set vm_uuid=
"C:\Program Files\Citrix\XenCenter\xe.exe" -s %server% -u %user% -pw %Password% vm-list name-label="%1" --minimal > vm_uuid.txt
set /p vm_uuid=
plink -ssh %server% -l %user% -pw %password% coalesce-leaf -u %vm_uuid%
echo.
echo %date% - %time%
echo ***** End working on %1 *****
echo.
============================
Enjoy