Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1477922

Summary: When trying to download a disk that's attached to a running VM or a locked disk, using Python SDK, error message placeholder is not resolved
Product: [oVirt] ovirt-engine Reporter: Natalie Gavrielov <ngavrilo>
Component: BLL.StorageAssignee: Allon Mureinik <amureini>
Status: CLOSED CURRENTRELEASE QA Contact: Natalie Gavrielov <ngavrilo>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.1.4CC: amureini, bugs, ratamir
Target Milestone: ovirt-4.2.0Flags: rule-engine: ovirt-4.2+
amureini: devel_ack+
Target Release: 4.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-20 11:24:17 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:
Bug Depends On: 1414499, 1506284    
Bug Blocks:    
Attachments:
Description Flags
engine.log none

Description Natalie Gavrielov 2017-08-03 08:51:51 UTC
Created attachment 1308643 [details]
engine.log

Description of problem:
When trying to download a disk that's attached to a running VM (disk is active), or when a disk is locked, using Python SDK, the error message shows a variable name instead of the variable's value. 

Version-Release number of selected component:
ovirt-engine-4.1.5-0.1.el7.noarch

How reproducible:
100%

Steps to Reproduce:
Download a disk that's attached to a VM - the VM should be running ("Up") and disk should be active.
OR
Download a disk while it is locked. 


Actual results:
The following error:
1.
$ ./download_disk.py 
Traceback (most recent call last):
  File "./download_disk.py", line 70, in <module>
    direction=types.ImageTransferDirection.DOWNLOAD,
  File "/usr/lib64/python2.7/site-packages/ovirtsdk4/services.py", line 12362, in add
    self._check_fault(response)
  File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line 98, in _check_fault
    Service._raise_error(response, fault)
  File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line 71, in _raise_error
    raise Error(msg)
ovirtsdk4.Error: Fault reason is "Operation Failed". Fault detail is "[Cannot ${action} Storage. The disk qcow-vm_Disk1 is attached to VMs: qcow-vm-iscsi]". HTTP response code is 409.

2.
[ngavrilo@dhcp-4-76 examples]$ ./download_disk.py 
Traceback (most recent call last):
  File "./download_disk.py", line 70, in <module>
    direction=types.ImageTransferDirection.DOWNLOAD,
  File "/usr/lib64/python2.7/site-packages/ovirtsdk4/services.py", line 12362, in add
    self._check_fault(response)
  File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line 98, in _check_fault
    Service._raise_error(response, fault)
  File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line 71, in _raise_error
    raise Error(msg)
ovirtsdk4.Error: Fault reason is "Operation Failed". Fault detail is "[Cannot ${action} Storage: The following disks are locked: test-vm-1_Disk1. Please try again in a few minutes.]". HTTP response code is 409.


Expected results:
Same error, with the value for variable: action

Comment 1 Natalie Gavrielov 2017-11-28 09:57:21 UTC
Verified, the response now for downloading a disk that's attached to a running VM is:
./download_disk.py 
Traceback (most recent call last):
  File "./download_disk.py", line 70, in <module>
    direction=types.ImageTransferDirection.DOWNLOAD,
  File "build/bdist.linux-x86_64/egg/ovirtsdk4/services.py", line 10763, in add
  File "build/bdist.linux-x86_64/egg/ovirtsdk4/service.py", line 232, in _internal_add
  File "build/bdist.linux-x86_64/egg/ovirtsdk4/service.py", line 55, in wait
  File "build/bdist.linux-x86_64/egg/ovirtsdk4/service.py", line 229, in callback
  File "build/bdist.linux-x86_64/egg/ovirtsdk4/service.py", line 132, in _check_fault
  File "build/bdist.linux-x86_64/egg/ovirtsdk4/service.py", line 118, in _raise_error
ovirtsdk4.Error: Fault reason is "Operation Failed". Fault detail is "[Cannot transfer Virtual Disk. The disk golden_mixed_virtio_template is plugged to non-Down VMs: test]". HTTP response code is 409.

Build: ovirt-engine-4.2.0-0.0.master.20171124141652.gita5b4f9b.el7.centos.noarch

Comment 2 Sandro Bonazzola 2017-12-20 11:24:17 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

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