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:
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
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.
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.
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.
Ladas, can you check on the level of effort to add this functionality to Fog?
Adding it will be pretty easy, I've put it into our trello API paths are /os-availability-zone/detail /os-availability-zone
Seems like there is OpenStack[:compute].list_zones, that we can use right now, it's just not packed to Fog::Model
Full support of availability zones here https://github.com/fog/fog/pull/3636
https://github.com/ManageIQ/manageiq/pull/3637
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(-)
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.
Verified in: 5.6.0.8-rc1-nightly.20160531084619_1bff101
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