Merge "Improves Heat Demo Functionality"

This commit is contained in:
Jenkins 2015-05-13 12:56:16 +00:00 committed by Gerrit Code Review
commit abe4a9ccb2
4 changed files with 47 additions and 3 deletions

13
demos/heat/README.md Normal file
View File

@ -0,0 +1,13 @@
A Kolla Demo using Heat
=======================
By default, the launch script will spawn 3 Nova instances on a
Neutron network created from the tools/init-runonce script. Edit
the VM_COUNT parameter in the launch script if you would like to
spawn a different amount of Nova instances. Edit the IMAGE_FLAVOR
if you would like to launch images using a flavor other than
m1.tiny.
Then run the script:
$ ./launch

View File

@ -1,3 +1,5 @@
VM_COUNT=3
IMAGE_FLAVOR=m1.small
PUBLIC_NET_ID=$(neutron net-list | grep public | awk '{print $2}')
DEMO_NET_ID=$(neutron net-list | grep demo | awk '{print $2}')
DEMO_SUBNET_ID=$(neutron net-list | grep demo | awk '{print $6}')
@ -6,4 +8,4 @@ echo Public net id is $PUBLIC_NET_ID
echo Demo net id is $DEMO_NET_ID
echo Demo subnet id is $DEMO_SUBNET_ID
heat stack-create steak --template-file steak-rg.yaml --parameters="public_net_id=$PUBLIC_NET_ID;demo_net_id=$DEMO_NET_ID;demo_subnet_id=$DEMO_SUBNET_ID"
heat stack-create steak --template-file steak-rg.yaml --parameters="vm_count=$VM_COUNT;image_flavor=$IMAGE_FLAVOR;public_net_id=$PUBLIC_NET_ID;demo_net_id=$DEMO_NET_ID;demo_subnet_id=$DEMO_SUBNET_ID"

View File

@ -13,14 +13,31 @@ parameters:
type: string
description: uuid of a subnet on the fixed network to use for creating ports
vm_count:
type: string
description: Number of VMs to launch
image_flavor:
type: string
description: Image flavor to use when launching VMs
resources:
steak:
type: OS::Heat::ResourceGroup
properties:
count: 2
count:
get_param: vm_count
resource_def:
type: steak.yaml
properties:
image_flavor: {get_param: image_flavor}
public_net_id: {get_param: public_net_id}
demo_net_id: {get_param: demo_net_id}
demo_subnet_id: {get_param: demo_subnet_id}
outputs:
eth0:
value: {get_attr: [steak, eth0]}
float:
value: {get_attr: [steak, float]}

View File

@ -13,13 +13,18 @@ parameters:
type: string
description: uuid of a subnet on the fixed network to use for creating ports
image_flavor:
type: string
description: Number of VMs to launch
resources:
steak_node:
type: "OS::Nova::Server"
properties:
key_name: mykey
image: cirros
flavor: m1.small
flavor:
get_param: image_flavor
networks:
- port:
get_resource: steak_node_eth0
@ -40,3 +45,10 @@ resources:
get_param: public_net_id
port_id:
get_resource: steak_node_eth0
outputs:
eth0:
value: {get_attr: [steak_node_eth0, fixed_ips, 0, ip_address]}
float:
value: {get_attr: [steak_node_floating, floating_ip_address]}