[ovirt-users] Re: upload image using python api

2020-03-24 Thread David David
thanks
now all works fine with 4.3.2

2020-03-25 3:13 GMT+04:00, Nir Soffer :
> On Tue, Mar 24, 2020 at 8:13 AM David David  wrote:
>>
>> hi
>> can't upload disk image with that script:
>> https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/upload_disk.py
>> this error message is appeared when i trying to upload image:
>> # python upload_disk.py --engine-url https://alias-e.localdomain
>> --username admin@internal --disk-format raw --sd-name iscsi-test-7 -c
>> ca.pem /home/linux1.raw
>> Checking image...
>> Image format: raw
>> Disk format: raw
>> Disk content type: data
>> Disk provisioned size: 42949672960
>> Disk initial size: 42949672960
>> Disk name: linux1.raw
>
> Based on this, you are using upload_disk.py from ovirt-engine-sdk 4.4...
>
>> Connecting...
>> Password:
>> Creating disk...
>> Creating transfer session...
>> Uploading image...
>> Traceback (most recent call last):
>>   File "upload_disk.py", line 288, in 
>> with ui.ProgressBar() as pb:
>> TypeError: __init__() takes at least 2 arguments (1 given)
>
> Which was tested with ovirt-imageio-common 1.6.3, but not with the
> version from ovirt 4.3 (1.5.3).
>
> The issue is removed argument in ui.ProgressBar() that is not needed in
> 4.4.
>
> Since you have 4.3.8 system, you should use upload_disk.py from SDK
> version 4.3.2.
>
> upload_disk.py from 4.3.2 is:
> https://raw.githubusercontent.com/oVirt/ovirt-engine-sdk/fbc9642a38a14107a2465ebf319220f31802f1df/sdk/examples/upload_disk.py
>
> If you want new features added after that release during ovirt 4.4.
> development, and you
> are ok with using less tested code you can try to use the last version
> of upload_disk.py
> that was compatible with 4.3 version of ovirt-imageio-common:
> https://raw.githubusercontent.com/oVirt/ovirt-engine-sdk/b4c37ad3881b176596dfb03c70ab1e494644069e/sdk/examples/upload_disk.py
>
> Regardless please file ovirt-imageio bug. We want to keep the example
> scripts compatible with earlier
> versions if possible.
> https://bugzilla.redhat.com/enter_bug.cgi?product=ovirt-imageio
>
>> software using:
>> ovirt-engine 4.3.8.2-1
>> python-ovirt-engine-sdk4-4.3.2-2
>
> Nir
>
>
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@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/ENE32RLYSQBDF6SGTU3YBEUDXLAAGJNZ/


[ovirt-users] Re: upload image using python api

2020-03-24 Thread Nir Soffer
On Tue, Mar 24, 2020 at 8:13 AM David David  wrote:
>
> hi
> can't upload disk image with that script:
> https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/upload_disk.py
> this error message is appeared when i trying to upload image:
> # python upload_disk.py --engine-url https://alias-e.localdomain
> --username admin@internal --disk-format raw --sd-name iscsi-test-7 -c
> ca.pem /home/linux1.raw
> Checking image...
> Image format: raw
> Disk format: raw
> Disk content type: data
> Disk provisioned size: 42949672960
> Disk initial size: 42949672960
> Disk name: linux1.raw

Based on this, you are using upload_disk.py from ovirt-engine-sdk 4.4...

> Connecting...
> Password:
> Creating disk...
> Creating transfer session...
> Uploading image...
> Traceback (most recent call last):
>   File "upload_disk.py", line 288, in 
> with ui.ProgressBar() as pb:
> TypeError: __init__() takes at least 2 arguments (1 given)

Which was tested with ovirt-imageio-common 1.6.3, but not with the
version from ovirt 4.3 (1.5.3).

The issue is removed argument in ui.ProgressBar() that is not needed in 4.4.

Since you have 4.3.8 system, you should use upload_disk.py from SDK
version 4.3.2.

upload_disk.py from 4.3.2 is:
https://raw.githubusercontent.com/oVirt/ovirt-engine-sdk/fbc9642a38a14107a2465ebf319220f31802f1df/sdk/examples/upload_disk.py

If you want new features added after that release during ovirt 4.4.
development, and you
are ok with using less tested code you can try to use the last version
of upload_disk.py
that was compatible with 4.3 version of ovirt-imageio-common:
https://raw.githubusercontent.com/oVirt/ovirt-engine-sdk/b4c37ad3881b176596dfb03c70ab1e494644069e/sdk/examples/upload_disk.py

Regardless please file ovirt-imageio bug. We want to keep the example
scripts compatible with earlier
versions if possible.
https://bugzilla.redhat.com/enter_bug.cgi?product=ovirt-imageio

> software using:
> ovirt-engine 4.3.8.2-1
> python-ovirt-engine-sdk4-4.3.2-2

Nir
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@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/INPOLACFJOOY3D2UKK7UX4ZHHJYAGXJD/