Comment 4 for bug 996840

Revision history for this message
Hendrik Volkmer (hvolkmer) wrote :

I can reproduce this using Ubuntu LTS 12.04 and 0.9.8-2ubuntu17 as mentioned. I use OpenStack nova (2012.1-0ubuntu2) and (openstack-dashboard 2012.1-0ubuntu8). However the same problem occurs when the nova command line client is used.

The nova.conf part relevant for nova-volume looks like this:

volume_group=nova-volumes
volume_name_template=volume-%08x
iscsi_helper=tgtadm

The iSCSI device on the nova-volume side is created successfully and is usable from the physical host. I can attach and use the device using "virsh" but now using OpenStack.

Replacing the line

virt_dom.attachDevice(xml)

in /usr/share/pyshared/nova/virt/libvirt/connection.py with

                LOG.info("Attaching device with virsh because attachDevice does not work")
                device_path = connection_info['data']['device_path']
                utils.execute('virsh', "attach-disk", instance_name, device_path, mount_device, run_as_root=True)

and adding

                filters.CommandFilter("/usr/bin/virsh", "root"),

to /usr/share/pyshared/nova/rootwrap/compute.py

works.

This behaviour is rather strange as I am sure it worked before.

This I tried:
 - restarting all nova services (on compute host and controller which is also the nova volume host)
 - restarting libvirt-bin
 - restarting tgtd on nova-volume host

I also tried to manually attach the volume using the libvirt-python bindings like this:

conn=libvirt.open("qemu:///system")
dom = conn.lookupByName("instance-00000047")

xml="""<disk type='block'>
                     <driver name='qemu' type='raw' cache='none'/>
                     <source dev='/dev/disk/by-path/ip-192.168.124.81:3260-iscsi-iqn.2010-10.org.openstack:volume-00000009-lun-1'/>
                     <target dev='vdc' bus='virtio'/>
                 </disk>"""

dom.attachDevice(xml)

The result was the same as with OpenStack: The API call hangs and the libvirt log does not show any other info as already posted above.

Attaching the volume via CLI using "virsh" does work.

Detaching the volume also works with Python using dom.detachDevice(xml).