Bug 644705 - "virsh start demo" will be hang with an encrypted qcow2 img
Summary: "virsh start demo" will be hang with an encrypted qcow2 img
Keywords:
Status: CLOSED DUPLICATE of bug 644706
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt
Version: 5.6
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Daniel Veillard
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-10-20 01:58 UTC by wangyimiao
Modified: 2010-10-20 10:21 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-10-20 10:21:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description wangyimiao 2010-10-20 01:58:23 UTC
Description of problem:
"virsh start demo" will be hang with an encrypted qcow2 img 

Version-Release number of selected component (if applicable):
libvirt-0.8.2-7.el5
kvm-qemu-img-83-205.el5
kvm-83-205.el5
kernel-2.6.18-227.el5

How reproducible:
5/5

Steps to Reproduce:
1. Define a secret with an XML document.
    # cat demo-secret.xml
    <secret ephemeral='no' private='no'>
      <uuid>0a81f5b2-8403-7b23-c8d6-21ccc2f80d6f</uuid>
      <usage type='volume'>
        <volume>/var/lib/libvirt/images/demo.qcow2</volume>
      </usage>
    </secret>
    # virsh secret-define demo-secret.xml
    Secret 0a81f5b2-8403-7b23-c8d6-21ccc2f80d6f created

2. Set the value of the secret.
    # MYSECRET=`echo "open seseme" | base64`
    # virsh secret-set-value 0a81f5b2-8403-7b23-c8d6-21ccc2f80d6f $MYSECRET
    Secret value set

3. Define and active a pool with the following XML.
    # cat demo-pool.xml
    <pool type='dir'>
      <name>VirtualMachines</name>
      <source>
      </source>
      <target>
        <path>/var/lib/libvirt/images</path>
      </target>
    </pool>
    # virsh pool-define demo-pool.xml
    Pool VirtualMachines defined from demo-pool.xml
    # virsh pool-start VirtualMachines
    Pool VirtualMachines started

4. To create an encrypted volume within this pool with the follwing XML.

# cat demo-disk.xml
      <volume>
        <name>demo.qcow2</name>
        <capacity>5368709120</capacity>
        <target>
          <format type='qcow2'/>
          <encryption format='qcow'>
            <secret type='passphrase' uuid='0a81f5b2-8403-7b23-c8d6-21ccc2f80d6f'/>
          </encryption>
        </target>
      </volume>
    # virsh vol-create VirtualMachines demo-disk.xml
    Vol demo.qcow2 created from demo-disk.xml

5. With the following XML config which associates the qcow decryption ‘passphrase’ with the secret we defined to define a new RHEL5.5 guest, and then start it.

# wget http://download.englab.nay.redhat.com/pub/rhel/rel-eng/RHEL5.5-Server-20100322.0/tree-x86_64/images/pxeboot/initrd.img

# wget http://download.englab.nay.redhat.com/pub/rhel/rel-eng/RHEL5.5-Server-20100322.0/tree-x86_64/images/pxeboot/vmlinuz

# cp initrd.img vmlinuz /var/lib/libvirt/boot/

# cat demo-guest.xml
    <domain type='kvm'>
      <name>demo</name>
      <memory>524288</memory>
      <vcpu>1</vcpu>
      <os>
        <type arch='x86_64' machine='pc'>hvm</type>
        <kernel>/var/lib/libvirt/boot/vmlinuz</kernel>
        <initrd>/var/lib/libvirt/boot/initrd.img</initrd>
        <boot dev='hd'/>
      </os>
      <devices>
        <emulator>/usr/libexec/qemu-kvm</emulator>
        <disk type='file' device='disk'>
          <driver name='qemu' type='qcow2'/>
          <source file='/var/lib/libvirt/images/demo.qcow2'/>
          <target dev='hda' bus='ide'/>
          <encryption format='qcow'>
            <secret type='passphrase' uuid='0a81f5b2-8403-7b23-c8d6-21ccc2f80d6f'/>
          </encryption>
        </disk>
        <interface type='network'>
          <mac address='52:54:00:53:a6:f0'/>
          <source network='default'/>
        </interface>
        <serial type='pty'>
          <target port='0'/>
        </serial>
        <console type='pty'>
          <target port='0'/>
        </console>
        <input type='tablet' bus='usb'/>
        <input type='mouse' bus='ps2'/>
        <graphics type='vnc' port='-1' autoport='yes'/>
      </devices>
    </domain>
 
# virsh define demo-guest.xml
    Domain demo defined from demo-guest.xml
# virsh start demo
  
Actual results:
"virsh start demo" will be hang and guest can not be start successfully.

Expected results:
Command will be done succeddfully and guest will be start successfully.

Comment 1 Jiri Denemark 2010-10-20 10:21:25 UTC

*** This bug has been marked as a duplicate of bug 644706 ***


Note You need to log in before you can comment on or make changes to this bug.