Questo contenuto non è disponibile nella lingua selezionata.
A.10. Shutting down Red Hat Enterprise Linux 6 Guests on a Red Hat Enterprise Linux 7 Host
Installing Red Hat Enterprise Linux 6 guest virtual machines with the
Minimal installation
option does not install the acpid (acpi daemon). Red Hat Enterprise Linux 7 no longer requires this package, as it has been taken over by systemd
. However, Red Hat Enterprise Linux 6 guest virtual machines running on a Red Hat Enterprise Linux 7 host still require it.
Without the acpid package, the Red Hat Enterprise Linux 6 guest virtual machine does not shut down when the
virsh shutdown
command is executed. The virsh shutdown
command is designed to gracefully shut down guest virtual machines.
Using the
virsh shutdown
command is easier and safer for system administration. Without graceful shut down with the virsh shutdown
command a system administrator must log into a guest virtual machine manually or send the Ctrl-Alt-Del key combination to each guest virtual machine.
Note
Other virtualized operating systems may be affected by this issue. The
virsh shutdown
command requires that the guest virtual machine operating system is configured to handle ACPI shut down requests. Many operating systems require additional configurations on the guest virtual machine operating system to accept ACPI shut down requests.
Procedure A.4. Workaround for Red Hat Enterprise Linux 6 guests
Install the acpid package
Theacpid
service listens and processes ACPI requests.Log into the guest virtual machine and install the acpid package on the guest virtual machine:Copy to Clipboard Copied! Toggle word wrap Toggle overflow yum install acpid
# yum install acpid
Enable the acpid service on the guest
Set theacpid
service to start during the guest virtual machine boot sequence and start the service:Copy to Clipboard Copied! Toggle word wrap Toggle overflow chkconfig acpid on service acpid start
# chkconfig acpid on # service acpid start
Prepare guest domain XML
Edit the domain XML file to include the following element. Replace the virtio serial port withorg.qemu.guest_agent.0
and use your guest's name instead of the one shown. In this example, the guest is guest1. Remember to save the file.Copy to Clipboard Copied! Toggle word wrap Toggle overflow <channel type='unix'> <source mode='bind' path='/var/lib/libvirt/qemu/guest1.agent'/> <target type='virtio' name='org.qemu.guest_agent.0'/> </channel>
<channel type='unix'> <source mode='bind' path='/var/lib/libvirt/qemu/guest1.agent'/> <target type='virtio' name='org.qemu.guest_agent.0'/> </channel>
Figure A.1. Guest XML replacement
Install the QEMU guest agent
Install the QEMU guest agent (QEMU-GA) and start the service as directed in the Red Hat Enterprise Linux 6 Virtualization Administration Guide.Shut down the guest
- List the known guest virtual machines so you can retrieve the name of the one you want to shutdown.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow virsh list --all
# virsh list --all Id Name State ---------------------------------- 14 guest1 running
- Shut down the guest virtual machine.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow virsh shutdown guest1
# virsh shutdown guest1 guest virtual machine guest1 is being shutdown
- Wait a few seconds for the guest virtual machine to shut down. Verify it is shutdown.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow virsh list --all
# virsh list --all Id Name State ---------------------------------- 14 guest1 shut off
- Start the guest virtual machine named guest1, with the XML file you edited.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow virsh start guest1
# virsh start guest1
- Shut down the acpi in the guest1 guest virtual machine.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow virsh shutdown --mode acpi guest1
# virsh shutdown --mode acpi guest1
- List all the guest virtual machines again, guest1 should still be on the list, and it should indicate it is shut off.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow virsh list --all
# virsh list --all Id Name State ---------------------------------- 14 guest1 shut off
- Start the guest virtual machine named guest1, with the XML file you edited.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow virsh start guest1
# virsh start guest1
- Shut down the guest1 guest virtual machine guest agent.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow virsh shutdown --mode agent guest1
# virsh shutdown --mode agent guest1
- List the guest virtual machines. guest1 should still be on the list, and it should indicate it is shut off.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow virsh list --all
# virsh list --all Id Name State ---------------------------------- guest1 shut off
The guest virtual machine will shut down using the
virsh shutdown
command for the consecutive shutdowns, without using the workaround described above.
In addition to the method described above, a guest can be automatically shutdown, by stopping the
libvirt-guests
service. See Section A.11, “Optional Workaround to Allow for Graceful Shutdown” for more information on this method.