Disk resize process for new VMs

Greetings,

I am trying to understand the process by which ONE creates new VMs from templates and expands the disk at creation time. Reading the API docs didn’t really shed any light, nor do the docs for onetemplate instantiate. Does Sunstone ask ONE to clone a non-persistent disk with a larger size, and modify the template parameters at creation time to point to the cloned disk? This doesn’t seem likely because the cloned disk does not appear in the list of available images.

Thanks.

Hi,

AFAIK the sunstone is just requesting changes in the template for the VM with size larger than the original size.

Then when TM_MAD/clone is invoked to create the image clone it do a query for the VM template for the given disk and if the SIZE and ORIGINAL_SIZE differ it creates the VM disk with the larger size.
Here is the qcow TM_MAD for example:

Later when the VM boot the contextualization script checks and inflate the filesystem to utilize the size.
https://github.com/OpenNebula/addon-context-linux/blob/master/base.one/etc/one-context.d/05-grow-rootfs

I hope this helps.

Kind Regards,
Anton Todorov

1 Like

this excellent presentation from the conference might be helpful:

OpenNebulaConf 2016 - Storage Hands-on Workshop by Javier Fontán, OpenNebula from OpenNebula Project