Bug 832158 - ISO List is not refreshed after new ISO is uploaded
ISO List is not refreshed after new ISO is uploaded
Status: CLOSED CURRENTRELEASE
Product: oVirt
Classification: Community
Component: ovirt-iso-uploader (Show other bugs)
3.1 RC
Unspecified Unspecified
unspecified Severity medium
: ---
: 3.2
Assigned To: Keith Robertson
integration
: Reopened
Depends On:
Blocks: 836638
  Show dependency treegraph
 
Reported: 2012-06-14 13:21 EDT by Adam Litke
Modified: 2016-07-03 21:34 EDT (History)
10 users (show)

See Also:
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 01:47:07 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
engine.log (489.04 KB, text/x-log)
2012-06-14 16:33 EDT, Adam Litke
no flags Details
Simple program to test SD access (1.32 KB, application/octet-stream)
2012-06-18 16:44 EDT, Keith Robertson
no flags Details

  None (edit)
Description Adam Litke 2012-06-14 13:21:04 EDT
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 15:32:14 EDT
please provide the syntax used to upload the image and uploader and engine logs
Comment 2 Adam Litke 2012-06-14 16:33:10 EDT
Created attachment 591928 [details]
engine.log
Comment 3 Adam Litke 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.
Comment 4 Itamar Heim 2012-06-17 05:54:57 EDT
adam - was it auto refreshed after 5 minutes?
Comment 5 Itamar Heim 2012-06-17 05:55:12 EDT
keith - I'm pretty sure engine can't auto-refresh if rest credentials aren't provided?
Comment 6 Adam Litke 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.
Comment 7 Itamar Heim 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.
Comment 8 Keith Robertson 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.
Comment 9 Adam Litke 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.
Comment 10 Adam Litke 2012-06-18 14:00:04 EDT
Not sure this is completely resolved yet.
Comment 11 Keith Robertson 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.
Comment 12 Keith Robertson 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)
Comment 13 Keith Robertson 2012-06-18 16:44:30 EDT
Created attachment 592742 [details]
Simple program to test SD access
Comment 14 Keith Robertson 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
Comment 15 Itamar Heim 2012-06-19 00:03:30 EDT
changing status to POST.
MODIFIED is after it is merged.
Comment 16 Michael Pasternak 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 18 Itamar Heim 2013-01-16 11:10:16 EST
3.2 beta built, moving to ON_QA status to allow testing

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