For qemu/kvm domains that comes down to the function
qemuDomainSetAutostart and that just creates a symlink.
So for example:
$ virsh autostart h-test1
Domain 'h-test1' marked as autostarted
Actually creates:
root@h:~# ll /etc/libvirt/qemu/autostart/
total 3
drwxr-xr-x 2 root root 3 Mar 26 08:24 ./
drwxr-xr-x 4 root root 6 Mar 26 08:24 ../
lrwxrwxrwx 1 root root 29 Mar 26 08:24 h-test1.xml ->
/etc/libvirt/qemu/h-test1.xml
Now if after that I rename (which only works if it is inactive) it
automatically also renames the symlink.
root@h:~# virsh domrename h-test1 h-test1-newname
error: Requested operation is not valid: cannot rename active domain
root@h:~# virsh shutdown h-test1
Domain 'h-test1' is being shutdown
root@h:~# virsh domrename h-test1 h-test1-newname
Domain successfully renamed
root@h:~# ll /etc/libvirt/qemu/autostart/
total 3
drwxr-xr-x 2 root root 3 Mar 26 08:32 ./
drwxr-xr-x 4 root root 6 Mar 26 08:32 ../
lrwxrwxrwx 1 root root 37 Mar 26 08:32 h-test1-newname.xml ->
/etc/libvirt/qemu/h-test1-newname.xml
I've tested that with the latest libvirt in Ubuntu which is 7.0.0-2ubuntu1
Now chances are still that this was broken in the past ... let me try that as
well
** Also affects: libvirt (Ubuntu Bionic)
Importance: Undecided
Status: New
** Also affects: libvirt (Ubuntu Focal)
Importance: Undecided
Status: New
** Changed in: libvirt (Ubuntu)
Status: New => Fix Released
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1921325
Title:
VM will not auto-start automatically when server is rebooted after
virsh domrename
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1921325/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs