bug 10854: get basecopy physical size before destroying VDI, basecopy might be coalesced after destroying VDI

status 10854: resolved fixed
This commit is contained in:
anthony 2011-07-25 17:47:03 -07:00
parent 66d6125836
commit d03a396569

View File

@ -2153,15 +2153,15 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
VDI snapshotvdi = tmpl.snapshot(conn, new HashMap<String, String>());
String snapshotUuid = snapshotvdi.getUuid(conn);
snapshotvdi.setNameLabel(conn, "Template " + cmd.getName());
String parentuuid = getVhdParent(conn, pUuid, snapshotUuid, isISCSI);
VDI parent = getVDIbyUuid(conn, parentuuid);
Long phySize = parent.getPhysicalUtilisation(conn);
tmpl.destroy(conn);
poolsr.scan(conn);
try{
Thread.sleep(5000);
} catch (Exception e) {
}
String parentuuid = getVhdParent(conn, pUuid, snapshotUuid, isISCSI);
VDI parent = getVDIbyUuid(conn, parentuuid);
Long phySize = parent.getPhysicalUtilisation(conn);
return new PrimaryStorageDownloadAnswer(snapshotvdi.getUuid(conn), phySize);
} catch (Exception e) {
String msg = "Catch Exception " + e.getClass().getName() + " on host:" + _host.uuid + " for template: "