RHEV import to different datacenter

Latest response

I exported a RHEL5 guest from a RHEV 3.0 datacenter, detached the export domain, attached the export domain to a second datacenter, activated, etc.

 

At that point, I would like to import the VM to the second datacenter, but I get an error about needing to delete the VM from the 1st datacenter.

 

Is there a workaround for cloning this VM into the second datacenter?

Responses

Hello,

I had the same issue, but did not get it solved. It is not possible to do under the same RHEVM,

because the UUID follows the VM. - You can do it, if datacenter 2 is managed by another RHEVM,

or you can delete the VM in datacenter 1 after you exported it to the new domain before you import to

datacenter 2 - (but that is a bit risky i think)

br,

Peter Calum

Thanks for the feedback.

 

DOMAIN=1ba7c796-e576-4a0e-829a-248a0980d288

 

I may try changing the above line in the export domain's .meta file with some uuidgen  output.   The export domain is already detached, so there shouldn't be much data in the postgres database anyway regarding this export.

 

feedback please...

Haven't tried doing this (and I'm pretty sure there's more than a single location to be hacked), but even if it works, what you will receive is a kind of a splitbrain - the imported VM will have the same MAC/IP/etc as the existing one. You will need to either hack the exported VM defs and change all the unique attributes, or let RHEV deal with this, and clone the VM before you export it, delete the clone, and then import it.

Okay, I got this to work, but it was a very tedious task.   All export information is contained on the export domain filesystem in RHEV 3.0.   I expect this will change for version 3.1.

 

At risk of getting lots of negative feedback from those who know better, here are my notes.

 

Only 2 postgresdb tables seem to come into play here: images table, column image_guid (the new image uuid must be unique to every other uuid in this table), and vm_interface table, column mac_addr (should be unique also).

 

The steps I followed were all relative to the export domain filesystem.

 

1) Create uuids for the image directory and files,

    run uuidgen twice to get {uuid1} and {uuid2}

2) cd expDomain/{domainID}/images/

    mv {originalUUID} to {uuid1}  (directory move)

3) cd expDomain/{domainID}/images/{uuid1}

    mv {originalUUID2}  to {uuid2}                   (image file)

    mv {originalUUID2}.meta  to {uuid2}.meta  (image metadata)

    vi {uuid2}.meta

    change  DOMAIN={value of domainID}  IMAGE={uuid1}

4) Create a uuid for the ovf,

    run uuidgen to get {uuid3}

5) cd expDomain/{domainID}/master/vms

     mkdir {uuid3}; chown 36:36 {uuid3}

6) cd expDomain/{domainID}/master/vms/{uuid3}

     touch {uuid3}.ovf ; chown 36:36 {uuid3}.ovf

     vi {uuid3}.ovf      (copy a ovf from a similar export image and modify)

 

It did take me one day to get the first one to import, but the second one went in less than an hour.   I still have 2-3 more VMs to bring to the Disaster Recovery datacenter.   I should be done before RHEV 3.1 gets released.

I'm running into this exact same problem but with trying to import from an export domain that has been detached from one data center on one RHEVM and attached to another data center on an entirely different RHEVM.  Has anyone had any success with this??

If you check the last comment on this thread you will get an unsupported way to achieve this. For a supported method, you have to explore any of the below options.

 

1 - Delete the source vm from the source DC (if possible) and then import it to new dc.

 

2- If #1 cannot be done. Create a template of the original vm in the original DC. Then create a new vm from that template. Export the new vm, remove it from source dc and import to destination dc.

You can explore the below option as well.

 

Create a template of the original vm in the original DC. Then create a new vm from that template using clone method. Export the new vm, remove it in source dc and import to destination dc.

make a template to the  vm you are exporting and then export the vm

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.