mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone
Blob Blame History Raw
From 4c82b8c137b9337a80f0658c1712f2318e631bef Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 18 Jun 2018 10:31:18 +0100
Subject: [PATCH] v2v: Add <Disk ovf:capacity> attribute containing disk
 virtual size (RHBZ#1592468).

Virt-v2v transfers to newer versions of ovirt-engine can fail with:

  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.

This was caused by a change made to oVirt:

  https://gerrit.ovirt.org/#/c/91902/

so that it now requires the <Disk ovf:capacity> attribute.

Thanks: Arik Hadas
(cherry picked from commit 7c2afc88fd6aceb869a5e1c47a8183879ddec5fc)
---
 v2v/create_ovf.ml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/v2v/create_ovf.ml b/v2v/create_ovf.ml
index ac3c61b13..e0f81e0a2 100644
--- a/v2v/create_ovf.ml
+++ b/v2v/create_ovf.ml
@@ -835,6 +835,7 @@ and add_disks targets guestcaps output_alloc sd_uuid image_uuids vol_uuids
           | OVirt -> image_uuid
           | RHVExportStorageDomain -> vol_uuid);
           "ovf:size", Int64.to_string size_gb;
+          "ovf:capacity", Int64.to_string ov.ov_virtual_size;
           "ovf:fileRef", fileref;
           "ovf:parentRef", "";
           "ovf:vm_snapshot_id", uuidgen ();
-- 
2.17.2