AZ should be validated durign instance create at the api layer

Bug #1185367 reported by Phil Day
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Lei Duan

Bug Description

Currently the compute API layer does not do any validation of the availability zone, so a request like:

nova boot --availability_zone foobar

will be accepted, sent to the scheduler, and the instance will go to error.

There is already code in compute/api.py which processes the availability_zone value

def _handle_availability_zone(availability_zone)
...

So it seems like there should be some basic validation added to check that the zone exists and is available

Tags: api
Revision history for this message
Yang Yu (yuyangbj) wrote :

I found if the host is not in the zone, it is still accepted and boot VM.

Changed in nova:
assignee: nobody → Yang Yu (yuyangbj)
tags: added: api
Revision history for this message
Yang Yu (yuyangbj) wrote :

Basing on the current design, we should keep the AZ check in scheduler layer because current OpenStack could force the host to boot. For example,

nova boot --availability_zone foobar:host1

The VM will be created on compute host1 even though the foobar is not existing. So if we add the AZ check in api layer, it will break current design. So mark this bug to invalid.

Changed in nova:
status: New → Invalid
Revision history for this message
Phil Day (philip-day) wrote :

Marking this back to New because I simply don't agree with the above analysis.

Personally I doubt if the intention of the forcehost capability was to allow an invalid AZ name by design, - but if there really is a need to be able to specify an invalid AZ name when forcing to a particular host (a privileged operation) then it would be possible to make the API validation skip the check for a valid AZ if the name contains a ":"

Not a reason to reject making a significant improvement to the common use case.

Changed in nova:
status: Invalid → New
Lei Duan (duan101101)
Changed in nova:
assignee: Yang Yu (yuyangbj) → Lei Duan (duan101101)
Lei Duan (duan101101)
Changed in nova:
status: New → In Progress
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/33657

Lei Duan (duan101101)
Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
Thierry Carrez (ttx) wrote :

fix is not merged yet

Changed in nova:
status: Fix Committed → In Progress
Lei Duan (duan101101)
information type: Public → Public Security
Revision history for this message
Thierry Carrez (ttx) wrote :

Please do not set to Public Security unless you can point to an exploitable vulnerability.

information type: Public Security → Public
Lei Duan (duan101101)
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-3 → 2013.2
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.