If it is, you can remove the original_image.qcow2_backup file. You can now start the guest and check that everything is in working order. This will shrink the qcow2 image to consume less physical disk space. The above commands move the original image file, and then re-compress it to it’s original name. Qemu-img convert -O qcow2 original_image.qcow2_backup original_image.qcow2 mv original_image.qcow2 original_image.qcow2_backup Make sure you have shut down the virtual machine which is using the qcow2 image file before running the below commands. Move to the directory where the disk image is stored and run the below commands. The rest of the process is done on the host so open up a terminal window and SSH to your Proxmox host. Once this completes (this may take a while depending on your disk image size and physical disk speed), shutdown the guest and follow the below steps under All OS’s. This assumes that sdelete was extracted into c:\ and c:\ is the disk you would like to use to reclaim space c:\sdelete.exe -z c: Once you have downloaded and extracted sdelete, open up a command prompt and enter the following.
QEMU IMG CONVERT DOWNLOAD
You will need to download a tool called sdelete from Microsoft which is will fill the entire disk with zeros which can be re-compressed later. Shutdown the guest and follow the steps below under All OS’s. Once the command errors out (this may take a while depending on your disk image size and physical disk speed) delete the file. Before running this, be sure to stop any applications running on the guest otherwise errors may result. In a terminal, run the below command until you run out of disk space. We need to fill the disk of the guest with zero’s (or any other character) so that the disk image can be re-compressed.
QEMU IMG CONVERT HOW TO
The below steps will detail how to get round this issue. Because the disk image doesn’t shrink, it will always be 100GB on the file system even if the guest is now using less. The physical disk space used should be 50GB, right? Wrong. Let’s say you fill 100GB of a sparse disk (we know this will roughly consume 100GB of physical disk space) and then delete some files so that you are only using 50GB. There is another problem with sparse disk formats, they don’t automatically shrink. If you use over allocation of disk space you will need to monitor the physical disk usage very carefully. If all the guests need 100% of their 100GB disk space then you will have a problem. Sparse disk image files allow you to over allocate virtual disk space – this means that you could allocate 5 virtual machines 100GB of disk space, even if you only have 300GB of physical disk space. VMDK disks converted through qemu-img are always monolithic sparse VMDK disks with an IDE adapter type.