ResolutionTo defragment a virtual disk of a certain container, simply run the standard defragmentation tool inside the container in the same way as with a physical server.
Starting from Parallels Virtuozzo Containers 4.0, by running the "vzctl defrag" command on the node, you can check the degree of the virtual disk fragmentation and, if necessary, improve the efficiency of virtual disks by performing defragmentation.
vzctl defrag CT_ID --drive drive [--force] [--analysis]
CT_ID is the ID of the container whose virtual disk drive you want to defragment/analyze.
--drive drive is the name of the drive to be defragmented/analyzed. A name can be specified in one of the following formats: X, X:, X:\.
--force is the option that forces disk defragmentation. You can use this option if you do not have enough free space on the virtual disk. Keep in mind that forcing a defragmentation when there is insufficient disk space may result in partial disk defragmentation.
--analysis is used to analyze the virtual disk without performing its defragmentation.
A real life example:
vzctl defrag 100 --drive D:
Note: Do not forget to make a backup before performing virtual disk defragmentation.