Remove availability_zones from service table
This is the final step in enabling availability_zones using aggregate metadata. Previously all services had an availability_zone, but the availability_zone is only used for nova-compute. Services such as nova-scheduler, nova-network, nova-conductor have always spanned all availability_zones. After this change only compute nodes (nova-compute), will have an availability_zone. In order to preserve current APIs, when running: * nova host-list (os-hosts) * euca-describe-availability-zones verbose * nova-manage service list Internal services will appear in there own internal availability_zone (CONF.internal_service_availability_zone) Internal zone is hidden in euca-describe-availability_zones (non-verbose) CONF.node_availability_zone has been renamed to CONF.default_availability_zone and is only used by the nova-api and nova-scheduler. CONF.node_availability_zone still works but is deprecated DocImpact Completes blueprint aggregate-based-availability-zones Change-Id: Ib772df5f9ac2865f20df479f8ddce575a9ce3aff
This commit is contained in:
@@ -70,6 +70,7 @@ if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'nova', '__init__.py')):
|
||||
gettext.install('nova', unicode=1)
|
||||
|
||||
from nova.api.ec2 import ec2utils
|
||||
from nova import availability_zones
|
||||
from nova.compute import instance_types
|
||||
from nova.compute import rpcapi as compute_rpcapi
|
||||
from nova import config
|
||||
@@ -626,6 +627,7 @@ class ServiceCommands(object):
|
||||
ctxt = context.get_admin_context()
|
||||
now = timeutils.utcnow()
|
||||
services = db.service_get_all(ctxt)
|
||||
services = availability_zone.set_availability_zones(ctxt, services)
|
||||
if host:
|
||||
services = [s for s in services if s['host'] == host]
|
||||
if service:
|
||||
@@ -741,6 +743,7 @@ class HostCommands(object):
|
||||
ctxt = context.get_admin_context()
|
||||
now = timeutils.utcnow()
|
||||
services = db.service_get_all(ctxt)
|
||||
services = availability_zones.set_availability_zones(ctxt, services)
|
||||
if zone:
|
||||
services = [s for s in services if s['availability_zone'] == zone]
|
||||
hosts = []
|
||||
|
||||
Reference in New Issue
Block a user