On Tue, Apr 28, 2020 at 6:18 PM Guilherme De Oliveira Santos
<gdeolive(a)redhat.com> wrote:
Hi people,
I recently had to upload an image on a 4.4.0-31 engine and Nir told me to share here the
feedback.
I installed ovirt-imageio-common-2.0.5-0.el8ev.x86_64
and created the following script to upload it using sdk:
#!/usr/bin/bash
python3 /root/ovirt-engine-sdk/sdk/examples/upload_disk.py \
--engine-url "https://`hostname`/" \
--username admin@internal \
--password-file pssword \
--cafile /tmp/ca.pem \
--disk-format qcow2 \
--disk-sparse \
--sd-name nfs_0 \
/tmp/rhel-guest-image-7.6-210.x86_64.qcow2
The image got uploaded pretty quickly and I didn't have any trouble...
Thanks for sharing your experience, even when you did not have any trouble :-)
The fact that you had to create a script is sad. I think we need to eliminate
all the engine related arguments from the command line[1], so the
command will be:
python3 /root/ovirt-engine-sdk/sdk/examples/upload_disk.py \
--engine-conf my-engine.conf \
--disk-format qcow2 \
--disk-sparse \
--sd-name nfs_0 \
/tmp/rhel-guest-image-7.6-210.x86_64.qcow2
This is true for all examples in the SDK.
The rest of the arguments may have better defaults so you don't need to specify
them, but for this we need a new engine API returning the recommended
configuration
for a storage domain[2] (e.g format, sparse).
If we had such API, the command would be:
python3 /root/ovirt-engine-sdk/sdk/examples/upload_disk.py \
--engine-conf my-engine.conf \
--sd-name nfs_0 \
/tmp/rhel-guest-image-7.6-210.x86_64.qcow2
And we would create the disk using the same defaults used in engine UI.
Finally we need a proper command line tool[1] so you can use:
ovirt-img upload -c my-engine.conf -s nfs_0
rhel-guest-image-7.6-210.x86_64.qcow2
[1]
https://bugzilla.redhat.com/1828981
[2]
https://bugzilla.redhat.com/1829009
[3]
https://bugzilla.redhat.com/1626262
Nir