[openstack-dev] [nova] What is the difference between default_schedule_zone and default_availability_zone?

Sylvain Bauza sbauza at redhat.com
Thu Apr 13 08:10:00 UTC 2017



Le 12/04/2017 18:24, Matt Riedemann a écrit :
> I'm hoping someone more learned can teach me. These two options sound
> very similar, and are thus very confusing. They are also both in the
> [DEFAULT] config option group, but defined in different places [1][2].
> 
> The help text for one says:
> 
> "This option determines the availability zone to be used when it is not
> specified in the VM creation request."
> 
> The help text for the other says:
> 
> "Availability zone to use when user doesn't specify one.
> This option is used by the scheduler to determine which availability
> zone to place a new VM instance into if the user did not specify one
> at the time of VM boot request."
> 
> It looks like one goes on the instance record itself, and the other goes
> into an aggregate metadata if the zone is specified for the aggregate.
> 
> So while they sound the exact same, they are not? Or are they in the
> end? See how this is terrible?
> 


So, the upstream documentation mentions a bit of that :
https://docs.openstack.org/developer/nova/aggregates.html#availability-zones-azs

To be clear :
 - default_availability_zone is related to compute nodes. If one node is
not in an aggregate having an AZ metadata, then the availability_zones
API will return the node into the default AZ named by this opt (default
is "nova").
 - default_schedule_zone is related to instances. If a user doesn't
provide --availability-zone flag when booting the instance, then the
compute API will set the instance.az field to be this conf opt (default
is None). That conf opt value is not returned when you nova show an
instance, because OS-EXT-AZ:availability_zone attribute is rather
getting you the related AZ for the node where the instance is (ie.
either the aggregate AZ metadata where the host belongs to, or
default_availability_zone opt value).



To be clear, default_availability_zone is used for API related concerns
where we want to provide a consistent UX if people want to see a cloud
by AZs, while default_schedule_zone is rather for an internal use for
knowing whether we should force by default instances to be within a
specific AZ or if they should be AZ-free (and then move operations
wouldn't be constrained by AZs).


HTH,
-Sylvain


> [1]
> https://github.com/openstack/nova/blob/5a556a720f5a7394cab4c84fa6202976c6190b23/nova/conf/availability_zone.py#L34
> 
> [2]
> https://github.com/openstack/nova/blob/5a556a720f5a7394cab4c84fa6202976c6190b23/nova/conf/compute.py#L49
> 
> 



More information about the OpenStack-dev mailing list