Added method to return OpenStackVmInstance from Heat.
[snaps.git] / snaps / openstack / tests / heat / test_heat_template.yaml
1 ##############################################################################
2 # Copyright (c) 2017 Cable Television Laboratories, Inc. ("CableLabs")
3 #                    and others.  All rights reserved.
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at:
8 #
9 #     http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 ##############################################################################
17 heat_template_version: 2015-04-30
18
19 description: Simple template to deploy a single compute instance
20
21 parameters:
22   image_name:
23     type: string
24     label: Image ID
25     description: Image to be used for compute instance
26     default: heat_utils_tests
27   flavor_name:
28     type: string
29     label: Instance Type
30     description: Type of instance (flavor) to be used
31     default: m1.small
32   net_name:
33     type: string
34     label: Test network name
35     description: The name of the stack's network
36     default: test_net
37   subnet_name:
38     type: string
39     label: Test subnet name
40     description: The name of the stack's subnet
41     default: test_subnet
42   inst_name:
43     type: string
44     label: Test VM name
45     description: The name of the spawned vm
46     default: test_vm
47
48 resources:
49   private_net:
50     type: OS::Neutron::Net
51     properties:
52       name: { get_param: net_name }
53
54   private_subnet:
55     type: OS::Neutron::Subnet
56     properties:
57       name: { get_param: subnet_name }
58       network_id: { get_resource: private_net }
59       cidr: 10.0.0.0/24
60
61   server1_port:
62     type: OS::Neutron::Port
63     properties:
64       network_id: { get_resource: private_net }
65       fixed_ips:
66         - subnet_id: { get_resource: private_subnet }
67
68   my_instance:
69     type: OS::Nova::Server
70     properties:
71       name: { get_param: inst_name }
72       image: { get_param: image_name }
73       flavor: { get_param: flavor_name }
74       networks:
75         - port: { get_resource: server1_port }