Bug 836638 - ISO List is not refreshed after new ISO is uploaded
Summary: ISO List is not refreshed after new ISO is uploaded
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-iso-uploader
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Keith Robertson
QA Contact: Tomas Dosek
URL:
Whiteboard: integration
Depends On: 832158 841863
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-29 17:37 UTC by Keith Robertson
Modified: 2016-07-04 01:34 UTC (History)
12 users (show)

Fixed In Version: si11
Doc Type: Bug Fix
Doc Text:
Clone Of: 832158
Environment:
Last Closed: 2012-12-04 18:19:21 UTC
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:1529 0 normal SHIPPED_LIVE rhevm-iso-uploader bug fix update 2012-12-04 23:17:36 UTC

Description Keith Robertson 2012-06-29 17:37:55 UTC
+++ This bug was initially created as a clone of Bug #832158 +++

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:

--- Additional comment from iheim on 2012-06-14 15:32:14 EDT ---

please provide the syntax used to upload the image and uploader and engine logs

--- Additional comment from agl.com on 2012-06-14 16:33:10 EDT ---

Created attachment 591928 [details]
engine.log

--- Additional comment from agl.com on 2012-06-14 16:34:56 EDT ---

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.

--- Additional comment from iheim on 2012-06-17 05:54:57 EDT ---

adam - was it auto refreshed after 5 minutes?

--- Additional comment from iheim on 2012-06-17 05:55:12 EDT ---

keith - I'm pretty sure engine can't auto-refresh if rest credentials aren't provided?

--- Additional comment from agl.com on 2012-06-18 10:49:16 EDT ---

(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.

--- Additional comment from iheim on 2012-06-18 11:19:09 EDT ---

iirc, iso uploader already supports the refresh, but you need to give it crednetials to use the REST API to do so.

--- Additional comment from kroberts on 2012-06-18 13:13:05 EDT ---

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.

--- Additional comment from agl.com on 2012-06-18 13:59:14 EDT ---

(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.

--- Additional comment from agl.com on 2012-06-18 14:00:04 EDT ---

Not sure this is completely resolved yet.

--- Additional comment from kroberts on 2012-06-18 14:28:12 EDT ---

(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.

--- Additional comment from kroberts on 2012-06-18 16:42:28 EDT ---

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)

--- Additional comment from kroberts on 2012-06-18 16:44:30 EDT ---

Created attachment 592742 [details]
Simple program to test SD access

--- Additional comment from kroberts on 2012-06-18 19:32:01 EDT ---

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

--- Additional comment from iheim on 2012-06-19 00:03:30 EDT ---

changing status to POST.
MODIFIED is after it is merged.

--- Additional comment from mpastern on 2012-06-19 03:29:38 EDT ---

(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 2 Tomas Dosek 2012-08-13 12:38:03 UTC
Verified - si13.2 - ISO list is now refreshed right after new ISO is uploaded by rhevm-iso-uploader.

Comment 4 errata-xmlrpc 2012-12-04 18:19:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

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

http://rhn.redhat.com/errata/RHBA-2012-1529.html


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