# Cannot resize disk 0

**URL:** <https://forum.opennebula.io/t/cannot-resize-disk-0/5946>\
**Category:** Product Support\
**Created:** [April 23, 2018, 6:08pm UTC](https://forum.opennebula.io/t/cannot-resize-disk-0/5946 "2018-04-23T18:08:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bobc](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/bobc/32/6496_2.png) [@bobc](https://forum.opennebula.io/u/bobc)\
**Post date:** [April 23, 2018, 6:08pm UTC](https://forum.opennebula.io/t/cannot-resize-disk-0/5946/1 "2018-04-23T18:08:38Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![atodorov\_storpool](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/atodorov_storpool/32/5327_2.png) [@atodorov\_storpool](https://forum.opennebula.io/u/atodorov_storpool)\
**Post date:** [April 24, 2018, 8:23am UTC](https://forum.opennebula.io/t/cannot-resize-disk-0/5946/2 "2018-04-24T08:23:57Z")

</div>

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

Best Regards,  
Anton Todorov

---

<div class="post-metadata">

**Author:** ![bobc](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/bobc/32/6496_2.png) [@bobc](https://forum.opennebula.io/u/bobc)\
**Post date:** [April 24, 2018, 1:00pm UTC](https://forum.opennebula.io/t/cannot-resize-disk-0/5946/3 "2018-04-24T13:00:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![atodorov\_storpool](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/atodorov_storpool/32/5327_2.png) [@atodorov\_storpool](https://forum.opennebula.io/u/atodorov_storpool)\
**Post date:** [April 24, 2018, 1:27pm UTC](https://forum.opennebula.io/t/cannot-resize-disk-0/5946/4 "2018-04-24T13:27:46Z")

</div>

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

> [@bobc](#):
>
> 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

This error message is from _qemu-img_ tool so the file still has snapshots.

Best Regards,  
Anton Todorov
