UPDATE 04/20/2016
Follow http://blog.oddbit.com/2013/12/06/an-...
Fist template ubuntu1510.yml
heat_template_version: 2016-04-08
parameters:
key_name:
type: string
default: oskeymitaka0420
description: oskeymitaka0420
flavor:
type: string
description: Instance type for the instance to be created
default: m1.small
constraints:
- allowed_values: [m1.nano, m1.tiny, m1.small, m1.large]
description: Value must be one of 'm1.tiny', 'm1.small' or 'm1.large'
image:
type: string
default: cirros
description: ID or name of the image to use for the instance
private_net_id:
type: string
description: Private network id
private_subnet_id:
type: string
description: Private subnet id
public_net_id:
type: string
description: Public network id
resources:
instance1:
type: OS::Nova::Server
properties:
name: instance1
image: { get_param: image }
flavor: { get_param: flavor }
key_name: { get_param: key_name }
networks:
- port: { get_resource: instance1_port0 }
instance1_port0:
type: OS::Neutron::Port
properties:
network_id: { get_param: private_net_id }
security_groups:
- default
fixed_ips:
- subnet_id: { get_param: private_subnet_id }
instance1_public:
type: OS::Neutron::FloatingIP
properties:
floating_network_id: { get_param: public_net_id }
port_id: { get_resource: instance1_port0 }
outputs:
instance1_private_ip:
description: IP address of instance1 in private network
value: { get_attr: [ instance1, first_address ] }
instance1_public_ip:
description: Floating IP address of instance1 in public network
value: { get_attr: [ instance1_public, floating_ip_address ] }
Second environment1.yml
parameters:
image: Ubuntu1510Cloud-image
flavor: m1.small
private_net_id: 292a2f21-70af-48ef-b100-c0639a8ffb22
private_subnet_id: d7aa6f0f-33ba-430d-a409-bd673bed7060
public_net_id: 43daa7c3-4e04-4661-8e78-6634b06d63f3
Now run :-
[root@ip-192-169-142-54 ~(keystone_demo)]# heat stack-create -f ubuntu1510.yml -e environment1.yml ubuntustack
+--------------------------------------+-------------+--------------------+---------------------+--------------+
| id | stack_name | stack_status | creation_time | updated_time |
+--------------------------------------+-------------+--------------------+---------------------+--------------+
| 3d1f8d4b-5251-4ba6-921f-66c46e3e32e5 | mystack | CREATE_COMPLETE | 2016-04-20T15:58:29 | None |
| 0c2b848c-4674-40f6-bf18-8f3ec84d796f | ubuntustack | CREATE_IN_PROGRESS | 2016-04-20T16:11:05 | None |
+--------------------------------------+-------------+--------------------+---------------------+--------------+
[root@ip-192-169-142-54 ~(keystone_demo)]# heat stack-list
+--------------------------------------+-------------+-----------------+---------------------+--------------+
| id | stack_name | stack_status | creation_time | updated_time |
+--------------------------------------+-------------+-----------------+---------------------+--------------+
| 3d1f8d4b-5251-4ba6-921f-66c46e3e32e5 | mystack | CREATE_COMPLETE | 2016-04-20T15:58:29 | None |
| 0c2b848c-4674-40f6-bf18-8f3ec84d796f | ubuntustack | CREATE_COMPLETE | 2016-04-20T16:11:05 | None |
+--------------------------------------+-------------+-----------------+---------------------+--
Verify IPs :-
[root@ip-192-169-142-54 ~(keystone_demo)]# heat stack-show ubuntustack | grep output
| outputs | [ |
| | "output_value": "50.0.0.12", |
| | "output_key": "instance1_private_ip", |
| | "output_value": "192.169.142.152", |
| | "output_key": "instance1_public_ip",
END UPDATE
Attempt to follow http://blog.oddbit.com/2013/12/06/an-...
Create sections
parameters:
resources:
outputs:
in template.yml
Create environment.yml as a kind of :-
parameters:
image: fedora-23-x86_64
flavor: m1.small
private_net_id: 99ab8ebf-ad2f-4a4b-9890-fee37cea4254
private_subnet_id: ed8ad5f5-4c47-4204-9ca3-1b3bc4de286d
public_net_id: 7e687cc3-8155-4ec2-bd11-ba741ecbf4f0
Then attempt :-
heat stack-create -f template.yml \
-e environment.yml mystack