Nova does not respect default_schedule_zone `None`

Bug #1730918 reported by Ondrej Vasko
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
In Progress
Undecided
Unassigned

Bug Description

Hello,

DESCRIPTION
-----------

I want Nova to behave like that when Availability Zone is not specified (`Any Availability Zone` is set in Horizon), it will create VM in random AZ.

STEPS TO REPRODUCE
------------------

Steps I do to configure that:

1. In `nova.conf` I set `default_schedule_zone = None` and restarted all nova services. I found this attribute in documentation [1] and also in Mirantis blog post [2]
2. I create 2 availability zones (2 host aggregates each with 1 hypervisor added).
3. I try to create VM In Horizon with `Any Availability Zone` and it results in following error:

    The requested availability zone is not available (HTTP 400).

The commands I executed to create AZs:

    ```
    openstack aggregate create HA-Test1 --zone AZ-Test1 --property availability_zone=AZ-Test1
    openstack aggregate create HA-Test2 --zone AZ-Test2 --property availability_zone=AZ-Test2
    openstack aggregate add host HA-Test1 os-compute-01
    openstack aggregate add host HA-Test2 os-compute-02
    ```

POINT
-----

Now this doesn't work as expected, but(!) when I remove `nova.conf` attribute `default_schedule_zone = None`, or I will configure it empty `default_schedule_zone = `, spawning of VMs works as expected and they are scheduled in random AZ.

Therefore I think that Nova doesn't handle `None` as python `None`, but as string (As if you set default schedule zone to zone `None`).

ENVIRONMENT
-----------

I am using stable Pike release with KVM + Libvirt installed via Openstack-Ansible on Ubuntu 16.04.

[1] https://docs.openstack.org/ocata/config-reference/compute/config-options.html
[2] https://www.mirantis.com/blog/the-first-and-final-word-on-openstack-availability-zones/

Tags: config
Revision history for this message
Takashi Natsume (natsume-takashi) wrote :

IMO, the issue is not an issue of nova.
Probably it is an issue of oslo.config.

tags: added: config
Revision history for this message
Ritesh Paiboina (rsritesh) wrote :

Hi,

It seems to be a valid case. I tried the value as "None/none" for default_schedule_zone [DEFAULT] in section.

As per this document https://docs.openstack.org/ocata/config-reference/compute/config-options.html
we can keep None as default value.

What I see from nova api , when some value is given like 'None'
(Pdb) availability_zone
'None'

(Pdb) availability_zone
'Xyz'

So any value given to the default_schedule_zone is considered as string zone value.

So I am not sure weather we should exclude None as value for default_schedule_zone

Revision history for this message
Ondrej Vasko (ondrej.vasko) wrote :

I think that default value should be set to empty string or None should be treated as no zone.

It does not have a logic to set default schedule zone to zone named 'None' since default zone in Openstack is nova, it could be `nova` or nothing.

Changed in nova:
status: New → Confirmed
assignee: nobody → Ritesh Paiboina (rsritesh)
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/550418

Changed in nova:
status: Confirmed → In Progress
Changed in nova:
assignee: Ritesh Paiboina (rsritesh) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Ritesh (<email address hidden>) on branch: master
Review: https://review.opendev.org/550418

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.