← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1528548] [NEW] Wrong bdm entry picked up during detach if there are failed deploys with a block device

 

Public bug reported:

Steps to reproduce

- Boot vm1 with cinder volume vol1 using block-device option on host1
- vm1 creation fails and gets rescheduled to another host2. The instance is cleaned up but the volumes are still in 'Available' state
- instance creation fails on host2 as well and goes to 'Error' state
- Another instance vm2 uses the same volume vol1 to boot and is created successfully
- Detach vol1 from vm2

Expected: vol1 should get detached from vm2

Actual:  detach volume fails with

ERROR nova.compute   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 4691, in _driver_detach_volume
ERROR nova.compute     connection_info = jsonutils.loads(bdm.connection_info)
ERROR nova.compute   File "/usr/lib/python2.7/dist-packages/oslo_serialization/jsonutils.py", line 214, in loads
ERROR nova.compute     return json.loads(encodeutils.safe_decode(s, encoding), **kwargs)
ERROR nova.compute   File "/usr/lib/python2.7/dist-packages/oslo_utils/encodeutils.py", line 33, in safe_decode
ERROR nova.compute     raise TypeError("%s can't be decoded" % type(text))
ERROR nova.compute
ERROR nova.compute TypeError: <type 'NoneType'> can't be decoded

The issue is that remove_volume_connection in nova manager.py picks the
first bdm entry for the given vol1
(objects.BlockDeviceMapping.get_by_volume_id() and in this case the vm1
which was also booting from same volume has bdm entries for vol1. The
remove_volume_connection should pick the right bdm by volume and
instance id.

** Affects: nova
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1528548

Title:
  Wrong bdm entry picked up during detach if there are failed deploys
  with a block device

Status in OpenStack Compute (nova):
  New

Bug description:
  Steps to reproduce

  - Boot vm1 with cinder volume vol1 using block-device option on host1
  - vm1 creation fails and gets rescheduled to another host2. The instance is cleaned up but the volumes are still in 'Available' state
  - instance creation fails on host2 as well and goes to 'Error' state
  - Another instance vm2 uses the same volume vol1 to boot and is created successfully
  - Detach vol1 from vm2

  Expected: vol1 should get detached from vm2

  Actual:  detach volume fails with

  ERROR nova.compute   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 4691, in _driver_detach_volume
  ERROR nova.compute     connection_info = jsonutils.loads(bdm.connection_info)
  ERROR nova.compute   File "/usr/lib/python2.7/dist-packages/oslo_serialization/jsonutils.py", line 214, in loads
  ERROR nova.compute     return json.loads(encodeutils.safe_decode(s, encoding), **kwargs)
  ERROR nova.compute   File "/usr/lib/python2.7/dist-packages/oslo_utils/encodeutils.py", line 33, in safe_decode
  ERROR nova.compute     raise TypeError("%s can't be decoded" % type(text))
  ERROR nova.compute
  ERROR nova.compute TypeError: <type 'NoneType'> can't be decoded

  The issue is that remove_volume_connection in nova manager.py picks
  the first bdm entry for the given vol1
  (objects.BlockDeviceMapping.get_by_volume_id() and in this case the
  vm1 which was also booting from same volume has bdm entries for vol1.
  The remove_volume_connection should pick the right bdm by volume and
  instance id.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1528548/+subscriptions


Follow ups