Hi wodel,

With ovirt 4.5.2 you can use the new ovirt-img command:


$ ovirt-img download-disk \
    --engine-url https://engine.com \
    --username admin@internal \
    --cafile /path/to/cert.pem \
    {disk-id} download.qcow2


This downloads the disk with ID "disk-id" into download.qcow2 in the current local directory.

There are options to control the destination image format (e.g. --format raw).
See `ovirt-img download-disk --help`.

You can also add configuration for your setup (you can have many):
$ cat ~/.config/ovirt-img.conf
[engine1]
engine_url = https://engine.com
username = admin@internal
password = password
cafile = /path/to/cert.pem

And then just select the section name in the configuration that you want to use:
$ ovirt-img download-disk --config engine1 {disk-id} image.qcow2
[ 100% ] 6.00 GiB, 16.85 s, 364.64 MiB/s | download completed

The command is already installed with all the dependencies on hosts and engine, and available
via the ovirt-imageio-client package on any host (if you have the right repos).

ovirt-img should be much faster than curl since it understands image sparseness so it does not
transfer gigabytes of zeroes over the wire.

BR,

Albert Esteve

Senior Software Engineer

Red Hat

aesteve@redhat.com   



On Mon, Oct 31, 2022 at 4:16 PM Jayme <jaymef@gmail.com> wrote:
You would likely need to use the REST API or ansible to achieve this.

On Mon, Oct 31, 2022 at 10:32 AM wodel youchi <wodel.youchi@gmail.com> wrote:
Hi,
VM disks can be downloaded from the Manager UI. How can I achieve the same result using curl or wget or something else?
I have several disks that I wish to download via script. Could you help with that?
Regards.
_______________________________________________
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/F6RMF3EJMSVHVTBN2CMEAJ6GXSM3L635/
_______________________________________________
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/E56BTC33Y3SF3KXHHI25LPTLIBPX7JCA/