From f7bd74d461fb71228121ddff410ca652f2354c91 Mon Sep 17 00:00:00 2001 From: anthony Date: Mon, 25 Jul 2011 17:47:03 -0700 Subject: [PATCH] bug 10854: get basecopy physical size before destroying VDI, basecopy might be coalesced after destroying VDI status 10854: resolved fixed --- .../cloud/hypervisor/xen/resource/CitrixResourceBase.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index aa0b4bdf8f9..3ea8a530ae3 100644 --- a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -2200,15 +2200,15 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe VDI snapshotvdi = tmpl.snapshot(conn, new HashMap()); 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: "