Bug 1956167

Summary: SDK example script "backup_vm.py" fails to complete "full" cycle
Product: [oVirt] ovirt-engine-sdk-python Reporter: Ilan Zuckerman <izuckerm>
Component: GeneralAssignee: Eyal Shenitzky <eshenitz>
Status: CLOSED CURRENTRELEASE QA Contact: Amit Sharir <asharir>
Severity: medium Docs Contact:
Priority: unspecified    
Version: ---CC: aefrat, bugs, juan.hernandez, mperina
Target Milestone: ovirt-4.4.7Keywords: ZStream
Target Release: ---Flags: pm-rhel: ovirt-4.4+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-06 07:27:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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

Comment 3 Amit Sharir 2021-07-05 14:16:54 UTC
Version:

rhv-release-4.4.7-6-001.noarch
python3-ovirt-engine-sdk4-4.4.13-1.el8ev.x86_64

Verification steps:

1. I created a new VM.
2. Attached a preallocated disk to the VM.
3. Ran the script mentioned in comment #1.


Verification results:

[root@storage-ge5-vdsm1 examples]# python3 /usr/share/doc/python3-ovirt-engine-sdk4/examples/backup_vm.py -c engine full --backup-dir /var/tmp/ a12bdaa3-4ab1-4529-ad73-e9fdea6fcff8
[   0.0 ] Starting full backup for VM 'a12bdaa3-4ab1-4529-ad73-e9fdea6fcff8'
[   1.5 ] Waiting until backup 'b5d08612-0d40-4ab5-9ee0-d6055a09badd' is ready
[   3.6 ] Created checkpoint '1c209a73-83dc-4b1a-8c61-7034e8fdf83a' (to use in --from-checkpoint-uuid for the next incremental backup)
[   3.7 ] Creating image transfer for disk 'a46ebc7c-fadb-4932-b2e4-11c2951c5832'
[   5.7 ] Image transfer 'c0ac17dd-a3ed-4ce5-8190-b4e7f77d7111' is ready
[ 100.00% ] 10.00 GiB, 11.72 seconds, 873.53 MiB/s                             
[  17.4 ] Finalizing image transfer
[  19.5 ] Creating image transfer for disk 'efc2006f-3dcf-4b2e-99fb-9a2c28eddba9'
[  21.3 ] Image transfer '9ebe0735-8c0c-47fa-ad33-c5bc4da1f78a' is ready
[ 100.00% ] 2.00 GiB, 0.10 seconds, 19.88 GiB/s                                
[  21.4 ] Finalizing image transfer
[  22.4 ] Finalizing backup
[  22.5 ] Waiting until backup is being finalized
[  22.6 ] Full backup completed successfully

Verification conclusions:

The expected output matched the actual output.
The total flow mentioned was done with no errors/unexpected logs.

Bug verified.

Comment 4 Sandro Bonazzola 2021-07-06 07:27:58 UTC
This bugzilla is included in oVirt 4.4.7 release, published on July 6th 2021.

Since the problem described in this bug report should be resolved in oVirt 4.4.7 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.