Comment 4 for bug 1304695

Revision history for this message
Nikola Đipanov (ndipanov) wrote :

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.