Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

14.9.2. 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 package. 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 virsh shutdown 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 configuration on the guest virtual machine operating system to accept ACPI shut down requests.

Procedure 14.4. Workaround for Red Hat Enterprise Linux 6 guests

  1. Install the acpid package

    The acpid service listen and processes ACPI requests.
    Log into the guest virtual machine and install the acpid package on the guest virtual machine:
    # yum install acpid
    Copy to Clipboard Toggle word wrap
  2. Enable the acpid service

    Set the acpid service to start during the guest virtual machine boot sequence and start the service:
    # chkconfig acpid on
    # service acpid start
    Copy to Clipboard Toggle word wrap
  3. Prepare guest domain xml

    Edit the domain XML file to include the following element. Replace the virtio serial port with org.qemu.guest_agent.0 and use your guest's name instead of $guestname
    <channel type='unix'>
       <source mode='bind' path='/var/lib/libvirt/qemu/{$guestname}.agent'/>
       <target type='virtio' name='org.qemu.guest_agent.0'/>
    </channel>
        
    
    
    Copy to Clipboard Toggle word wrap

    Figure 14.2. Guest XML replacement

  4. Install the QEMU guest agent

    Install the QEMU guest agent (QEMU-GA) and start the service as directed in Chapter 10, QEMU-img and QEMU Guest Agent. If you are running a Windows guest there are instructions in this chapter for that as well.
  5. Shutdown the guest

    1. Run the following commands
      # virsh list --all  - this command lists all of the known domains
         Id Name              State
      ----------------------------------
         rhel6                running
      
      Copy to Clipboard Toggle word wrap
    2. Shut down the guest virtual machine
      # virsh shutdown rhel6 virsh shutdown rhel6
      
      Domain rhel6 is being shutdown
      
      Copy to Clipboard Toggle word wrap
    3. Wait a few seconds for the guest virtual machine to shut down.
      # virsh list --all
       Id Name                 State
      ----------------------------------
        . rhel6                shut off
      
      Copy to Clipboard Toggle word wrap
    4. Start the domain named rhel6, with the XML file you edited.
      # virsh start rhel6
      Copy to Clipboard Toggle word wrap
    5. Shut down the acpi in the rhel6 guest virtual machine.
      # virsh shutdown --mode acpi rhel6  virsh shutdown --mode acpi rhel6  virsh shutdown --mode acpi rhel6 
      Copy to Clipboard Toggle word wrap
    6. List all the domains again, rhel6 should still be on the list, and it should indicate it is shut off.
      # virsh list --all
         Id Name                 State
      ----------------------------------
         rhel6                shut off
      
      Copy to Clipboard Toggle word wrap
    7. Start the domain named rhel6, with the XML file you edited.
      # virsh start rhel6 virsh start rhel6
      Copy to Clipboard Toggle word wrap
    8. Shut down the rhel6 guest virtual machine guest agent.
      # virsh shutdown --mode agent rhel6 virsh shutdown --mode agent rhel6
      Copy to Clipboard Toggle word wrap
    9. List the domains. rhel6 should still be on the list, and it should indicate it is shut off
      # virsh list --all
         Id Name                 State
      ----------------------------------
         rhel6                shut off
      
      Copy to Clipboard Toggle word wrap
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-guest service. Refer to Section 14.9.3, “Manipulating the libvirt-guests Configuration Settings” for more information on this method.
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat