Skip to content

block_device: Use the cinder attachment connection_info on detach - #655

Draft
leust wants to merge 1 commit into
stable/2023.2-m3from
detach-use-cinder-connection-info
Draft

block_device: Use the cinder attachment connection_info on detach#655
leust wants to merge 1 commit into
stable/2023.2-m3from
detach-use-cinder-connection-info

Conversation

@leust

@leust leust commented Aug 14, 2026

Copy link
Copy Markdown

Nova detaches a volume with the connection_info it stashed in the BDM at attach time. Cinder is the authoritative source for that data, so the BDM copy can be stale by the time we detach.

The case we hit in production is a volume that was migrated to the FCD driver behind nova's back: the BDM still says driver_volume_type 'vmdk' while cinder says 'fcd'. VMwareVolumeOps.detach_volume dispatches on driver_volume_type, so nova only notices the migration once the detach fails.

Refresh the connection_info from the cinder attachment record before handing it to the virt driver. The multipath_id that os-brick found on this host and the multiattach flag are known to nova only, so they are preserved across the refresh.

This is best-effort: if the attachment cannot be read or carries no connection_info, we keep using the BDM data as before, so an unreachable cinder does not turn into a failed detach.

Only the local detach path is changed. driver_detach() as called from _remove_volume_connection() is left alone, because during live migration the BDM attachment is swapped between source and destination and refreshing there could hand a host the other host's connection_info.

Change-Id: I662960d9a72057a6e976300314038001da2ff54e

Nova detaches a volume with the connection_info it stashed in the BDM at
attach time. Cinder is the authoritative source for that data, so the BDM
copy can be stale by the time we detach.

The case we hit in production is a volume that was migrated to the FCD
driver behind nova's back: the BDM still says driver_volume_type 'vmdk'
while cinder says 'fcd'. VMwareVolumeOps.detach_volume dispatches on
driver_volume_type, so nova only notices the migration once the detach
fails.

Refresh the connection_info from the cinder attachment record before
handing it to the virt driver. The multipath_id that os-brick found on
this host and the multiattach flag are known to nova only, so they are
preserved across the refresh.

This is best-effort: if the attachment cannot be read or carries no
connection_info, we keep using the BDM data as before, so an unreachable
cinder does not turn into a failed detach.

Only the local detach path is changed. driver_detach() as called from
_remove_volume_connection() is left alone, because during live migration
the BDM attachment is swapped between source and destination and
refreshing there could hand a host the other host's connection_info.

Change-Id: I662960d9a72057a6e976300314038001da2ff54e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant