Always allow to create snapshot db record with snapshot-manage

Now, Cinder will raise 400 error when users manage a snapshot if
the volume is in-use. We should allow this action in this situation.
So set the "force=True" here when create the snapshot db record.

Change-Id: Ic85ca0ec35a1711ecad6f08432b301ec1f82d6f2
Closes-bug: #1534350
This commit is contained in:
wangxiyuan 2016-11-30 17:31:18 +08:00
parent c633a5bfd2
commit 25ae4bcc91

View File

@ -1616,7 +1616,7 @@ class API(base.Base):
metadata=None):
service = self._get_service_by_host(context, volume.host, 'snapshot')
snapshot_object = self.create_snapshot_in_db(context, volume, name,
description, False,
description, True,
metadata, None,
commit_quota=False)
self.volume_rpcapi.manage_existing_snapshot(context, snapshot_object,