Bug 832158

Summary: ISO List is not refreshed after new ISO is uploaded
Product: [Retired] oVirt Reporter: Adam Litke <alitke>
Component: ovirt-iso-uploaderAssignee: Keith Robertson <kroberts>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.1 RCCC: aburden, acathrow, dyasny, ecohen, iheim, jmoran, kroberts, mgoldboi, mpastern, ykaul
Target Milestone: ---Keywords: Reopened
Target Release: 3.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: integration
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Newly added ISOs were not visible in the 'Attach ISO' list unless the list was manually refreshed. A fix has been made available so that the ISO list automatically refreshes after a new ISO has been uploaded.
Story Points: ---
Clone Of:
: 836638 (view as bug list) Environment:
Last Closed: 2013-02-15 06:47:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 836638    
Attachments:
Description Flags
engine.log
none
Simple program to test SD access none

Description Adam Litke 2012-06-14 17:21:04 UTC
Description of problem:

After adding a new ISO to the active iso domain with engine-iso-uploader, the iso is not selectable in the 'Attach ISO' GUI widget unless the user first visits the Images tab in the details pane of the given iso domain.


Version-Release number of selected component (if applicable): 
ovirt-engine-webadmin-portal-3.1.0_0001-0.gitdd65f3.fc17.noarch.rpm

How reproducible:
Always

Steps to Reproduce:
1. Create a VM
2. Upload an ISO to the iso domain with engine-iso-uploader
3. Try to attach this new iso to the VM you created
4. The iso will not appear in the list
5. Click the storage tab
6. Select the iso domain
7. Click the Images tab in the details pane
8. The new iso appears in the list
9. Try to attach the new iso to the vm again
10. This time it is selectable

Actual results:
ISO not selectable until the Images detail tab is visited

Expected results:
ISO is selectable as soon as it has been added to the iso domain.

Additional info:

Comment 1 Itamar Heim 2012-06-14 19:32:14 UTC
please provide the syntax used to upload the image and uploader and engine logs

Comment 2 Adam Litke 2012-06-14 20:33:10 UTC
Created attachment 591928 [details]
engine.log

Comment 3 Adam Litke 2012-06-14 20:34:56 UTC
Command used:
engine-iso-uploader -i isos  upload /scratch/isos/Fedora-17-x86_64-netinst.iso

/var/log/ovirt-engine/engine-iso-uploader.log is empty.

Comment 4 Itamar Heim 2012-06-17 09:54:57 UTC
adam - was it auto refreshed after 5 minutes?

Comment 5 Itamar Heim 2012-06-17 09:55:12 UTC
keith - I'm pretty sure engine can't auto-refresh if rest credentials aren't provided?

