mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-8167: publish volume uuid on event bus in create snapshot cmd
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit f6564b0b03)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Conflicts:
api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
This commit is contained in:
parent
d9bd235bf6
commit
cecab95cc9
|
|
@ -107,6 +107,14 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
|
|||
return snapshotName;
|
||||
}
|
||||
|
||||
public String getVolumeUuid() {
|
||||
Volume volume = (Volume)this._entityMgr.findById(Volume.class, getVolumeId());
|
||||
if (volume == null) {
|
||||
throw new InvalidParameterValueException("Unable to find volume's UUID");
|
||||
}
|
||||
return volume.getUuid();
|
||||
}
|
||||
|
||||
public Long getPolicyId() {
|
||||
if (policyId != null) {
|
||||
return policyId;
|
||||
|
|
@ -166,7 +174,7 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
|
|||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "creating snapshot for volume: " + getVolumeId();
|
||||
return "creating snapshot for volume: " + getVolumeUuid();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -188,7 +196,7 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
|
|||
@Override
|
||||
public void execute() {
|
||||
s_logger.info("VOLSS: createSnapshotCmd starts:" + System.currentTimeMillis());
|
||||
CallContext.current().setEventDetails("Volume Id: " + getVolumeId());
|
||||
CallContext.current().setEventDetails("Volume Id: " + getVolumeUuid());
|
||||
Snapshot snapshot;
|
||||
try {
|
||||
snapshot =
|
||||
|
|
|
|||
Loading…
Reference in New Issue