Skip to content

Commit 9044a02

Browse files
VM Snapshot Usage for DATA disk is reported as the size of the DATA disk instead of the actual snapshot size.
This closes #485
1 parent 92a9ee0 commit 9044a02

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3162,6 +3162,15 @@ public String getVMInstanceName() {
31623162
}
31633163

31643164
public long getVMSnapshotChainSize(final Connection conn, final VolumeObjectTO volumeTo, final String vmName) throws BadServerResponse, XenAPIException, XmlRpcException {
3165+
if (volumeTo.getVolumeType() == Volume.Type.DATADISK) {
3166+
VDI dataDisk = VDI.getByUuid(conn, volumeTo.getPath());
3167+
if (dataDisk != null) {
3168+
String dataDiskName = dataDisk.getNameLabel(conn);
3169+
if (dataDiskName != null && !dataDiskName.isEmpty()) {
3170+
volumeTo.setName(dataDiskName);
3171+
}
3172+
}
3173+
}
31653174
final Set<VDI> allvolumeVDIs = VDI.getByNameLabel(conn, volumeTo.getName());
31663175
long size = 0;
31673176
for (final VDI vdi : allvolumeVDIs) {

0 commit comments

Comments
 (0)