Bug 1956167 - SDK example script "backup_vm.py" fails to complete "full" cycle
Summary: SDK example script "backup_vm.py" fails to complete "full" cycle
Keywords:
Status: POST
Alias: None
Product: ovirt-engine-sdk-python
Classification: oVirt
Component: General
Version: ---
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ovirt-4.4.7
: ---
Assignee: Eyal Shenitzky
QA Contact: Guilherme Santos
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-05-03 06:27 UTC by Ilan Zuckerman
Modified: 2021-05-03 14:19 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
oVirt Team: Storage


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 114584 0 master POST backup_vm.py: fix broken 'full'/'incremental' VM backup commands 2021-05-03 14:18:42 UTC

Description Ilan Zuckerman 2021-05-03 06:27:43 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Ilan Zuckerman 2021-05-03 06:29:13 UTC
Description of problem:

python-sdk example script "backup_vm.py" fails to work with 'full' parameter passed.
Our clients might be using those scripts directly or as an example of how things should work. Thus this example needs to be fixed.


[1]:
[root@lynx21 ~]# python3 /usr/share/doc/python3-ovirt-engine-sdk4/examples/backup_vm.py -c engine full --backup-dir /var/tmp/ 0a2700c2-84d0-4c6a-b6b5-8f1a0412780b
[   0.0 ] Starting full backup for VM 0a2700c2-84d0-4c6a-b6b5-8f1a0412780b
[   1.5 ] Waiting until backup 78236bd4-bfcd-4428-a912-1d84893e7ff0 is ready
[  18.8 ] Created checkpoint 'f8f7c68c-d30b-460a-92ff-1ca2b364e62a' (to use in --from-checkpoint-uuid for the next incremental backup)
[  18.8 ] Creating image transfer for disk f2c917e3-050a-45ca-a6f4-01b8a8c9d210
[  18.8 ] Finalizing backup
[  18.9 ] Waiting until backup is finalized
Traceback (most recent call last):
  File "/usr/share/doc/python3-ovirt-engine-sdk4/examples/backup_vm.py", line 452, in <module>
    main()
  File "/usr/share/doc/python3-ovirt-engine-sdk4/examples/backup_vm.py", line 167, in main
    args.command(args)
  File "/usr/share/doc/python3-ovirt-engine-sdk4/examples/backup_vm.py", line 183, in cmd_full
    download_backup(connection, backup.id, args)
  File "/usr/share/doc/python3-ovirt-engine-sdk4/examples/backup_vm.py", line 371, in download_backup
    connection, backup_uuid, disk, disk_path, args, incremental=download_incremental)
  File "/usr/share/doc/python3-ovirt-engine-sdk4/examples/backup_vm.py", line 388, in download_disk
    timeout_policy=types.ImageTransferTimeoutPolicy(args.timeout_policy))
AttributeError: 'Namespace' object has no attribute 'timeout_policy'


Version-Release number of selected component (if applicable):
rhv-4.4.6-6 
python3-ovirt-engine-sdk4-4.4.11-1


How reproducible:
100%

Steps to Reproduce:
1. Run the script as in the example with an existing VM


Actual results:
Fails to complete

Expected results:
Should succeed


Note You need to log in before you can comment on or make changes to this bug.