Non-live image resize

Hello,

in 5.4, it is apparently possible to live resize the disk image (I have not tested it yet, but the button is there in the “Storage” tab of a running VM). I would also like to be able to resize the disks of VMs which are not currently running (i.e. POWEROFF or UNDEPLOYED), and the disks which are not currently attached to any VM at all (READY state). Is it possible to do it in 5.4, or should I still resize the images under ONe hands by CEPH rbd resize command`?

Thanks!

-Yenya

I think this ticket is about that feature Backlog #4274: "Cold" resize operation for Images - OpenNebula - OpenNebula Development pages
Generally there is not much help from the opennebula developers for this kind of cutting edge questions: even a simple “not yet” would be helpful, by being silent you are losing customers.

With opennebula 5.4 sunstone, I’ve tried resizing (growing) of the image on gluster, in both RUNNING and POWEROFF VM states and it seems to work (ssh to the VM shows the resized /), and this is what 0.log says:

Sat Aug 12 23:01:54 2017 [Z0][VM][I]: New LCM state is SHUTDOWN_POWEROFF
Sat Aug 12 23:01:59 2017 [Z0][VMM][I]: ExitCode: 0
Sat Aug 12 23:01:59 2017 [Z0][VMM][I]: Successfully execute virtualization driver operation: shutdown.
Sat Aug 12 23:01:59 2017 [Z0][VMM][I]: ExitCode: 0
Sat Aug 12 23:01:59 2017 [Z0][VMM][I]: Successfully execute network driver operation: clean.
Sat Aug 12 23:02:00 2017 [Z0][VM][I]: New state is POWEROFF
Sat Aug 12 23:02:00 2017 [Z0][VM][I]: New LCM state is LCM_INIT
Sat Aug 12 23:02:29 2017 [Z0][VM][I]: New state is ACTIVE
Sat Aug 12 23:02:29 2017 [Z0][VM][I]: New LCM state is DISK_RESIZE_POWEROFF
Sat Aug 12 23:02:30 2017 [Z0][LCM][I]: VM disk resize operation completed.
Sat Aug 12 23:02:30 2017 [Z0][VM][I]: New state is POWEROFF
Sat Aug 12 23:02:30 2017 [Z0][VM][I]: New LCM state is LCM_INIT
Sat Aug 12 23:04:02 2017 [Z0][VM][I]: New state is ACTIVE
Sat Aug 12 23:04:02 2017 [Z0][VM][I]: New LCM state is BOOT_POWEROFF
Sat Aug 12 23:04:02 2017 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/0/deployment.2
Sat Aug 12 23:04:03 2017 [Z0][VMM][I]: Successfully execute transfer manager driver operation: tm_context.
Sat Aug 12 23:04:03 2017 [Z0][VMM][I]: ExitCode: 0
Sat Aug 12 23:04:03 2017 [Z0][VMM][I]: Successfully execute network driver operation: pre.
Sat Aug 12 23:04:03 2017 [Z0][VMM][I]: ExitCode: 0
Sat Aug 12 23:04:03 2017 [Z0][VMM][I]: Successfully execute virtualization driver operation: deploy.
Sat Aug 12 23:04:03 2017 [Z0][VMM][I]: ExitCode: 0
Sat Aug 12 23:04:03 2017 [Z0][VMM][I]: Successfully execute network driver operation: post.
Sat Aug 12 23:04:03 2017 [Z0][VM][I]: New LCM state is RUNNING

If you have a disposable test setup, what about trying it and reporting the result? Maybe then the thread attracts some attention.

@marcindulak: thanks for the hint, I have looked at it once more. There are two problems:

  • I prefer to UNDEPLOY my VMs instead of POWEROFF, because the VM in POWEROFF state is (strangely enough) accounted to the host RAM and CPU as used. In UNDEPLOYED state, the re is no way (AFAIK) to resize, copy, or snapshot the disk image - either from the VM->Storage tab, or from th Storage->images tab.

  • the POWEROFF state is different, and apparently in this state it is still possible to resize the image, save it, and so on. My fault is that when I tried it, I did not wait long enough - when I click on “poweroff hard” in Sunstone, the save/resize/… action icons disappear (which is why I thought it is not supported in POWEROFF state), but they appear again few seconds (and one refresh) later, after the POWEROFF state is reached. Maybe the more user-friendly solution would be to gray out the icons and add the tooltip explaining that these operations are there, but are not available in transient states.

So the remaining problem is that these operations are not available in UNDEPLOYED state, and also it is not possible to resize the image, which is currently not attached to a VM (READY state).

It should work in both states, POWEROFF and UNDEPLOYED. Maybe is it a Sunstone issue. Could you try in the command line with onevm

@ruben: onevm disk resize seems to work even with UNDEPLOYED VMs, even though onevm(1) manpage suggests otherwise:

·       disk-resize vmid diskid size Resizes a VM disk. The new size should
           be larger than the old one.

           States: RUNNING, POWEROFF

I did the following:

$ onevm show 563
VIRTUAL MACHINE 563 INFORMATION
ID                  : 563
NAME                : Ayanami (Fedora 22)
[...]
STATE               : UNDEPLOYED
LCM_STATE           : LCM_INIT
[...]
VM DISKS                                                                        
 ID DATASTORE  TARGET IMAGE                               SIZE      TYPE SAVE
  0 cephds     vda    ayanami                             -/19.5G   rbd   YES
  1 -          hda    CONTEXT                             -/-       -       -
[...]
$ onevm disk-resize 563 0 25G
$ onevm show 563
[...]
VM DISKS                                                                        
 ID DATASTORE  TARGET IMAGE                               SIZE      TYPE SAVE
  0 cephds     vda    ayanami                             -/25G     rbd   YES
  1 -          hda    CONTEXT                             -/-       -       -
[...]

And indeed, inside the VM I can see /dev/vda with 25G size. So the problem is in Sunstone, and in onevm(1) manpage. Disk resizing of READY images in the Storage->Images tab itself would also be welcome.