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