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 f6564b0b03362093efd1766a64e34184208eec3c)
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 d9bd235bf6
commit cecab95cc9

View File

@ -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 =