When we are cloning a volume, we now set the source volume's status
to 'in use'. This prevents a user from deleting the source volume while the
backend copies/clones the contents to the new volume.
When the cloning is complete, we reset the status to it's original
state.
Change-Id: Ie43345aba77df4671ed2b429645cf8d1af9b975b
snapshot_ref)
elif source_volid is not None:
src_vref = self.db.volume_get(context, source_volid)
+ self.db.volume_update(context, src_vref['id'],
+ {'status': 'in use'})
model_update = self.driver.create_cloned_volume(volume_ref,
src_vref)
+ self.db.volume_update(context, src_vref['id'],
+ {'status': src_vref['status']})
else:
# create the volume from an image
image_service, image_id = \