Currently OS API doesn't accept availability zone parameter so there is no way to instruct scheduler (SimpleScheduler) to launch VM instance on specific host of specified zone.

Now changes have been made in the create_instance_helper to read the availability zone and pass it to the compute create API. Any OS extensions can take a advantage of it.
Also changes have been made in the nova-manage ServiceCommands class to expose zone information to the admin users. Only admin users will be allowed to launch VM instance on specific host.
This commit is contained in:
Tushar Patil
2011-08-14 03:34:19 +00:00
committed by Tarmac

View File

@@ -882,6 +882,14 @@ class ServiceCommands(object):
services = [s for s in services if s['host'] == host]
if service:
services = [s for s in services if s['binary'] == service]
print_format = "%-16s %-36s %-16s %-10s %-5s %-10s"
print print_format % (
_('Binary'),
_('Host'),
_('Zone'),
_('Status'),
_('State'),
_('Updated_At'))
for svc in services:
delta = now - (svc['updated_at'] or svc['created_at'])
alive = (delta.seconds <= 15)
@@ -889,8 +897,8 @@ class ServiceCommands(object):
active = 'enabled'
if svc['disabled']:
active = 'disabled'
print "%-10s %-10s %-8s %s %s" % (svc['host'], svc['binary'],
active, art,
print print_format % (svc['binary'], svc['host'],
svc['availability_zone'], active, art,
svc['updated_at'])
@args('--host', dest='host', metavar='<host>', help='Host')