Cannot resize disk 0

I’m using version 5.4.6 and I am unable to resize disk 0 on one of my VM’s. At first I was getting an error:

  • Can’t resize an image which has snapshots

From the Storage I attempted to delete the snapshot but got an error that Active snapshots cannot be deleted.

From a separate forum post I the executed:

  • onedb change-body vm --id 202 ‘/VM/SNAPSHOTS[DISK_ID=0]/ALLOW_ORPHANS’ – “YES”

I was then able to delete the snapshot and I then executed:

  • onevm disk-resize 202 0 20480

The command executed without error but the disk did not resize. The vm’s error log shows:

Mon Apr 23 13:57:36 2018 [Z0][TM][I]: Command execution fail: /var/lib/one/remotes/tm/ssh/resize thor:/var/lib/one//datastores/0/202/disk.0 20480 202 111
Mon Apr 23 13:57:36 2018 [Z0][TM][E]: resize: Command “qemu-img resize /var/lib/one/datastores/0/202/disk.0 20480M” failed: qemu-img: Can’t resize an image which has snapshots
Mon Apr 23 13:57:36 2018 [Z0][TM][I]: qemu-img: This image does not support resize
Mon Apr 23 13:57:36 2018 [Z0][TM][E]: Error resizing image /var/lib/one/datastores/0/202/disk.0
Mon Apr 23 13:57:36 2018 [Z0][TM][I]: ExitCode: 1
Mon Apr 23 13:57:36 2018 [Z0][TM][E]: Error executing image transfer script: Error resizing image /var/lib/one/datastores/0/202/disk.0
Mon Apr 23 13:57:36 2018 [Z0][LCM][I]: VM disk resize operation completed.

Any idea what I should try next to resize?

AFAIK the datastore operation with enabled ALLOW_ORPHANS option is not supported by the QCOW2 backed storage drivers.

Best Regards,
Anton Todorov

Based on your feedback and my experiences, can you confirm these assumptions (assuming use of version 5.4.6) . . .

  • There is no way to resize a disk once a snapshot is taken
  • In my case specifically there is no way to resize my disk with the work-around I executed to delete the snapshots

Correct?

Thanks

The limits are related to the QCOW2 file format. The OpenNebula version is irrelevant.

This error message is from qemu-img tool so the file still has snapshots.

Best Regards,
Anton Todorov