Skip to content

Commit 668541d

Browse files
committed
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 f6564b0) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent ea3fb82 commit 668541d

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ public Long getVolumeId() {
100100
return volumeId;
101101
}
102102

103+
public String getVolumeUuid() {
104+
Volume volume = (Volume)this._entityMgr.findById(Volume.class, getVolumeId());
105+
if (volume == null) {
106+
throw new InvalidParameterValueException("Unable to find volume's UUID");
107+
}
108+
return volume.getUuid();
109+
}
110+
103111
public Long getPolicyId() {
104112
if (policyId != null) {
105113
return policyId;
@@ -159,7 +167,7 @@ public String getEventType() {
159167

160168
@Override
161169
public String getEventDescription() {
162-
return "creating snapshot for volume: " + getVolumeId();
170+
return "creating snapshot for volume: " + getVolumeUuid();
163171
}
164172

165173
@Override
@@ -181,7 +189,7 @@ public void create() throws ResourceAllocationException {
181189
@Override
182190
public void execute() {
183191
s_logger.info("VOLSS: createSnapshotCmd starts:" + System.currentTimeMillis());
184-
CallContext.current().setEventDetails("Volume Id: " + getVolumeId());
192+
CallContext.current().setEventDetails("Volume Id: " + getVolumeUuid());
185193
Snapshot snapshot;
186194
try {
187195
snapshot =

0 commit comments

Comments
 (0)