Appreciate all  for sharing the valuable information. 

1.  I am downloading centos 8  as the Python Ovirt SDK  installation says  it works on  Centos 8 and Need to setup a VM with this OS and install   ovirt Python SDK on this           VM.   The requirement is that   this Centos 8 VM should able to communicate with the   Rhevm 4.1  Host node  where the ovirt shell ( Rhevm Shell [connected] #    is               available    right ? 

2.  pinging to the  host with "Rhevm Shell [connected]# "       and  that  should  be ssh ed  from the CentOS 8 VM where python3 and oVirt SDK installed and going to execute the  script  (with ovirt configuration file on this VM.).  Is these two connectivity checks are enough for executing the script ?  or any other protocols need to be enabled in the firewall between these two machine?
    


3.  while googling  I saw a post    https://users.ovirt.narkive.com/CeEW3lcj/ovirt-users-clone-and-export-vm-by-ovirt-shell


action vm myvm export --storage_domain-name myexport   

Will this command export ?  and which format it will export to  the export domain ?
 Is there any  option to provide with this command to  specify  any supported format the vm image  to be exported  ?

 This    need to be executed from "Rhevm Shell [connected]# "   TTY  right ?   



On Wed, Aug 4, 2021 at 1:00 PM Vojtech Juranek <vjuranek@redhat.com> wrote:
On Wednesday, 4 August 2021 03:54:36 CEST KK CHN wrote:
> On Wed, Aug 4, 2021 at 1:38 AM Nir Soffer <nsoffer@redhat.com> wrote:
> > On Tue, Aug 3, 2021 at 7:29 PM KK CHN <kkchn.in@gmail.com> wrote:
> > > I have asked our VM maintainer to run the  command
> > >
> > > # virsh -r dumpxml vm-name_blah    //as Super user
> > >
> > > But no output :   No matching domains found that was the TTY  output on
> >
> > that rhevm node when I executed the command.
> >
> > > Then I tried to execute #  virsh list     //  it doesn't list any VMs
> >
> > !!!   ( How come this ? Does the Rhevm node need to enable any CLI  with
> > License key or something to list Vms or  to dumpxml   with   virsh ? or
> > its
> > CLI commands ?
> >
> > RHV undefine the vms when they are not running.
> >
> > > Any way I want to know what I have to ask the   maintainer    to provide
> >
> > a working a working  CLI   or ? which do the tasks expected to do with
> > command line utilities in rhevm.
> >
> > If the vm is not running you can get the vm configuration from ovirt
> >
> > using the API:
> >     GET /api/vms/{vm-id}
> >
> > You may need more API calls to get info about the disks, follow the
> > <links>
> > in the returned xml.
> >
> > > I have one more question :    Which command can I execute on an rhevm
> >
> > node  to manually export ( not through GUI portal) a   VMs to   required
> > format  ?
> >
> > > For example;   1.  I need to get  one  VM and disks attached to it  as
> >
> > raw images.  Is this possible how?
> >
> > > and another    2. VM and disk attached to it as  Ova or( what other good
> >
> > format) which suitable to upload to glance ?
> >
> > Arik can add more info on exporting.
> >
> > >   Each VMs are around 200 to 300 GB with disk volumes ( so where should
> >
> > be the images exported to which path to specify ? to the host node(if the
> > host doesn't have space  or NFS mount ? how to specify the target location
> > where the VM image get stored in case of NFS mount ( available ?)
> >
> > You have 2 options:
> > - Download the disks using the SDK
> > - Export the VM to OVA
> >
> > When exporting to OVA, you will always get qcow2 images, which you can
> > later
> > convert to raw using "qemu-img convert"
> >
> > When downloading the disks, you control the image format, for example
> > this will download
> >
> > the disk in any format, collapsing all snapshots to the raw format:
> >  $ python3
> >
> > /usr/share/doc/python3-ovirt-engine-sdk4/examples/download_disk.py
> > -c engine-dev 3649d84b-6f35-4314-900a-5e8024e3905c /var/tmp/disk1.raw
> >
> > To perform this which modules/packages need to be installed in the rhevm
>
> host node ?  Does the rhevm hosts come with python3 installed by default ?
> or I need to install  python3 on rhevm node ?

You don't have to install anything on oVirt hosts. SDK has to be installed on
the machine from which you run the script. See

https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/README.adoc

for more details, how to install and use it.

> Then  using pip3 to install
> the  download_disk.py / what the module name to install this sdk ?  any
> dependency before installing this sdk ? like java need to be installed on
> the rhevm node ?
>
> One doubt:  came across  virt v2v while google search,  can virtv2v  be
> used in rhevm node to export VMs to images ?  or only from other
> hypervisors   to rhevm only virt v2v supports ?
>
> This requires ovirt.conf file:       // ovirt.conf file need to be created
> ? or already there  in any rhevm node?

again, this has to be on the machine from which you run the script

> > $ cat ~/.config/ovirt.conf
> > [engine-dev]
> > engine_url = https://engine-dev
> > username = admin@internal
> > password = mypassword
> > cafile = /etc/pki/vdsm/certs/cacert.pem
> >
> > Nir
> >
> > > Thanks in advance
> > >
> > > On Mon, Aug 2, 2021 at 8:22 PM Nir Soffer <nsoffer@redhat.com> wrote:
> > >> On Mon, Aug 2, 2021 at 12:22 PM <kkchn.in@gmail.com> wrote:
> > >> > I have  few VMs in   Redhat Virtualisation environment  RHeV ( using
> >
> > Rhevm4.1 ) managed by a third party
> >
> > >> > Now I am in the process of migrating  those VMs to  my cloud setup
> >
> > with  OpenStack ussuri  version  with KVM hypervisor and Glance storage.
> >
> > >> > The third party is making down each VM and giving the each VM image
> >
> > with their attached volume disks along with it.
> >
> > >> > There are three folders  which contain images for each VM .
> > >> > These folders contain the base OS image, and attached LVM disk images
> >
> > ( from time to time they added hard disks  and used LVM for storing data )
> > where data is stored.
> >
> > >> > Is there a way to  get all these images to be exported as  Single
> >
> > image file Instead of  multiple image files from Rhevm it self.  Is this
> > possible ?
> >
> > >> > If possible how to combine e all these disk images to a single image
> >
> > and that image  can upload to our  cloud  glance storage as a single image
> > ?>
> > >> It is not clear what is the vm you are trying to export. If you share
> > >> the libvirt xml
> > >> of this vm it will be more clear. You can use "sudo virsh -r dumpxml
> >
> > vm-name".
> >
> > >> RHV supports download of disks to one image per disk, which you can
> > >> move
> > >> to another system.
> > >>
> > >> We also have export to ova, which creates one tar file with all
> >
> > exported disks,
> >
> > >> if this helps.
> > >>
> > >> Nir