OK, I went back to the original OVF file (just had to remove the Ethernet adapter Item so it ovirt would accept it).<br><br>I&#39;m now back to my original error, integrity violation on pk_vm_device...<br><br><div class="gmail_quote">
On Thu, Apr 5, 2012 at 12:12 PM, Shahar Havivi <span dir="ltr">&lt;<a href="mailto:shaharh@redhat.com">shaharh@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 05.04.12 13:56, Itamar Heim wrote:<br>
&gt; On 04/05/2012 01:50 PM, Alex Drahon wrote:<br>
&gt; &gt;I tried with the minimal OVF file, which means no UUID since it&#39;s<br>
&gt; &gt;defined (I think) in<br>
&gt; &gt;&lt;Section ovf:id=&quot;...&quot; ovf:required=&quot;false&quot;<br>
&gt; &gt;xsi:type=&quot;ovf:OperatingSystemSection_Type&quot;&gt;<br>
&gt;<br>
&gt; shahar - uuid is not a must?<br>
&gt; if not and engine is supposed to create it, sounds like a bug?<br>
</div>engine doesn&#39;t create that,<br>
it expect the UUID to be present.<br>
<div class="HOEnZb"><div class="h5">&gt;<br>
&gt; &gt;<br>
&gt; &gt;Of course it fails if ovirt-engine doesn&#39;t generate one.<br>
&gt; &gt;<br>
&gt; &gt;On Thu, Apr 5, 2012 at 11:44 AM, Itamar Heim &lt;<a href="mailto:iheim@redhat.com">iheim@redhat.com</a><br>
&gt; &gt;&lt;mailto:<a href="mailto:iheim@redhat.com">iheim@redhat.com</a>&gt;&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt;    On 04/05/2012 01:42 PM, Alex Drahon wrote:<br>
&gt; &gt;<br>
&gt; &gt;        Here&#39;s what I found in engine.log<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;    are you sure you are not trying to add a VM with an existing UUID<br>
&gt; &gt;    (or did not pass a UUID)?<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;        On Thu, Apr 5, 2012 at 11:32 AM, Itamar Heim &lt;<a href="mailto:iheim@redhat.com">iheim@redhat.com</a><br>
&gt; &gt;        &lt;mailto:<a href="mailto:iheim@redhat.com">iheim@redhat.com</a>&gt;<br>
&gt; &gt;        &lt;mailto:<a href="mailto:iheim@redhat.com">iheim@redhat.com</a> &lt;mailto:<a href="mailto:iheim@redhat.com">iheim@redhat.com</a>&gt;&gt;&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt;            On 04/05/2012 01:16 PM, Alex Drahon wrote:<br>
&gt; &gt;<br>
&gt; &gt;                Thanks for your help.<br>
&gt; &gt;<br>
&gt; &gt;                I tried the import with a minimal OVF file as described by<br>
&gt; &gt;                Shahar and it<br>
&gt; &gt;                worked, but failed on activate.<br>
&gt; &gt;<br>
&gt; &gt;                This time I have a constraint violation on pk_vm_static,<br>
&gt; &gt;        which means<br>
&gt; &gt;                that ovirt-engine doesn&#39;t create a vm_guid if it isn&#39;t<br>
&gt; &gt;        here. I guess<br>
&gt; &gt;                it&#39;s the same for a lot of parameters.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;            that&#39;s sounds like a new bug.<br>
&gt; &gt;            please send stack trace (which will also help telling where<br>
&gt; &gt;        to look).<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;                To move forward, I&#39;m going to create &quot;shadow&quot; VMs on<br>
&gt; &gt;        ovirt-engine,<br>
&gt; &gt;                export them and import my &quot;real&quot; libvirt/KVM VMs with the<br>
&gt; &gt;                exported OVF<br>
&gt; &gt;                files. Makes sense?<br>
&gt; &gt;<br>
&gt; &gt;                Where should I look in the source tree if I want to (try to)<br>
&gt; &gt;                actually<br>
&gt; &gt;                help with the restore code for imported VMs?<br>
&gt; &gt;<br>
&gt; &gt;                Alex<br>
&gt; &gt;<br>
&gt; &gt;                On Thu, Apr 5, 2012 at 5:59 AM, Shahar Havivi<br>
&gt; &gt;        &lt;<a href="mailto:shaharh@redhat.com">shaharh@redhat.com</a> &lt;mailto:<a href="mailto:shaharh@redhat.com">shaharh@redhat.com</a>&gt;<br>
&gt; &gt;        &lt;mailto:<a href="mailto:shaharh@redhat.com">shaharh@redhat.com</a> &lt;mailto:<a href="mailto:shaharh@redhat.com">shaharh@redhat.com</a>&gt;&gt;<br>
&gt; &gt;        &lt;mailto:<a href="mailto:shaharh@redhat.com">shaharh@redhat.com</a> &lt;mailto:<a href="mailto:shaharh@redhat.com">shaharh@redhat.com</a>&gt;<br>
&gt; &gt;        &lt;mailto:<a href="mailto:shaharh@redhat.com">shaharh@redhat.com</a> &lt;mailto:<a href="mailto:shaharh@redhat.com">shaharh@redhat.com</a>&gt;&gt;&gt;&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt;                    On 05.04.12 07:35, Itamar Heim wrote:<br>
&gt; &gt;         &gt; On 04/04/2012 01:13 PM, Alex Drahon wrote:<br>
&gt; &gt;         &gt; &gt;Hello all,<br>
&gt; &gt;         &gt; &gt;<br>
&gt; &gt;         &gt; &gt;I&#39;m trying to import VMs from a Centos5/KVM host to ovirt using<br>
&gt; &gt;         &gt; &gt;virt-v2v. I used this command:<br>
&gt; &gt;         &gt; &gt;virt-v2v -ic<br>
&gt; &gt;                qemu+ssh://root@virthost1.____mydomain.local/system -o<br>
&gt; &gt;                    rhev -os<br>
&gt; &gt;         &gt; &gt;virthost3.mydomain.local:/____exports/exp --network ovirtmgmt<br>
&gt; &gt;<br>
&gt; &gt;         &gt; &gt;test.mydomain.local<br>
&gt; &gt;         &gt; &gt;<br>
&gt; &gt;         &gt; &gt;It works, but the resulting OVF file cannot be read by<br>
&gt; &gt;                ovirt-engine<br>
&gt; &gt;         &gt; &gt;(&quot;Failed to read VM &#39;[Unknown name]&#39; OVF, it may be corrupted&quot;).<br>
&gt; &gt;         &gt; &gt;<br>
&gt; &gt;         &gt; &gt;I had to edit the OVF file, removing the NIC Item worked, but<br>
&gt; &gt;                    restoring<br>
&gt; &gt;         &gt; &gt;the imported VM fails. Looking at logs, I found a PostgreSQL<br>
&gt; &gt;                    constraint<br>
&gt; &gt;         &gt; &gt;violation on an insert (sorry it&#39;s in French)<br>
&gt; &gt;         &gt; &gt;&quot;Caused by: org.postgresql.util.____PSQLException: ERREUR: la<br>
&gt; &gt;<br>
&gt; &gt;                valeur<br>
&gt; &gt;                    d une<br>
&gt; &gt;         &gt; &gt;clé dupliquée rompt la contrainte unique « pk_vm_device »<br>
&gt; &gt;         &gt; &gt;   Where: instruction SQL « INSERT INTO vm_device( device_id,<br>
&gt; &gt;                    vm_id ,<br>
&gt; &gt;         &gt; &gt;device , type, address , boot_order , spec_params, is_managed,<br>
&gt; &gt;         &gt; &gt;is_plugged, is_readonly) VALUES(  $1  ,  $2  ,  $3  ,  $4  ,  $5<br>
&gt; &gt;                      ,  $6<br>
&gt; &gt;         &gt; &gt;,  $7 ,  $8 ,  $9 ,  $10 ) »&quot;<br>
&gt; &gt;         &gt; &gt;<br>
&gt; &gt;         &gt; &gt;Looks like there&#39;s a primary key violation (duplicate) on<br>
&gt; &gt;                insert.<br>
&gt; &gt;         &gt;<br>
&gt; &gt;         &gt; cc-ing mbooth from v2v to have a look from ovf generation,<br>
&gt; &gt;                but there<br>
&gt; &gt;         &gt; could be some bug in engine as well as the vm_device code was<br>
&gt; &gt;                added<br>
&gt; &gt;         &gt; recently.<br>
&gt; &gt;         &gt;<br>
&gt; &gt;         &gt; &gt;<br>
&gt; &gt;         &gt; &gt;I have two questions:<br>
&gt; &gt;         &gt; &gt;  - what&#39;s the minimal OVF file that can successfully import<br>
&gt; &gt;                a VM?<br>
&gt; &gt;                    you will need the header: the &lt;Reference&gt; tag the<br>
&gt; &gt;        &lt;Content&gt;<br>
&gt; &gt;                tag with the<br>
&gt; &gt;        &lt;Section&gt; items: &lt;System&gt; and &lt;item&gt;s cpu and memory, all other<br>
&gt; &gt;                    devices can be<br>
&gt; &gt;                    omit.<br>
&gt; &gt;         &gt;<br>
&gt; &gt;         &gt; shahar?<br>
&gt; &gt;         &gt;<br>
&gt; &gt;         &gt; &gt;  - are &#39;default devices&#39; created if they are not in the OVF<br>
&gt; &gt;                file?<br>
&gt; &gt;         &gt; &gt;(would explain PK violations)<br>
&gt; &gt;         &gt;<br>
&gt; &gt;         &gt; eli?<br>
&gt; &gt;         &gt;<br>
&gt; &gt;         &gt; &gt;<br>
&gt; &gt;         &gt; &gt;oVirt is very impressive and stable, deploying was a breeze, but<br>
&gt; &gt;                    it&quot;s<br>
&gt; &gt;         &gt; &gt;difficult to understand why it is so hard to move VMs from a<br>
&gt; &gt;                    libvirt/KVM<br>
&gt; &gt;         &gt; &gt;host (which is basically the same architecture). Am I missing<br>
&gt; &gt;                    something?<br>
&gt; &gt;         &gt;<br>
&gt; &gt;         &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt;<br>
</div></div></blockquote></div><br>