Bug 1217785 - RHOS inventory only finds availability zone if instance exists in the zone
Summary: RHOS inventory only finds availability zone if instance exists in the zone
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.4.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.6.0
Assignee: Ladislav Smola
QA Contact: Ola Pavlenko
URL:
Whiteboard: providers:openstack:av_zone
Depends On:
Blocks: 1291713
TreeView+ depends on / blocked
 
Reported: 2015-05-01 15:52 UTC by Pete Savage
Modified: 2017-08-30 03:44 UTC (History)
7 users (show)

Fixed In Version: 5.6.0.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1291713 (view as bug list)
Environment:
Last Closed: 2016-06-29 14:54:16 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1348 0 normal SHIPPED_LIVE CFME 5.6.0 bug fixes and enhancement update 2016-06-29 18:50:04 UTC

Description Pete Savage 2015-05-01 15:52:00 UTC
Description of problem: RHOS inventory only finds availability zone if instance exists in the zone


Version-Release number of selected component (if applicable): 5.4.0.0.22.20150420163946


How reproducible: 100%


Steps to Reproduce:
1. Inventory a RHOS provider with no instance (rhos4 tested)
2. View availability zones, "nova" is missing
3. Now add an instance in the nova availability zone
4. Refresh Relationships
5. "nova" is now listed in the availability zones

Actual results:


Expected results:
"nova" should be listed even when no instances are present

Additional info:

Comment 1 Pete Savage 2015-05-01 15:53:45 UTC
I believe the code here

    def get_availability_zones
      azs = servers.collect(&:availability_zone)
      azs.concat(volumes.collect(&:availability_zone)).compact!
      azs.uniq!
      azs << nil # force the null availability zone for openstack
      process_collection(azs, :availability_zones) { |az| parse_availability_zone(az) }
    end

Iterates and creates a unique list of each availability zone from the list of servers

Comment 3 Jason Frey 2015-05-01 16:36:24 UTC
I don't believe this is possible to be retrieved from the OpenStack API, which is why it is done by inspecting instances.  We can review if newer versions of OpenStack provide this API.

Comment 4 Pete Savage 2015-05-01 17:10:31 UTC
The nova api does allow some inspection http://docs.openstack.org/developer/nova/api/nova.api.openstack.compute.contrib.availability_zone.html

However I have not tested it, and fog doesn't seem to reference them as far as I can see.

Comment 5 Greg Blomquist 2015-05-05 18:32:43 UTC
This is true.  Unfortunately, this is the only way we can get the list of availability zones from Nova via Fog.

I'll leave this open for now to see if there's enough pressure to add this functionality to Fog ourselves.

Comment 6 Greg Blomquist 2015-07-20 02:44:33 UTC
Ladas,

can you check on the level of effort to add this functionality to Fog?

Comment 7 Ladislav Smola 2015-07-20 07:53:24 UTC
Adding it will be pretty easy, I've put it into our trello

API paths are
/os-availability-zone/detail
/os-availability-zone

Comment 8 Ladislav Smola 2015-07-22 07:08:13 UTC
Seems like there is OpenStack[:compute].list_zones, that we can use right now, it's just not packed to Fog::Model

Comment 9 Ladislav Smola 2015-07-22 08:10:51 UTC
Full support of availability zones here https://github.com/fog/fog/pull/3636

Comment 11 CFME Bot 2015-11-19 16:34:39 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/a00d1b99081d5b86cbf6a4081c859ef9edc21d48

commit a00d1b99081d5b86cbf6a4081c859ef9edc21d48
Author:     Ladislav Smola <lsmola>
AuthorDate: Wed Jul 29 10:23:33 2015 +0200
Commit:     Ladislav Smola <lsmola>
CommitDate: Mon Nov 2 15:37:18 2015 +0100

    Openstack availability zones from the API
    
    Fetching Availability zones from nova and cinder API, rather than
    reading them from the instances and volumes.
    
    BZ
    https://bugzilla.redhat.com/show_bug.cgi?id=1217785

 .../openstack/cloud_manager/refresh_parser.rb          | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

Comment 12 Pete Savage 2016-03-23 13:21:07 UTC
Since it's likely I may not get to be the tester for this particular bug, if we inventory a rhos instance with no instances, it used to fail to find the nova availability zone. With this change I would think we should see it.

Comment 13 Udi Kalifon 2016-06-01 08:38:22 UTC
Verified in: 5.6.0.8-rc1-nightly.20160531084619_1bff101

Comment 15 errata-xmlrpc 2016-06-29 14:54:16 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.

https://access.redhat.com/errata/RHBA-2016:1348


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