Renaming KVM VMs or use their UUID for power settings

Hi,

I’m brand new in the MaaS/Juju world and after struggling a lot with it, I’m beginning to really enjoy it !

I encounter an annoying point though, when composing VMs with KVM (MaaS 2.8.2), MaaS assign them a random hostname and create the VM with libvirt on the KVM server with the same name.
This is great but when you rename the machine in MaaS, it is not renamed in libvirt and thus, it is quite complicated to remember which libvirt’s VM correspond to the MaaS machine.

Would be great if MaaS could rename the libvirt VM accordingly when renamed in MaaS.

That leads me to another point.
In order to workaround this, I renamed my libvirt VM with the MaaS name but, MaaS configures the libvirt power management with the original MaaS name it gives to the VM.
If you rename both MaaS machine and libvirt’s VM, power management won’t work anymore because it is using the libvirt’s VM name as the VMID and this is bad because this name can be changed.

On the other hand, it is possible (and better) to use the libvirt’s VM UUID instead as the VMID, this one will never change whatever you do to the VM name.

So, to summarize my feature request :

  • Make MaaS change the libvirt VM name when the machine name is changed in MaaS
  • Use the libvirt VM UUID instead of the name in the VMID value for libvirt power management

Best regards