Unmapping image fails on ceph 13.2.0+

Bug #1884052 reported by Stephen Finucane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
os-brick
Fix Released
Undecided
Stephen Finucane

Bug Description

When nova fails to attach a volume to an instance, it will attempt to disconnect it. On a compute node with ceph 14.x, this fails:

  Traceback (most recent call last):
    File "/usr/lib/python3.6/site-packages/nova/virt/block_device.py", line 582, in _volume_attach
      device_type=self['device_type'], encryption=encryption)
    File "/usr/lib/python3.6/site-packages/nova/virt/libvirt/driver.py", line 1806, in attach_volume
      encryption=encryption)
    File "/usr/lib/python3.6/site-packages/nova/virt/libvirt/driver.py", line 1594, in _connect_volume
      vol_driver.disconnect_volume(connection_info, instance)
    File "/usr/lib/python3.6/site-packages/nova/virt/libvirt/volume/net.py", line 96, in disconnect_volume
      self.connector.disconnect_volume(connection_info['data'], None)
    File "/usr/lib/python3.6/site-packages/os_brick/utils.py", line 150, in trace_logging_wrapper
      result = f(*args, **kwargs)
    File "/usr/lib/python3.6/site-packages/os_brick/initiator/connectors/rbd.py", line 248, in disconnect_volume
      root_device = self._find_root_device(connection_properties)
    File "/usr/lib/python3.6/site-packages/os_brick/initiator/connectors/rbd.py", line 229, in _find_root_device
      for index, mapping in jsonutils.loads(out).items():
  AttributeError: 'list' object has no attribute 'items'

The culprit appear to have been a change introduced in ceph v13.2.0 (Mimic). From [1].

  The rbd CLI’s showmapped JSON and XML output has changed.

This specific change appear to have been [2].

There appear to be additional issues here with regards to why the *attach* failed, but I can track those separately.

[1] https://docs.ceph.com/docs/master/releases/mimic/#upgrade-compatibility-notes
[2] https://github.com/ceph/ceph/commit/de97a3be483242eab14175a3cc3408df34d5c19a

Changed in os-brick:
assignee: nobody → Stephen Finucane (stephenfinucane)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-brick (master)

Fix proposed to branch: master
Review: https://review.opendev.org/736566

Changed in os-brick:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-brick (master)

Reviewed: https://review.opendev.org/736566
Committed: https://git.openstack.org/cgit/openstack/os-brick/commit/?id=a87ef7bbabc80bf7f2d078764986aea2cbb90aa5
Submitter: Zuul
Branch: master

commit a87ef7bbabc80bf7f2d078764986aea2cbb90aa5
Author: Stephen Finucane <email address hidden>
Date: Thu Jun 18 11:33:33 2020 +0100

    rbd: Support 'rbd showmapped' output from ceph 13.2.0+

    Ceph 13.2.0 changed [1] the JSON and XML output format for the 'rbd
    showmapped' command, from a object keyed by device ID to a list of
    device objects. Handle this change.

    Change-Id: I55bc70437d41da3a32b8440d00c139805b8be256
    Signed-off-by: Stephen Finucane <email address hidden>
    Closes-Bug: #1884052

Changed in os-brick:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-brick (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/738235

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-brick (stable/ussuri)

Reviewed: https://review.opendev.org/738235
Committed: https://git.openstack.org/cgit/openstack/os-brick/commit/?id=bf0faeaea4626f7dee37a672da7e3f175b958086
Submitter: Zuul
Branch: stable/ussuri

commit bf0faeaea4626f7dee37a672da7e3f175b958086
Author: Stephen Finucane <email address hidden>
Date: Thu Jun 18 11:33:33 2020 +0100

    rbd: Support 'rbd showmapped' output from ceph 13.2.0+

    Ceph 13.2.0 changed [1] the JSON and XML output format for the 'rbd
    showmapped' command, from a object keyed by device ID to a list of
    device objects. Handle this change.

    Change-Id: I55bc70437d41da3a32b8440d00c139805b8be256
    Signed-off-by: Stephen Finucane <email address hidden>
    Closes-Bug: #1884052
    (cherry picked from commit a87ef7bbabc80bf7f2d078764986aea2cbb90aa5)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-brick (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/748590

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-brick (stable/train)

Reviewed: https://review.opendev.org/748590
Committed: https://git.openstack.org/cgit/openstack/os-brick/commit/?id=ba9d47a9b585dd619af857b6ea43dfb2ef04029c
Submitter: Zuul
Branch: stable/train

commit ba9d47a9b585dd619af857b6ea43dfb2ef04029c
Author: Stephen Finucane <email address hidden>
Date: Thu Jun 18 11:33:33 2020 +0100

    rbd: Support 'rbd showmapped' output from ceph 13.2.0+

    Ceph 13.2.0 changed [1] the JSON and XML output format for the 'rbd
    showmapped' command, from a object keyed by device ID to a list of
    device objects. Handle this change.

    Change-Id: I55bc70437d41da3a32b8440d00c139805b8be256
    Signed-off-by: Stephen Finucane <email address hidden>
    Closes-Bug: #1884052
    (cherry picked from commit a87ef7bbabc80bf7f2d078764986aea2cbb90aa5)
    (cherry picked from commit bf0faeaea4626f7dee37a672da7e3f175b958086)

tags: added: in-stable-train
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.