VMmanager Knowledge Base
en En
es Es
Your feedback is an opportunity for improvement!
Take part in the survey and contribute to the development of the ISPsystem ecosystem.
Take the survey

VM disk size is not decreasing

Description

The platform continues to display the maximum value of the disk space used after the disk is released.

The reason for this behavior is that dynamic space allocation for virtual disks in the file storage works only upwards. And it is only possible to reduce the size of the VM disk to return the unused space manually using the virt-sparsify utility. This is due to the limitation of libguestfs software. For more information about the virt-sparsify utility, see the official libguestfs documentation.

Solution

Warning

Before taking any actions on a virtual disk:

  • create a backup of the VM;
  • make sure that the VM that uses the virtual disk is stopped.
Note
The instructions are relevant for file storage.

To reduce the disk size manually:

  1. Shut down the VM.
  2. Rename the virtual disk file. For example:

    mv /vm/test-1 /vm/test-1.bak
  3. Run optimization with the virt-sparsify utility:

    virt-sparsify /vm/test-1.bak /vm/test-1
    Comments
  4. Start the VM.
  5. If the disk space optimization was successful, delete the source virtual disk file:

    rm /vm/test-1.bak
    Comments
The article was last updated on 02.13.2024. The article was prepared by technical writers of ISPsystem.