You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2018/03/23 16:04:15 UTC

[GitHub] rhtyd closed pull request #2488: smaller systemvm images using sparse disks.

rhtyd closed pull request #2488: smaller systemvm images using sparse disks.
URL: https://github.com/apache/cloudstack/pull/2488
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh
index 8b1032ecc8b..c8cd465c05a 100755
--- a/tools/appliance/build.sh
+++ b/tools/appliance/build.sh
@@ -271,9 +271,9 @@ function xen_server_export() {
   local result=$?
   set -e
   if [ ${result} == 0 ]; then
-    qemu-img convert -f qcow2 -O raw "dist/${appliance}" img.raw
-    vhd-util convert -s 0 -t 1 -i img.raw -o stagefixed.vhd
-    faketime '2010-01-01' vhd-util convert -s 1 -t 2 -i stagefixed.vhd -o "${appliance_build_name}-xen.vhd"
+    cp "dist/${appliance}" "dist/${appliance}-xen"
+    vhd-util convert -s 0 -t 1 -i "dist/${appliance}-xen" -o stagefixed.vhd
+    faketime '2010-01-01' qemu-img convert -S 512 -O vpc -o subformat=dynamic stagefixed.vhd "${appliance_build_name}-xen.vhd"
     rm -f *.bak
     bzip2 "${appliance_build_name}-xen.vhd"
     mv "${appliance_build_name}-xen.vhd.bz2" dist/
@@ -286,7 +286,7 @@ function xen_server_export() {
 
 function ovm_export() {
   log INFO "creating OVM export"
-  qemu-img convert -f qcow2 -O raw "dist/${appliance}" "dist/${appliance_build_name}-ovm.raw"
+  cp "dist/${appliance}" "dist/${appliance_build_name}-ovm.raw"
   cd dist && bzip2 "${appliance_build_name}-ovm.raw" && cd ..
   log INFO "${appliance} exported for OracleVM: dist/${appliance_build_name}-ovm.raw.bz2"
 }
@@ -294,7 +294,7 @@ function ovm_export() {
 function kvm_export() {
   log INFO "creating kvm export"
   set +e
-  qemu-img convert -o compat=0.10 -f qcow2 -c -O qcow2 "dist/${appliance}" "dist/${appliance_build_name}-kvm.qcow2"
+  qemu-img convert -o compat=0.10 -f raw -c -O qcow2 -S 512k "dist/${appliance}" "dist/${appliance_build_name}-kvm.qcow2"
   local qemuresult=$?
   cd dist && bzip2 "${appliance_build_name}-kvm.qcow2" && cd ..
   log INFO "${appliance} exported for KVM: dist/${appliance_build_name}-kvm.qcow2.bz2"
@@ -302,7 +302,7 @@ function kvm_export() {
 
 function vmware_export() {
   log INFO "creating vmware export"
-  qemu-img convert -f qcow2 -O vmdk "dist/${appliance}" "dist/${appliance_build_name}-vmware.vmdk"
+  qemu-img convert -f raw -O vmdk -S 512k "dist/${appliance}" "dist/${appliance_build_name}-vmware.vmdk"
 
   if ! ovftool_loc="$(type -p "ovftool")" || [ -z "$ovftool_loc" ]; then
     log INFO "ovftool not found, skipping ova generation for VMware"
@@ -322,7 +322,7 @@ function vmware_export() {
 
 function hyperv_export() {
   log INFO "creating hyperv export"
-  qemu-img convert -f qcow2 -O vpc "dist/${appliance}" "dist/${appliance_build_name}-hyperv.vhd"
+  qemu-img convert -S 512k -f raw -O vpc "dist/${appliance}" "dist/${appliance_build_name}-hyperv.vhd"
   CDIR=$PWD
   cd dist
   zip "${appliance_build_name}-hyperv.vhd.zip" "${appliance_build_name}-hyperv.vhd"
diff --git a/tools/appliance/systemvmtemplate/template.json b/tools/appliance/systemvmtemplate/template.json
index da924289b1e..cd26a43875f 100644
--- a/tools/appliance/systemvmtemplate/template.json
+++ b/tools/appliance/systemvmtemplate/template.json
@@ -33,7 +33,7 @@
         [ "-smp", "cpus=1,maxcpus=1,cores=1" ]
       ],
       "disk_size": 2400,
-      "format": "qcow2",
+      "format": "raw",
 
       "disk_interface": "virtio",
       "net_device": "virtio-net",


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services