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:
Rohit Yadav 2015-01-18 17:40:37 +05:30
parent dc97372d6f
commit 2c7cacd9df
1 changed files with 10 additions and 2 deletions

View File

@ -94,6 +94,14 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
return volumeId;
}
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;
@ -153,7 +161,7 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
@Override
public String getEventDescription() {
return "creating snapshot for volume: " + getVolumeId();
return "creating snapshot for volume: " + getVolumeUuid();
}
@Override
@ -175,7 +183,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 = _volumeService.takeSnapshot(this.getVolumeId(), this.getPolicyId(), this.getEntityId(), _accountService.getAccount(getEntityOwnerId()), getQuiescevm());