Skip to content

Commit

Permalink
VM Snapshot Usage for DATA disk is reported as the size of the DATA d…
Browse files Browse the repository at this point in the history
…isk instead of the actual snapshot size.

This closes #485
  • Loading branch information
sanjaytripathi committed Jun 19, 2015
1 parent 92a9ee0 commit 9044a02
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3162,6 +3162,15 @@ public String getVMInstanceName() {
}

public long getVMSnapshotChainSize(final Connection conn, final VolumeObjectTO volumeTo, final String vmName) throws BadServerResponse, XenAPIException, XmlRpcException {
if (volumeTo.getVolumeType() == Volume.Type.DATADISK) {
VDI dataDisk = VDI.getByUuid(conn, volumeTo.getPath());
if (dataDisk != null) {
String dataDiskName = dataDisk.getNameLabel(conn);
if (dataDiskName != null && !dataDiskName.isEmpty()) {
volumeTo.setName(dataDiskName);
}
}
}
final Set<VDI> allvolumeVDIs = VDI.getByNameLabel(conn, volumeTo.getName());
long size = 0;
for (final VDI vdi : allvolumeVDIs) {
Expand Down

0 comments on commit 9044a02

Please sign in to comment.