From a0b3cc09d0cbb3f34c457cd118c90c89c7a9a039 Mon Sep 17 00:00:00 2001 From: Sergey Galkin Date: Mon, 22 Jun 2020 15:07:13 +0400 Subject: [PATCH] Fix heat stacks with ports Change-Id: I3b9ed6a7789c3dc9f9836720756bc9c1093a1b9b Closes-Bug: 1884523 --- .../templates/autoscaling-group.yaml.template | 16 ++++++++++++++++ .../templates/server-with-volume.yaml.template | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/samples/tasks/scenarios/heat/templates/autoscaling-group.yaml.template b/samples/tasks/scenarios/heat/templates/autoscaling-group.yaml.template index 6c9892b4..9ce79960 100644 --- a/samples/tasks/scenarios/heat/templates/autoscaling-group.yaml.template +++ b/samples/tasks/scenarios/heat/templates/autoscaling-group.yaml.template @@ -19,6 +19,9 @@ parameters: default: 5 constraints: - range: {min: 1} + cidr: + type: string + default: 11.11.11.0/24 resources: @@ -30,6 +33,19 @@ resources: properties: image: { get_param: image } flavor: { get_param: flavor } + networks: + - port: { get_resource: server_port } + server_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: private_net} + private_net: + type: OS::Neutron::Net + private_subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: private_net } + cidr: {get_param: cidr} min_size: 1 desired_capacity: 3 max_size: { get_param: max_size } diff --git a/samples/tasks/scenarios/heat/templates/server-with-volume.yaml.template b/samples/tasks/scenarios/heat/templates/server-with-volume.yaml.template index 6e65cec7..e0bcfe30 100644 --- a/samples/tasks/scenarios/heat/templates/server-with-volume.yaml.template +++ b/samples/tasks/scenarios/heat/templates/server-with-volume.yaml.template @@ -19,6 +19,9 @@ parameters: constraints: - range: { min: 1, max: 1024 } description: must be between 1 and 1024 Gb. + cidr: + type: string + default: 11.11.11.0/24 resources: server: @@ -26,6 +29,19 @@ resources: properties: image: {get_param: image} flavor: {get_param: flavor} + networks: + - port: { get_resource: server_port } + server_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: private_net} + private_net: + type: OS::Neutron::Net + private_subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: private_net } + cidr: {get_param: cidr} cinder_volume: type: OS::Cinder::Volume properties: