Alter VM Configuration after create

Hello,

This is a general question and affects version 5.4.1. I think older versions don’t have a solution for this too.

I have created several VMs. Now I want to alter the configuration. For example I want to limit the IOPS of one specific VM disk? I cannot find a way to handle this as I cannot alter the applied template comfiguration.

Is there a way to alter the configuration after a VM is created?

Thank you.

I got a “workaround”, maybe not a good solution for you.
But first:

I tested on 5.2, so I think it should work on 5.4:

  1. Create VM;
  2. (Optional) Work with them;
  3. In VM/Storage, save the disk (“Save as…” button);
  4. Detach the disk;
  5. Reattach the disk, with the required configuration (IOPS, etc…).

Again, I know it’s a workaround, not a solution, but I hope it helps in the mean time.

Yeah I also thought about this. This is the only possibility in my eyes currently. But what about a VM with volatile disks attached to it. In this case I cannot save them.

I would be interested what the Opennebula team thinks about this? @ruben @jfontan @tinova what do you think about this? Is there a way to alter the VM configuration after deployment?

Hi,

With OpenNebula 5.4 you can change the VM metadata using onevm change body vm --id <VMID> but you should still need to run an operation that re-creates the VM deployment file like undeploy and then resume.

For example to change TOTAL_BYTES_SEC to ‘2048’ for disk with ID 3 in VM with ID 123:

onedb change-body vm --id 123 '/VM/TEMPLATE/DISK[DISK_ID=3]/TOTAL_BYTES_SEC/' 2048

Please note that AFAIK currently with this interface you can only alter and delete already available attributes but it it is not possible to add new ones(#5448), also it is working only for VMs owned by oneadmin (#5443).

Hope this helps…

Best Regards,
Anton Todorov