Hello everyone,
I create kvm machines using a bash script. As expected from the
script, the resulting virtual machines are performing as they should
be. The aspect that I do not get is at the end of the creation, when
issuing a 'shutdown now' in the guest and expecting that it will shut
down. Instead it does shut down, but it is restarted immediately.
The machines are created using an Arch Linux ISO file. The bash script
runs in three stages, the first stage is on the host. virt-install
will show the regular Arch Linux installation interface. The bash
script is copied to the machine and its second stage is ran. After
that a chroot is done and the third phase of the script is executed.
When everything is configured and installed, here is what happens,
commands are prefixed '%', text output is as is, and comments in
'()' :
guest : % shutdown now
host : Domain creation completed.
host : Restarting guest.
(virt-manager shows the guest restarting)
host : % virsh shutdown test02
(nothing happens, guest still shown)
host : % virsh destroy test02
host : Domain test02 destroyed
(guest display closes)
What I'm expecting is that, when the 'shutdown now' is issued in the
guest, that it will effectively terminate the guest, 'virsh list --all'
will not show it running, and there'll be no need to issue a 'virsh
destroy'. I have no clue at the moment why virsh is restarting the
guest after a shutdown was issued in the guest. Looks like virsh did
not get that it should terminate the guest and considers the shutdown
as an error.
Here are the versions involved :
host : xubuntu 20.04 LTS
libvirt 6.0.0-0ubuntu8.15
virt-manager 1:2.2.1-3ubuntu2.1
guest : archlinux 2022.03.01-x86_64
Thanks !