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 apache#485
  • Loading branch information
sanjaytripathi authored and kishankavala committed Jun 25, 2015
1 parent 277b11d commit b618fb2
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 b618fb2

Please sign in to comment.