incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [32/50] [abbrv] git commit: refs/heads/ui-multiple-nics - CLOUDSTACK-1340: Fix raw disk export using vbox internalcommand
Date Thu, 28 Feb 2013 20:47:53 GMT
CLOUDSTACK-1340: Fix raw disk export using vbox internalcommand

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/673700a1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/673700a1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/673700a1

Branch: refs/heads/ui-multiple-nics
Commit: 673700a1a2f0a8b04f5b4bf75564bf479b1fb0bf
Parents: 1d31c3e
Author: Rohit Yadav <bhaisaab@apache.org>
Authored: Thu Feb 28 15:58:04 2013 +0530
Committer: Rohit Yadav <bhaisaab@apache.org>
Committed: Thu Feb 28 15:58:50 2013 +0530

----------------------------------------------------------------------
 tools/appliance/build.sh |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/673700a1/tools/appliance/build.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh
index 4d9d8bd..b757ded 100644
--- a/tools/appliance/build.sh
+++ b/tools/appliance/build.sh
@@ -41,6 +41,7 @@ done
 # Get appliance uuids
 machine_uuid=`vboxmanage showvminfo $appliance | grep UUID | head -1 | awk '{print $2}'`
 hdd_uuid=`vboxmanage showvminfo $appliance | grep vdi | head -1 | awk '{print $8}' | cut
-d ')' -f 1`
+hdd_path=`vboxmanage list hdds | grep $appliance | grep vdi | cut -c 14-`
 
 # Compact the virtual hdd
 vboxmanage modifyhd $hdd_uuid --compact
@@ -49,6 +50,19 @@ vboxmanage modifyhd $hdd_uuid --compact
 rm -fr dist
 mkdir dist
 
+# Export for Xen
+vboxmange internalcommands converttoraw $hdd_path dist/raw.img
+vhd-util convert -s 0 -t 1 -i dist/raw.img  -o dist/$appliance-$build_date-$branch-xen.vhd
+bzip2 dist/$appliance-$build_date-$branch-xen.vhd
+echo "$appliance exported for Xen: dist/$appliance-$build_date-$branch-xen.vhd.bz2"
+
+# Export for KVM
+vboxmange internalcommands converttoraw $hdd_path dist/raw.img
+qemu-img convert -f raw -O qcow2 dist/raw.img dist/$appliance-$build_date-$branch-kvm.qcow2
+rm dist/raw.img
+bzip2 dist/$appliance-$build_date-$branch-kvm.qcow2
+echo "$appliance exported for KVM: dist/$appliance-$build_date-$branch-kvm.qcow2.bz2"
+
 # Export for VMWare vSphere
 vboxmanage export $machine_uuid --output dist/$appliance-$build_date-$branch-vmware.ova
 echo "$appliance exported for VMWare: dist/$appliance-$build_date-$branch-vmware.ova"
@@ -58,15 +72,3 @@ vboxmanage clonehd $hdd_uuid dist/$appliance-$build_date-$branch-hyperv.vhd
--fo
 bzip2 dist/$appliance-$build_date-$branch-hyperv.vhd
 echo "$appliance exported for HyperV: dist/$appliance-$build_date-$branch-hyperv.vhd.bz2"
 
-# Export for KVM
-vboxmanage clonehd $hdd_uuid dist/raw.img --format RAW
-qemu-img convert -f raw -O qcow2 dist/raw.img dist/$appliance-$build_date-$branch-kvm.qcow2
-bzip2 dist/$appliance-$build_date-$branch-kvm.qcow2
-echo "$appliance exported for KVM: dist/$appliance-$build_date-$branch-kvm.qcow2.bz2"
-
-# Export for Xen
-# This will be an overwrite convert so, do it at the end
-vhd-util convert -s 0 -t 1 -i dist/raw.img  -o dist/$appliance-$build_date-$branch-xen.vhd
-bzip2 dist/$appliance-$build_date-$branch-xen.vhd
-echo "$appliance exported for Xen: dist/$appliance-$build_date-$branch-xen.vhd.bz2"
-


Mime
View raw message