QA:Testcase Virtualization Guest Suspend Hibernate

From FedoraProject

(Difference between revisions)
Jump to: navigation, search
(Create this page)
 
(Add qemu guest agent bits)
(3 intermediate revisions by 2 users not shown)
Line 12: Line 12:
  
 
== Initiating suspend/hibernate from inside the guest ==
 
== Initiating suspend/hibernate from inside the guest ==
 +
 +
Known bugs:
 +
* Closing a graphical window triggers a guest resume [https://bugzilla.redhat.com/show_bug.cgi?id=871240 bug 871240]
  
 
# Start a VM, connect to the graphical console with virt-manager
 
# Start a VM, connect to the graphical console with virt-manager
# From inside the guest, as root, run:
+
# From inside the guest, as root, run:<br><pre># pm-suspend</pre>
      # pm-suspend
+
 
# Verify the state changes to 'suspended' in the main virt-manager window
 
# Verify the state changes to 'suspended' in the main virt-manager window
 
# Click inside the black VM guest console, and press any key on the keyboard
 
# Click inside the black VM guest console, and press any key on the keyboard
 
# Verify the VM resumes right where it left off.
 
# Verify the VM resumes right where it left off.
# From inside the guest, as root, run:  
+
# From inside the guest, as root, run: <br><pre># pm-hibernate</pre>
      # pm-hibernate
+
 
# Verify the guest appears to shutdown in the main virt-manager window
 
# Verify the guest appears to shutdown in the main virt-manager window
 
# Start the guest again
 
# Start the guest again
Line 28: Line 29:
 
== Initiating suspend/hibernate from the host ==
 
== Initiating suspend/hibernate from the host ==
  
# Start a VM, connect to the graphical console with virt-manager
+
# Run a VM. Install qemu-guest-agent: <br><pre>yum install qemu-guest-agent</pre>
# From the host machine, as root, suspend the guest with virsh:
+
# Shutdown the VM. With virsh edit, add the XML block to <code><devices></code> like: <br><code><channel type='unix'><br>  <source mode='bind' path='/var/lib/libvirt/qemu/f18.agent'/><br>  <target type='virtio' name='org.qemu.guest_agent.0'/><br></channel></code>
      # virsh dompmsuspend --target mem
+
# Start the VM, connect to the graphical console with virt-manager
# Watch virsh until the VM is listed as 'suspended':
+
# Verify the agent is running with (you should see some output): <br><pre>ps axwww | grep "qemu-ga"</pre>
      # virsh list --all
+
# From the host machine, as root, suspend the guest with virsh: <br><pre># virsh dompmsuspend f18 --target mem</pre>
# Wake the guest up with virsh:
+
# Watch virsh until the VM is listed as 'suspended': <br><pre># virsh list --all</pre>
      # virsh dompmwakeup
+
# Wake the guest up with virsh: <br><pre># virsh dompmwakeup f18</pre>
 
# Using the graphical console, verify the guest appeared to resume correctly
 
# Using the graphical console, verify the guest appeared to resume correctly
# From the host machine, as root, hibernate the guest with virsh:
+
# From the host machine, as root, hibernate the guest with virsh: <br><pre># virsh dompmsuspend f18 --target disk</pre>
      # virsh dompmsuspend --target disk
+
# Watch virsh until the VM is listed as shutoff: <br><pre># virsh list --all</pre>
# Watch virsh until the VM is listed as shutoff:
+
# Start the quest again
      # virsh list --all
+
# Wake the guest up with virsh:
+
      # virsh dompmwakeup
+
 
# Verify that the VM resumes right where it left off
 
# Verify that the VM resumes right where it left off
  

Revision as of 14:18, 1 November 2012

Contents

Description

Suspend and Hibernate a VM. Verify it resumes as expected. For more details, see:

http://fedoraproject.org/wiki/Features/Virt_Guest_Suspend_Hibernate

Setup

Nothing beyond the initial test day setup (basically a function F18 VM).

How to test

Initiating suspend/hibernate from inside the guest

Known bugs:

  • Closing a graphical window triggers a guest resume bug 871240
  1. Start a VM, connect to the graphical console with virt-manager
  2. From inside the guest, as root, run:
    # pm-suspend
  3. Verify the state changes to 'suspended' in the main virt-manager window
  4. Click inside the black VM guest console, and press any key on the keyboard
  5. Verify the VM resumes right where it left off.
  6. From inside the guest, as root, run:
    # pm-hibernate
  7. Verify the guest appears to shutdown in the main virt-manager window
  8. Start the guest again
  9. Verify that the VM resumes right where it left off


Initiating suspend/hibernate from the host

  1. Run a VM. Install qemu-guest-agent:
    yum install qemu-guest-agent
  2. Shutdown the VM. With virsh edit, add the XML block to <devices> like:
    <channel type='unix'>
    <source mode='bind' path='/var/lib/libvirt/qemu/f18.agent'/>
    <target type='virtio' name='org.qemu.guest_agent.0'/>
    </channel>
  3. Start the VM, connect to the graphical console with virt-manager
  4. Verify the agent is running with (you should see some output):
    ps axwww | grep "qemu-ga"
  5. From the host machine, as root, suspend the guest with virsh:
    # virsh dompmsuspend f18 --target mem
  6. Watch virsh until the VM is listed as 'suspended':
    # virsh list --all
  7. Wake the guest up with virsh:
    # virsh dompmwakeup f18
  8. Using the graphical console, verify the guest appeared to resume correctly
  9. From the host machine, as root, hibernate the guest with virsh:
    # virsh dompmsuspend f18 --target disk
  10. Watch virsh until the VM is listed as shutoff:
    # virsh list --all
  11. Start the quest again
  12. Verify that the VM resumes right where it left off

Expected Results

No obvious errors encountered, guests seem to be functioning as normal after resuming.