Browse code

Make disk size configurable in vmdk

Change-Id: I66ce5563096300ec4a5bad5760ae56c18017a8db
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/5245
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Sharath George

suezzelur authored on 2018/06/12 07:16:16
Showing 1 changed files
... ...
@@ -24,7 +24,8 @@ def create_ova_image(raw_image_name, tools_path, build_scripts_path, config):
24 24
     ovf_path = output_path + '/photon-ova.ovf'
25 25
     mf_path = output_path + '/photon-ova.mf'
26 26
     ovfinfo_path = build_scripts_path + '/ovfinfo.txt'
27
-    utils.runshellcommand("{} -convert {} -cap 16000 {}".format(vixdiskutil_path, raw_image_name, vmdk_path))
27
+    vmdk_capacity = (int(config['size']['root']) + int(config['size']['swap'])) * 1024
28
+    utils.runshellcommand("{} -convert {} -cap {} {}".format(vixdiskutil_path, raw_image_name, vmdk_capacity, vmdk_path))
28 29
     utils.runshellcommand("{} -wmeta toolsVersion 2147483647 {}".format(vixdiskutil_path, vmdk_path))
29 30
 
30 31
     utils.runshellcommand("ovftool {} {}".format(vmx_path, ovf_path))