OpenStack Compute (Nova)

Problem specifying device when attaching volumes on XEN

Reported by Chuck Thier on 2012-02-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Critical
Brian Waldon

Bug Description

If I try something like

nova volume-attach de5410d9-c0c8-4489-9948-841feaa4fb55 20 /dev/xvde

The following traceback shows up:

2012-02-28 14:19:05 AUDIT nova.compute.manager [req-6fe7a27f-08d2-44a7-a5a1-aa4d65a9efe2 0747b73bf9404bfaae6c810837241d8e 12345] [instance: de5410d9-c0c8-448
9-9948-841feaa4fb55] Attaching volume 20 to /dev/xvde
2012-02-28 14:19:05 DEBUG nova.rpc.common [-] Making asynchronous call on volume.z2-api1 ... from (pid=10989) multicall /usr/lib/python2.6/dist-packages/nova
/rpc/amqp.py:318
2012-02-28 14:19:05 DEBUG nova.rpc.common [-] MSG_ID is ef3894da50e740bf830614b3f4e1000c from (pid=10989) multicall /usr/lib/python2.6/dist-packages/nova/rpc
/amqp.py:321
2012-02-28 14:19:05 DEBUG nova.virt.xenapi.volumeops [-] Attach_volume: {u'driver_volume_type': u'iscsi', u'data': {u'target_portal': u'10.190.254.22:3260',
u'target_iqn': u'iqn.2010-11.com.rackspace:volume-00000014', u'target_discovered': False, u'volume_id': 20}}, instance-00000016, /dev/xvde from (pid=10989) a
ttach_volume /usr/lib/python2.6/dist-packages/nova/virt/xenapi/volumeops.py:123
2012-02-28 14:19:05 DEBUG nova.virt.xenapi.volumeops [-] {u'driver_volume_type': u'iscsi', u'data': {u'target_portal': u'10.190.254.22:3260', u'target_iqn':
u'iqn.2010-11.com.rackspace:volume-00000014', u'target_discovered': False, u'volume_id': 20}} from (pid=10989) attach_volume /usr/lib/python2.6/dist-packages
/nova/virt/xenapi/volumeops.py:140
2012-02-28 14:19:05 WARNING nova.virt.xenapi.volume_utils [-] Mountpoint cannot be translated: xvde
2012-02-28 14:19:05 DEBUG nova.virt.xenapi.volume_utils [-] (vol_id,number,host,port,iqn): (20,10.190.254.22,3260,iqn.2010-11.com.rackspace:volume-00000014)
from (pid=10989) parse_volume_info /usr/lib/python2.6/dist-packages/nova/virt/xenapi/volume_utils.py:334
2012-02-28 14:19:05 ERROR nova.compute.manager [req-6fe7a27f-08d2-44a7-a5a1-aa4d65a9efe2 0747b73bf9404bfaae6c810837241d8e 12345] [instance: de5410d9-c0c8-448
9-9948-841feaa4fb55] Attach failed /dev/xvde, removing
(nova.compute.manager): TRACE: Traceback (most recent call last):
(nova.compute.manager): TRACE: File "/usr/lib/python2.6/dist-packages/nova/compute/manager.py", line 1660, in attach_volume
(nova.compute.manager): TRACE: mountpoint)
(nova.compute.manager): TRACE: File "/usr/lib/python2.6/dist-packages/nova/virt/xenapi_conn.py", line 371, in attach_volume
(nova.compute.manager): TRACE: mountpoint)
(nova.compute.manager): TRACE: File "/usr/lib/python2.6/dist-packages/nova/virt/xenapi/volumeops.py", line 144, in attach_volume
(nova.compute.manager): TRACE: mountpoint)
(nova.compute.manager): TRACE: File "/usr/lib/python2.6/dist-packages/nova/virt/xenapi/volume_utils.py", line 340, in parse_volume_info
(nova.compute.manager): TRACE: ' %(data)s, %(mountpoint)s') % locals())
(nova.compute.manager): TRACE: StorageError: Unable to obtain target information {u'target_portal': u'10.190.254.22:3260', u'target_iqn': u'iqn.2010-11.com.r
ackspace:volume-00000014', u'target_discovered': False, u'volume_id': 20}, /dev/xvde
(nova.compute.manager): TRACE:
2012-02-28 14:19:05 DEBUG nova.rpc.common [-] Making asynchronous call on volume.z2-api1 ... from (pid=10989) multicall /usr/lib/python2.6/dist-packages/nova
/rpc/amqp.py:318
2012-02-28 14:19:05 DEBUG nova.rpc.common [-] MSG_ID is 953b08b88c5842f2bf3e075318344188 from (pid=10989) multicall /usr/lib/python2.6/dist-packages/nova/rpc
/amqp.py:321

and the volume doesn't get properly attached.

If I instead run: nova volume-attach de5410d9-c0c8-4489-9948-841feaa4fb55 20 /dev/vde

The operation completes and mounts as /dev/xvde in the vm

Vish Ishaya (vishvananda) wrote :

looks like the translation doesn't support xv...

nova/virt/xenapi/volume_utils.py

353 @classmethod
354 def mountpoint_to_number(cls, mountpoint):
355 """Translate a mountpoint like /dev/sdc into a numeric"""
356 if mountpoint.startswith('/dev/'):
357 mountpoint = mountpoint[5:]
358 if re.match('^[hs]d[a-p]$', mountpoint):
359 return (ord(mountpoint[2:3]) - ord('a'))
360 elif re.match('^vd[a-p]$', mountpoint):
361 return (ord(mountpoint[2:3]) - ord('a'))
362 elif re.match('^[0-9]+$', mountpoint):
363 return string.atoi(mountpoint, 10)
364 else:
365 LOG.warn(_('Mountpoint cannot be translated: %s'), mountpoint)
366 return -1

Changed in nova:
status: New → Triaged
importance: Undecided → Critical
Changed in nova:
milestone: none → essex-4
Thierry Carrez (ttx) wrote :

For Vish to reassign

Changed in nova:
assignee: nobody → Vish Ishaya (vishvananda)
Brian Waldon (bcwaldon) on 2012-02-28
Changed in nova:
assignee: Vish Ishaya (vishvananda) → Brian Waldon (bcwaldon)
Brian Waldon (bcwaldon) on 2012-02-28
Changed in nova:
status: Triaged → In Progress

Reviewed: https://review.openstack.org/4657
Committed: http://github.com/openstack/nova/commit/2fa6e23e9cefb8e45bd5a6cec36b1ac6b7ac65c3
Submitter: Jenkins
Branch: master

commit 2fa6e23e9cefb8e45bd5a6cec36b1ac6b7ac65c3
Author: Brian Waldon <email address hidden>
Date: Tue Feb 28 16:18:53 2012 -0800

    Allow xvd* to be supplied for volume in xenapi

    * Fixes bug 942880

    Change-Id: I7d0817051b837e3ba17f4edd8c47fd2c730c9822

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2012-02-29
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in nova:
milestone: essex-4 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers