Change-Id: I11bc7f685660d85ac4a0b72b1db4ad8b2c7a06c4
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/3513
Reviewed-by: Anish Swaminathan <anishs@vmware.com>
Tested-by: Anish Swaminathan <anishs@vmware.com>
| ... | ... |
@@ -222,8 +222,7 @@ if __name__ == '__main__': |
| 222 | 222 |
print "Converting raw disk to vhd ..." |
| 223 | 223 |
info_output=utils.runshellcommand("docker run -v {}:/mnt:rw anishs/qemu-img info -f raw --output json {}".format(options.src_root, '/mnt/' + relrawpath))
|
| 224 | 224 |
mbsize = 1024 * 1024 |
| 225 |
- #qemu-img adds an extra 512 bytes to the raw image |
|
| 226 |
- mbroundedsize = ((int(json.loads(info_output)["virtual-size"])/mbsize + 1) * mbsize) - 512 |
|
| 225 |
+ mbroundedsize = ((int(json.loads(info_output)["virtual-size"])/mbsize + 1) * mbsize) |
|
| 227 | 226 |
utils.runshellcommand("docker run -v {}:/mnt:rw anishs/qemu-img resize -f raw {} {}".format(options.src_root, '/mnt/' + relrawpath, mbroundedsize))
|
| 228 | 227 |
utils.runshellcommand("docker run -v {}:/mnt:rw anishs/qemu-img convert {} -O vpc -o subformat=fixed,force_size {}".format(options.src_root, '/mnt/' + relrawpath, '/mnt/' + vhdname))
|
| 229 | 228 |
elif config['artifacttype'] == 'ova': |