Looking at it closer, I'd say that we just need to refresh the connection info once we are done with the snapshot.
We should be careful to avoid any race conditions tho, but basically what we need to do in both volume_snapshot_create and _delete methods of the libvirt driver is:
from nova.virt import block_device as driver_block_device
bdm = block_device_obj.BlockDeviceMapping.get_by_volume_id( context, volume_id)
driver_bdm = driver_block_device.DriverVolumeBlockDevice(bdm)
driver_bdm.refresh_connection_info(context, instance, self._volume_api, self)
and you should be good to go.
The only caveat here is that refresh_connection_info will call out to Cinder's initialize_connection which may be problematic since the snapshot is in "creating" state. But nothing that a dumb polling loop won't solve (sigh). In reality we should probably rething these interactions.
Looking at it closer, I'd say that we just need to refresh the connection info once we are done with the snapshot.
We should be careful to avoid any race conditions tho, but basically what we need to do in both volume_ snapshot_ create and _delete methods of the libvirt driver is:
from nova.virt import block_device as driver_block_device obj.BlockDevice Mapping. get_by_ volume_ id(
context, volume_id) block_device. DriverVolumeBlo ckDevice( bdm) bdm.refresh_ connection_ info(context, instance, self._volume_api, self)
bdm = block_device_
driver_bdm = driver_
driver_
and you should be good to go.
The only caveat here is that refresh_ connection_ info will call out to Cinder's initialize_ connection which may be problematic since the snapshot is in "creating" state. But nothing that a dumb polling loop won't solve (sigh). In reality we should probably rething these interactions.