the volume multiattach and in-use after retype another backend, then can not detach it
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
New
|
Medium
|
Unassigned |
Bug Description
first step: we create a volume support multiattach and volume type is ceph;
second step: then we attach it on a vm;
third step: when the volume in-use, then retype the volume to another backend such as huawei;
forth step: we detach the volume from the vm, but we can not detach it, we can get the bug;
a bug info like this:
./nova-
we location this bug happen at code (nova/virt/
def _should_
# NOTE(jdg): Multiattach is a special case (not to be confused
# with shared_targets). With multiattach we may have a single volume
# attached multiple times to *this* compute node (ie Server-1 and
# Server-2). So, if we receive a call to delete the attachment for
# Server-1 we need to take special care to make sure that the Volume
# isn't also attached to another Server on this Node. Otherwise we
# will indiscriminantly delete the connection for all Server and that's
# no good. So check if it's attached multiple times on this node
# if it is we skip the call to brick to delete the connection.
if not multiattach:
return True
# NOTE(deiter): Volume drivers using _HostMountState
# special case. _HostMountState
# only attempts to mount a single mountpoint in use by multiple
# attachments once, and that it is not unmounted until it is no longer
# in use by any attachments. So we can skip the multiattach check for
# volume drivers that based on LibvirtMountedF
if isinstance(
return True
volume = self._volume_
volume = self._volume_
this could not get volume, because volume_id from nova connection_info , when we have retype once to another backend, volume_id change to the new id, but cinder only save the old volume id, at connection info is the serial filed.
for example:
the ceph volume had been attach on a vm, it is connection info is:
connection_info: {"driver_
after we retype it to huawei, it is connection info is:
{"driver_
we colud find after retype, the connection info volume_id has been changed from cfbd9c4d-
Changed in cinder: | |
importance: | Undecided → Medium |
tags: | added: attached in-use migrate multiattach retype |
Hi shiyawei,
would you mind sharing the cinder version you're using?
Thanks in advance.
Sofia