Ugh.. this is bad.

On the hypervisor where the files are located ...

My customers send me tar files with VMs all the time.   And I send them.    This will make it much more difficult, if I can't import xml / qcow2 

####

This cluster .. is my home cluster and so..  three servers.. and they were CentOs 7 + VDO + Gluster...  I use to have link qemu directory from all three on gluster so if one server died .. or I messed it up and it was needing repair... I could still start up and run the VMs.

Old cluster notes: 

 Optional: Redirect Default KVM VM Storage location.  Ex:  /data/gv0/vms   on thor

# <<<<< Broken with HCI.. not sure process here yet….. hold off till oVirt HCI engine issues worked out on how it enables new VM definitions to be shared if one or more nodes goes down  2020-09-17 >>>>

#  Pool default XML configuration edited.

virsh pool-edit default

<pool type='dir'>

  <name>default</name>

  <uuid>d3ae9e9a-8bc8-4a17-8476-3fe3334204f3</uuid>

  <capacity unit='bytes'>37734498304</capacity>

  <allocation unit='bytes'>27749486592</allocation>

  <available unit='bytes'>9985011712</available>

  <source>

  </source>

  <target>

#   <path>/var/lib/libvirt/images</path>

    <path>/data/gv0/vms</path>

    <permissions>

      <mode>0711</mode>

      <owner>0</owner>

      <group>0</group>

    </permissions>

  </target>

</pool>

 

#  For now each KVM host has shared folder linked.  Not sure how with out restart of libvirtd to get peers to easily see configuration file. Can run import command but need to test.

# To enable multiple KVM nodes in a shared environment to be able to take over the roles of peers in the event of one failing the XML files stored in /etc/libvirt/qemu/  need to be on a shared device.

# Ex:  Move medusa /etc/libvirt/qemu/   to be on gluster share volume space /data/gv0/vms/medusa

systemctl stop libvirtd

mkdir -p /media/vmstore/qemu

mv -f /etc/libvirt/qemu/* /media/vmstore/qemu

ln -s /media/vmstore/qemu /etc/libvirt/qemu

 

systemctl daemon-reload

systemctl start libvirt-guests.service

systemctl enable libvirt-guests.service

systemctl status libvirt-guests.service




As I tried to use setup of engine it became apparent, my manual use of libvirtd setup was NOT going to be any way helpful with oVirt way of using it...  Ok... I can learn new things.. 


I had to backup and remove all data (see other post about errors for HCI wizard failing if it detected existing VDO volume)...  So I moved my four or so important VMs off to an external mount.

I now need a way to bring them back.  I really can't spend weeks rebuilding those infrastructure VMs.  And I don't have a fourth server to rebuild hosting KVM system to import and then with oVirt to LibVirt connection.. slurp vm out.
Plus.. that means anytime someone sends me a tar of qcow2 and xml..  I have to re-host to export..  :P



On Mon, Sep 21, 2020 at 8:18 AM Nir Soffer <nsoffer@redhat.com> wrote:
On Mon, Sep 21, 2020 at 9:11 AM Jeremey Wise <jeremey.wise@gmail.com> wrote:
>
>
> I rebuilt my lab environment.   And their are four or five VMs that really would help if I did not have to rebuild.
>
> oVirt as I am now finding when it creates infrastructure, sets it out such that I cannot just use older  means of placing .qcow2 files in folders and .xml files in other folders.... and they show up on services restarting.
>
> How do I import VMs from files?

You did not share the oVirt version, so I'm assuming 4.4.

The simplest way is to upload the qcow2 images to oVirt, and create a new
VM with the new disk.

On the hypervisor where the files are located, install the required packages:

    dnf install ovirt-imageio-client python3-ovirt-engine-sdk4

And upload the image:

    python3 /usr/share/doc/python3-ovirt-engine-sdk4/examples/upload_disk.py \
        --engine-url https://my.engine/ \
        --username admin@internal \
        --password-file /path/to/password/file \
        --cafile /path/to/cafile \
        --sd-name my-storage-domain \
        --disk-sparse \
        /path/to/image.qcow2

This will upload the file in qcow2 format to whatever type of storage you
have. You can change the format if you like using --disk-format. See --help
for all the options.

We also support importing from libvirt, but for this you need to have the vm
defined in libvirt. If you don't have this, It will probably be easier to upload
the images and create a new vm in oVirt.

Nir

> I found this article but implies VM is running: https://www.ovirt.org/develop/release-management/features/virt/KvmToOvirt.html
> https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.1/html/administration_guide/sect-adding_external_providers#Adding_KVM_as_an_External_Provider
>
> I need a way to import a file.  Even if it means temporarily hosting on "KVM on one of the hosts to then bring in once it is up.
>
>
> Thanks
> --
>
> penguinpages
> _______________________________________________
> Users mailing list -- users@ovirt.org
> To unsubscribe send an email to users-leave@ovirt.org
> Privacy Statement: https://www.ovirt.org/privacy-policy.html
> oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/
> List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/6LSE4MNEBGODIRPVAQCUNBO2KGCCQTM5/



--
jeremey.wise@gmail.com