How to update KVM Guests settings (under Pod) without deleting/composing?

I have a complex network settings for each Machine, because my environment deployed by MaaS will be used for OpenStack Ansible, so, each Machine have a BOND channel, many VLANs and many bridges on top of them.

I have created many VMs for acting as OpenStack Controllers, Ceph Mon/Mgr/Rgw and a few other things…

However, now, I need to resize the KVM Guests but, how?

I don’t want to delete/compose a new machine just to add more CPU/RAM/Storage to them! Since I’ll lose all the Network Interfaces configuration…

So, is there a way to update the Virtual Machines and just run “Commission” again?


If I understand your question correctly, you should be able to edit the virtual machine configuration on the libvirtd system (such as by using virt-manager or a similar tool). Then, if you browse to the KVM pod in MAAS, there is a Refresh function, which will update the metadata MAAS keeps track of (with regard to CPU, RAM, and disk usage).

Unfortunately, MAAS does not currently support resizing existing VMs, so it’s beyond the scope of this post to document exactly how to do that.

If you re-run commissioning, this would update the CPU/RAM/Storage information for that particular machine. You would want to do this when the machine (VM) is not in a deployed state, however.

Thanks man!

That’s exactly what I’m doing with Virt-Manager, however, there is a need to also, re-commission the VM, after Refreshing. Since I’m changing its “Name” and “storage size”.

I’m resizing the RAW storage as well, like:

dd bs=1 count=0 seek=10G if=/dev/zero of=/var/lib/libvirt/images/VIRTUAL-MACHINE-ID

It was 50G, too big.

I think you’re in uncharted waters if you’re changing the VM name. If I remember correctly, libvirt uses that as a primary key. So it could confuse MAAS if that changes, and that isn’t something we specifically tested for. After a rename and a refresh, it may show up in MAAS. But I can’t predict how doing that would impact the lifecycle of the machine.

You could possibly recommission the VMs in some scenarios, but I would advise you to then use the Mark broken feature to ensure that they won’t be marked Ready and then handed out to someone using the MAAS API to request a machine. Be careful!

I don’t think it will really hurt anything if the storage size of a deployed machine changes without the knowledge of MAAS. As an analogy, if you had a physical machine that you had deployed with MAAS, and then added storage while the machine was in-use, you would probably wait until you release the machine, and then recommission it so that MAAS sees the new storage size.

So if you change the VM name itself, you can try going to the ‘Configuration’ tab on the machine details page of the VM and change the field of ‘Virsh VM ID’ manually. Then run a refresh and see what happens.

I have not personally tested it but that should work for the rename. If you don’t update that on the machine that already exists, MAAS will discover it and will commission the machine as a new machine.