snapshot.get('display_name'),
snapshot.get('description'),
**kwargs)
else:
new_snapshot = self.volume_api.create_snapshot(context,
volume,
snapshot.get('display_name'),
snapshot.get('description'),
**kwargs)
req.cache_db_snapshot(new_snapshot)
return self._view_builder.detail(req, new_snapshot)
在cinder/volume/api.py的API类中,有这两个方法:
def create_snapshot(self, context, volume, name, description, metadata=None, cgsnapshot_id=None, group_snapshot_id=None):
result = self._create_snapshot(context, volume, name, description, False, metadata, cgsnapshot_id, group_snapshot_id)
LOG.info("Snapshot create request issued successfully.", resource=result)
return result
def create_snapshot_force(self, context, volume, name, description, metadata=None):
result = self._create_snapshot(context, volume, name, description, True, metadata)
LOG.info("Snapshot force create request issued
successfully.", resource=result)
return result