API reference tells users to not create servers with availability_zone "nova" but the server create samples use "nova" for the AZ :(

Bug #1817963 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Matt Riedemann

Bug Description

https://developer.openstack.org/api-ref/compute/?expanded=create-server-detail#create-server

From the "availability_zone" parameter description:

"You can list the available availability zones by calling the os-availability-zone API, but you should avoid using the default availability zone when booting the instance. In general, the default availability zone is named nova. This AZ is only shown when listing the availability zones as an admin."

And the user docs on AZs:

https://docs.openstack.org/nova/latest/user/aggregates.html#availability-zones-azs

Yet the 2.1 and 2.63 samples use:

"availability_zone": "nova",

The API samples should be updated to match the warning in the parameter description.

Tags: api-ref docs
Revision history for this message
Matt Riedemann (mriedem) wrote :

It turns out that fixing the API samples is going to be a bit of work because of needing to stub out the nova.availability_zones.get_availability_zones() code and the AvailabilityZoneFilter which is enabled by default...

Revision history for this message
Matt Riedemann (mriedem) wrote :

Stubbing out nova.availability_zones.get_availability_zones() is trivial by dealing with the AvailabilityZoneFilter during scheduling is a bit harder, unless the API samples tests just don't use that filter.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/639874

Changed in nova:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/639874
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=1241e3ec2a93b94d019ebaed8d5086d4622e6cc4
Submitter: Zuul
Branch: master

commit 1241e3ec2a93b94d019ebaed8d5086d4622e6cc4
Author: Matt Riedemann <email address hidden>
Date: Wed Feb 27 19:53:34 2019 -0500

    Stop using "nova" in API samples when creating a server

    The "availability_zone" parameter for server create in the
    API reference and the availabilty zone user docs both say
    that users should not use the default availability zone (nova)
    yet our server create API samples use "nova" which is...bad.

    This change fixes the API samples and related tests to use
    a fake "us-west" availability zone. For any samples that were
    requesting an AZ when creating a server, those are changed from
    requesting "nova" to requesting "us-west" and a new
    AvailabilityZoneFixture is added to stub out the code used to
    validate the requested AZ and what is shown in server detail
    responses.

    Some unused samples are removed from the os-availability-zone
    directory and the API reference and AZ user docs are updated for
    formatting and linking to other docs for reference.

    Change-Id: I3161157f15f05a3ffaaf1b48e7beb6b3e59c5513
    Closes-Bug: #1817963

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 19.0.0.0rc1

This issue was fixed in the openstack/nova 19.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.