From 30e6879d8139e13fc70b0d1c8ef13d7ee03ca5c3 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Tue, 21 Aug 2012 11:16:02 -0400 Subject: add availability_zone to openstack metadata This adds the key 'availability_zone' to the metadata for openstack. 'availability-zone' in EC2 is very useful to the instance to figure out where it is. For example, Ubuntu uses this information to determine mirror location on EC2. Fixes bug 1039579. Change-Id: I212d3854b75e08a67138b5cd0bea178c47840e11 --- nova/api/metadata/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nova/api/metadata/base.py b/nova/api/metadata/base.py index d9710dc37..24bdb592f 100644 --- a/nova/api/metadata/base.py +++ b/nova/api/metadata/base.py @@ -294,6 +294,7 @@ class InstanceMetadata(): FLAGS.dhcp_domain) metadata['name'] = self.instance['display_name'] + metadata['availability_zone'] = self.availability_zone data = { MD_JSON_NAME: json.dumps(metadata), -- cgit