summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTushar Patil <tushar.vitthal.patil@gmail.com>2011-08-11 11:15:14 -0700
committerTushar Patil <tushar.vitthal.patil@gmail.com>2011-08-11 11:15:14 -0700
commit2ccec88a5a5c85ce7776b4b70d490189d63d3098 (patch)
tree797df54b83aca16d2971f718b0047cdf86622ef2
parentb9c2aad3eca2cc397f96682907a0c4e8c7b6005b (diff)
Added availability zone support to the Create Server API
-rwxr-xr-xbin/nova-manage14
-rw-r--r--nova/api/openstack/create_instance_helper.py4
2 files changed, 14 insertions, 4 deletions
diff --git a/bin/nova-manage b/bin/nova-manage
index 077a89d6f..02591a49c 100755
--- a/bin/nova-manage
+++ b/bin/nova-manage
@@ -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,9 +897,9 @@ class ServiceCommands(object):
active = 'enabled'
if svc['disabled']:
active = 'disabled'
- print "%-10s %-10s %-8s %s %s" % (svc['host'], svc['binary'],
- active, art,
- svc['updated_at'])
+ print print_format % (svc['binary'], svc['host'],
+ svc['availability_zone'], active, art,
+ svc['updated_at'])
@args('--host', dest='host', metavar='<host>', help='Host')
@args('--service', dest='service', metavar='<service>',
diff --git a/nova/api/openstack/create_instance_helper.py b/nova/api/openstack/create_instance_helper.py
index 1425521a9..4e1da549e 100644
--- a/nova/api/openstack/create_instance_helper.py
+++ b/nova/api/openstack/create_instance_helper.py
@@ -122,6 +122,7 @@ class CreateInstanceHelper(object):
raise exc.HTTPBadRequest(explanation=msg)
zone_blob = server_dict.get('blob')
+ availability_zone = server_dict.get('availability_zone')
name = server_dict['name']
self._validate_server_name(name)
name = name.strip()
@@ -161,7 +162,8 @@ class CreateInstanceHelper(object):
zone_blob=zone_blob,
reservation_id=reservation_id,
min_count=min_count,
- max_count=max_count))
+ max_count=max_count,
+ availability_zone=availability_zone))
except quota.QuotaError as error:
self._handle_quota_error(error)
except exception.ImageNotFound as error: