> The disconnect call I say it's probably being ignored/swallowed is the one to os-brick, not Cinder. In other words, Nova first calls os-brick to disconnect the volume from the compute host and then always considers this as successful (at least in some scenarios, probably instance destruction). Since it always considers in those scenarios that local disconnect was successful it calls Cinder to unmap/unexport the volume.
I just checked and indeed Nova will ignore a volume disconnect error in the case of an instance being deleted [1]:
try: self._disconnect_volume(context, connection_info, instance)
except Exception as exc:
with excutils.save_and_reraise_exception() as ctxt:
if cleanup_instance_disks:
# Don't block on Volume errors if we're trying to
# delete the instance as we may be partially created
# or deleted ctxt.reraise = False LOG.warning( "Ignoring Volume Error on vol %(vol_id)s " "during delete %(exc)s", {'vol_id': vol.get('volume_id'), 'exc': encodeutils.exception_to_unicode(exc)}, instance=instance)
In all other scenarios, Nova will not proceed further if the disconnect was not successful.
If Nova does proceed past _disconnect_volume(), it will later call Cinder API to delete the attachment [2]. I assume that is what does the unmap/unexport.
> The disconnect call I say it's probably being ignored/swallowed is the one to os-brick, not Cinder. In other words, Nova first calls os-brick to disconnect the volume from the compute host and then always considers this as successful (at least in some scenarios, probably instance destruction). Since it always considers in those scenarios that local disconnect was successful it calls Cinder to unmap/unexport the volume.
I just checked and indeed Nova will ignore a volume disconnect error in the case of an instance being deleted [1]:
try:
self._ disconnect_ volume( context, connection_info, instance) save_and_ reraise_ exception( ) as ctxt: instance_ disks:
ctxt. reraise = False
LOG.warning(
" Ignoring Volume Error on vol %(vol_id)s "
" during delete %(exc)s",
{ 'vol_id' : vol.get( 'volume_ id'),
'exc': encodeutils. exception_ to_unicode( exc)},
instance= instance)
except Exception as exc:
with excutils.
if cleanup_
# Don't block on Volume errors if we're trying to
# delete the instance as we may be partially created
# or deleted
In all other scenarios, Nova will not proceed further if the disconnect was not successful.
If Nova does proceed past _disconnect_ volume( ), it will later call Cinder API to delete the attachment [2]. I assume that is what does the unmap/unexport.
[1] https:/ /github. com/openstack/ nova/blob/ 1bf98f128710c37 4a0141720a7ccc2 1f5d1afae0/ nova/virt/ libvirt/ driver. py#L1445- L1459 (ussuri) /github. com/openstack/ nova/blob/ 1bf98f128710c37 4a0141720a7ccc2 1f5d1afae0/ nova/compute/ manager. py#L2922 (ussuri)
[2] https:/