Symptomps
After conversion of a CT to VM the home directory of the VM (/vz/vmprivate/<VM_UUID>/) will look like this:
[root@vhs-node1 ~]# ls -l /vz/vmprivate/7442ebdd-f93d-4305-bc60-1dc19e5b3485/
total 3496
-rwx------ 1 root root 387072 Feb 27 21:31 cloud-config.iso
-rwx------ 1 root root 19076 Feb 27 21:32 config.pvs
-rwx------ 1 root root 19076 Feb 27 21:32 config.pvs.backup
-rwx------ 1 root root 3145736 Feb 27 21:30 harddisk.hdd
drwx------ 1 root root 0 Feb 27 21:30 hdd0
[root@vhs-node1 ~]#
Also the image path for the VM will end with ".../hdd0/root.hdd" :
[root@vhs-node1 ~]# prlctl list -if 7442ebdd-f93d-4305-bc60-1dc19e5b3485 | grep hdd
Boot order: hdd0 net0 cdrom0 cdrom1
hdd0 (+) scsi:0 image='/vz/vmprivate/7442ebdd-f93d-4305-bc60-1dc19e5b3485/hdd0/root.hdd' type='expanded' 13313Mb state=connected subtype=virtio-scsi serial=9635d0dbd9804e2a99c1
[root@vhs-node1 ~]#
Creating a backup for such VM will result in a bad backup. If you try to restore this backup the VM will be left without disk image and will be unusable:
[root@vhs-node1 ~]# prlctl restore C2V_AL9
WARNING: You are using a deprecated CLI component that won't be installed by default in the next major release. Please use virsh instead
Restore the VM {7442ebdd-f93d-4305-bc60-1dc19e5b3485}
The VM has been restored.
[root@vhs-node1 ~]# ls -l /vz/vmprivate/7442ebdd-f93d-4305-bc60-1dc19e5b3485/
total 40
-rwx------ 1 root root 19262 Feb 27 21:41 config.pvs
-rwx------ 1 root root 19262 Feb 27 21:41 config.pvs.backup
[root@vhs-node1 ~]#
Resolution:
-
(Be careful with this step! You can just rename if you want) Stop the VM and delete the
/vz/vmprivate/<UUID>/harddisk.hdd
file
rm -rf /vz/vmprivate/<UUID>/harddisk.hdd
-
Copy the
/vz/vmprivate/<UUID>/hdd0/root.hdd
file directly to the home directory of the VM/vz/vmprivate/<UUID>/
and rename toharddisk.hdd
cp /vz/vmprivate/<UUID>/hdd0/root.hdd /vz/vmprivate/<UUID>/harddisk.hdd
-
(Again, be careful what you are deleting. You can just rename) Remove the hdd0 directory from the home VM dir:
cd /vz/vmprivate/<UUID>/
rm -rf hdd0/
-
Change the hdd setting for the VM using:
prlctl set <VM_NAME> --device-set hdd0 --image=/vz/vmprivate/<UUID>/harddisk.hdd
After this is done the VM will use /vz/vmprivate/<UUID>/harddisk.hdd
file for it's disk image. After you create a backup for this VM it will be restored correctly.
Cause:
The reason is a bug PSBM-160732