Blame SOURCES/0055-v2v-Add-Disk-ovf-capacity-attribute-containing-disk-.patch

e9bfca
From 4c82b8c137b9337a80f0658c1712f2318e631bef Mon Sep 17 00:00:00 2001
e9bfca
From: "Richard W.M. Jones" <rjones@redhat.com>
e9bfca
Date: Mon, 18 Jun 2018 10:31:18 +0100
e9bfca
Subject: [PATCH] v2v: Add <Disk ovf:capacity> attribute containing disk
e9bfca
 virtual size (RHBZ#1592468).
e9bfca
e9bfca
Virt-v2v transfers to newer versions of ovirt-engine can fail with:
e9bfca
e9bfca
  ovirtsdk4.Error: Fault reason is "Operation Failed". Fault detail is "failed to parse a given ovf configuration ovf error: [empty name]: cannot read '//*/disksection' with value: null". HTTP response code is 400.
e9bfca
e9bfca
This was caused by a change made to oVirt:
e9bfca
e9bfca
  https://gerrit.ovirt.org/#/c/91902/
e9bfca
e9bfca
so that it now requires the <Disk ovf:capacity> attribute.
e9bfca
e9bfca
Thanks: Arik Hadas
e9bfca
(cherry picked from commit 7c2afc88fd6aceb869a5e1c47a8183879ddec5fc)
e9bfca
---
e9bfca
 v2v/create_ovf.ml | 1 +
e9bfca
 1 file changed, 1 insertion(+)
e9bfca
e9bfca
diff --git a/v2v/create_ovf.ml b/v2v/create_ovf.ml
e9bfca
index ac3c61b13..e0f81e0a2 100644
e9bfca
--- a/v2v/create_ovf.ml
e9bfca
+++ b/v2v/create_ovf.ml
e9bfca
@@ -835,6 +835,7 @@ and add_disks targets guestcaps output_alloc sd_uuid image_uuids vol_uuids
e9bfca
           | OVirt -> image_uuid
e9bfca
           | RHVExportStorageDomain -> vol_uuid);
e9bfca
           "ovf:size", Int64.to_string size_gb;
e9bfca
+          "ovf:capacity", Int64.to_string ov.ov_virtual_size;
e9bfca
           "ovf:fileRef", fileref;
e9bfca
           "ovf:parentRef", "";
e9bfca
           "ovf:vm_snapshot_id", uuidgen ();
e9bfca
-- 
8ff76f
2.20.1
e9bfca