[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH] RHEV: OVF must have the same name as the OS UUID



ovf:Envelope/Content/Section[xsi:type='ovf:OperatingSystemSection_Type']/@ovf:id
is actually the canonical UUID of the guest, and must correspond to the
filename. If it doesn't, the VM cannot be deleted from the export domain.

Fixes RHBZ#583536
---
 lib/Sys/VirtV2V/Target/RHEV.pm |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/Sys/VirtV2V/Target/RHEV.pm b/lib/Sys/VirtV2V/Target/RHEV.pm
index 867923b..9dd9013 100644
--- a/lib/Sys/VirtV2V/Target/RHEV.pm
+++ b/lib/Sys/VirtV2V/Target/RHEV.pm
@@ -562,7 +562,7 @@ sub create_guest
     # Generate a creation date
     my $vmcreation = _format_time(gmtime());
 
-    my $osuuid = Sys::VirtV2V::Target::RHEV::UUIDHelper::get_uuid();
+    my $vmuuid = Sys::VirtV2V::Target::RHEV::UUIDHelper::get_uuid();
 
     my $ovf = new XML::DOM::Parser->parse(<<EOF);
 <ovf:Envelope
@@ -597,7 +597,7 @@ sub create_guest
         <VmType>1</VmType>
         <DefaultDisplayType>0</DefaultDisplayType>
 
-        <Section ovf:id="$osuuid" ovf:required="false" xsi:type="ovf:OperatingSystemSection_Type">
+        <Section ovf:id="$vmuuid" ovf:required="false" xsi:type="ovf:OperatingSystemSection_Type">
           <Info>Guest Operating System</Info>
           <Description>Unassigned</Description>
         </Section>
@@ -644,8 +644,6 @@ EOF
         my $mountdir = $self->{mountdir};
         my $domainuuid = $self->{domainuuid};
 
-        my $vmuuid = Sys::VirtV2V::Target::RHEV::UUIDHelper::get_uuid();
-
         my $dir = $mountdir.'/'.$domainuuid.'/master/vms/'.$vmuuid;
         mkdir($dir)
             or die(user_message(__x("Failed to create directory {dir}: {error}",
-- 
1.7.0.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]