From c78decaff7e1b648ea50da69115c098a7335e0eb Mon Sep 17 00:00:00 2001 From: johjuhyun Date: Sun, 20 Jan 2019 19:22:04 +0900 Subject: [PATCH] Heat templates doesn't support AZ for trove cluster Heat templates doesn't support Availability zone for trove cluster now (support for only single trove instance) Change-Id: If1df464df6248b46f59f3603177bc7fc45dc2755 Story: #2004821 Task: #28989 Signed-off-by: johjuhyun --- heat/engine/resources/openstack/trove/cluster.py | 12 ++++++++++-- ...plate-support-trove-cluster-996efba5dfb6f02d.yaml | 5 +++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/heat-template-support-trove-cluster-996efba5dfb6f02d.yaml diff --git a/heat/engine/resources/openstack/trove/cluster.py b/heat/engine/resources/openstack/trove/cluster.py index ced52fe309..8705cb6984 100644 --- a/heat/engine/resources/openstack/trove/cluster.py +++ b/heat/engine/resources/openstack/trove/cluster.py @@ -63,9 +63,9 @@ class TroveCluster(resource.Resource): ) _INSTANCE_KEYS = ( - FLAVOR, VOLUME_SIZE, NETWORKS, + FLAVOR, VOLUME_SIZE, NETWORKS, AVAILABILITY_ZONE, ) = ( - 'flavor', 'volume_size', 'networks', + 'flavor', 'volume_size', 'networks', 'availability_zone', ) _NICS_KEYS = ( @@ -169,6 +169,11 @@ class TroveCluster(resource.Resource): }, ), ), + AVAILABILITY_ZONE: properties.Schema( + properties.Schema.STRING, + _('Name of the availability zone for DB instance.'), + support_status=support.SupportStatus(version='14.0.0'), + ), } ) ), @@ -230,6 +235,9 @@ class TroveCluster(resource.Resource): instance_nics = self.get_instance_nics(instance) if instance_nics: instance_dict["nics"] = instance_nics + instance_availability_zone = instance[self.AVAILABILITY_ZONE] + if instance_availability_zone: + instance_dict["availability_zone"] = instance_availability_zone instances.append(instance_dict) args = { diff --git a/releasenotes/notes/heat-template-support-trove-cluster-996efba5dfb6f02d.yaml b/releasenotes/notes/heat-template-support-trove-cluster-996efba5dfb6f02d.yaml new file mode 100644 index 0000000000..96ab6b9433 --- /dev/null +++ b/releasenotes/notes/heat-template-support-trove-cluster-996efba5dfb6f02d.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The ``OS::Trove::Cluster`` resource type now supports specifying an + availability zone.