Comment 6 Adam Litke 2012-06-18 14:49:16 UTC
(In reply to comment #4)
> adam - was it auto refreshed after 5 minutes?

Unfortunately I have already recycled my test environment.  I assume the expected behavior is a 5 minute refresh cycle?  If so, then I can close this bug as 'working as designed' and add an RFE so that after ovirt-iso-uploader completes, it will force a refresh on the iso domain.

Comment 7 Itamar Heim 2012-06-18 15:19:09 UTC
iirc, iso uploader already supports the refresh, but you need to give it crednetials to use the REST API to do so.

Comment 8 Keith Robertson 2012-06-18 17:13:05 UTC
Couple of points:

1 - The ISO uploader shd be prompting you for a PW unless you've supplied it in isouploader.conf.  Are you certain that you don't have a PW in isouploader.conf and if you do that it is the correct PW?

Example: 
# engine-iso-uploader  -i localISO upload test.vfd
Please provide the REST API password for the admin@internal oVirt Engine user (CTRL+D to abort): 

It is prompting you for the PW so that it can force engine to refresh the ISO domain, BTW.


2 - The log file will be empty unless you supply '-v' or there is an "ERROR" log condition.  By default the LC is set to "INFO" and above.  Hence, unless there is an ERROR, WARN, etc. you'll not see anything in the log file.

Comment 9 Adam Litke 2012-06-18 17:59:14 UTC
(In reply to comment #8)
> Couple of points:
> 
> 1 - The ISO uploader shd be prompting you for a PW unless you've supplied it
> in isouploader.conf.  Are you certain that you don't have a PW in
> isouploader.conf and if you do that it is the correct PW?
> 

Yes, it did prompt me for those credentials.  Shouldn't it be able to use the password I entered to trigger the refresh?

> Example: 
> # engine-iso-uploader  -i localISO upload test.vfd
> Please provide the REST API password for the admin@internal oVirt Engine
> user (CTRL+D to abort): 
> 
> It is prompting you for the PW so that it can force engine to refresh the
> ISO domain, BTW.

Did not seem to work in my setup.

> 2 - The log file will be empty unless you supply '-v' or there is an "ERROR"
> log condition.  By default the LC is set to "INFO" and above.  Hence, unless
> there is an ERROR, WARN, etc. you'll not see anything in the log file.

Comment 10 Adam Litke 2012-06-18 18:00:04 UTC
Not sure this is completely resolved yet.

Comment 11 Keith Robertson 2012-06-18 18:28:12 UTC
(In reply to comment #10)
> Not sure this is completely resolved yet.

Agree.

WRT to: 
"Yes, it did prompt me for those credentials.  Shouldn't it be able to use the password I entered to trigger the refresh?"

Yes, this is the reason that it is asking you for the PW.  It cannot invoke the RESTful method with out proper credentials.

---
I'm investigating the following:

I just compared the upstream versus downstream behaviour and for some reason the ovirt-engine-sdk is returning "None" when I call self.api.storagedomains.get(ID) with a  valid SDID.  It could be my system or it could be the sdk.  I'm not sure yet.

Comment 12 Keith Robertson 2012-06-18 20:42:28 UTC
OK, I just did some more testing and I think that the problem is in ovirt-engine-sdk.  I've attached a sample program to prove the point.

The program:
1) In the program, I make a connection to the API.
2) To prove the connection is active, I print the API version.
3) Next, I list all storage domains.
4) Finally, I try to get a storage domain that I know is an ISO domain.

The problem:
SDK returns 'None' for an existing ISO SD.  This is the root cause of the problem.

# python test.py 
API Vendor(ovirt.org)	API Version(3.1.0)
8ed3a6c3-c414-4126-89ca-03339da366e8  <-- This is an ISO domain.
75ce9e4f-1f57-4cdd-a20d-ceda005dbdce
Looking for SD with id(8ed3a6c3-c414-4126-89ca-03339da366e8)
SD(None)

Comment 13 Keith Robertson 2012-06-18 20:44:30 UTC
Created attachment 592742 [details]
Simple program to test SD access

Comment 14 Keith Robertson 2012-06-18 23:32:01 UTC
Thought about it on the way home.  The kwargs had changed between the old API and new.

Fix is here: http://gerrit.ovirt.org/5464

Comment 15 Itamar Heim 2012-06-19 04:03:30 UTC
changing status to POST.
MODIFIED is after it is merged.

Comment 16 Michael Pasternak 2012-06-19 07:29:38 UTC
(In reply to comment #12)
> OK, I just did some more testing and I think that the problem is in
> ovirt-engine-sdk.  I've attached a sample program to prove the point.
> 
> The program:
> 1) In the program, I make a connection to the API.
> 2) To prove the connection is active, I print the API version.
> 3) Next, I list all storage domains.
> 4) Finally, I try to get a storage domain that I know is an ISO domain.
> 
> The problem:
> SDK returns 'None' for an existing ISO SD.  This is the root cause of the
> problem.
> 
> # python test.py 
> API Vendor(ovirt.org)	API Version(3.1.0)
> 8ed3a6c3-c414-4126-89ca-03339da366e8  <-- This is an ISO domain.
> 75ce9e4f-1f57-4cdd-a20d-ceda005dbdce
> Looking for SD with id(8ed3a6c3-c414-4126-89ca-03339da366e8)
> SD(None)

Hi Keith,

the problem is in your code, (i see you already fixed it),

you did:
-------

api.storagedomains.get(id)

while should:
------_------

api.storagedomains.get(id=id),


NOTE
----

* basically you should always check method documentation, 
api.storagedomains.get().__doc__ in your case, only parameters there are:

        [@param name: string (the name of the entity)]
        [@param **kwargs: dict (property based filtering)]

i.e to use kwargs, you have to specify property name (id=xxx as you did
in your fix).

* you can also locate ISO domain using client filtering:

  api.storagedomains.list(type='iso')

  using very same kwargs pattern.

Comment 18 Itamar Heim 2013-01-16 16:10:16 UTC
3.2 beta built, moving to ON_QA status to allow testing