Make it possible to do physical networks for VMs.
[apex-tripleo-heat-templates.git] / nova-compute-instance.yaml
1 HeatTemplateFormatVersion: '2012-12-12'
2 Description: 'Nova Compute'
3 Parameters:
4   AdminPassword:
5     Default: unset
6     Description: The password for the keystone admin account, used for monitoring, querying neutron etc.
7     Type: String
8     NoEcho: true
9   KeyName: 
10     Description: Name of an existing EC2 KeyPair to enable SSH access to the instances
11     Type: String
12     Default: default
13   Flavor:
14     Description: Use this flavor
15     Type: String
16     Default: baremetal
17   ImageUpdatePolicy:
18     Default: 'REPLACE'
19     Description: What policy to use when reconstructing instances. REBUILD for rebuilds, REBUILD_PRESERVE_EPHEMERAL to preserve /mnt.
20     Type: String
21   NovaImage:
22     Type: String
23     Default: overcloud-compute
24   KeystoneHost:
25     Type: String
26   NeutronFlatNetworks:
27     Type: String
28     Default: ''
29     Description: If set, flat networks to configure in neutron plugins.
30   NeutronHost:
31     Type: String
32   NeutronPhysicalBridge:
33     Default: ''
34     Description: An OVS bridge to create for accessing external networks.
35     Type: String
36   NeutronPublicInterface:
37     Default: ''
38     Description: A port to add to the NeutronPhysicalBridge.
39     Type: String
40   RabbitHost:
41     Type: String
42   RabbitPassword:
43     Type: String
44     NoEcho: true
45   CeilometerComputeAgent:
46     Description: Indicates whether the Compute agent is present and expects nova-compute to be configured accordingly
47     Type: String
48     Default: ''
49     AllowedValues: ['', Present]
50   CeilometerMeteringSecret:
51     Default: unset
52     Description: Secret shared by the ceilometer services.
53     Type: String
54     NoEcho: true
55   CeilometerPassword:
56     Default: unset
57     Description: The password for the ceilometer service account.
58     Type: String
59     NoEcho: true
60   NovaComputeDriver:
61     Type: String
62     Default: libvirt.LibvirtDriver
63   NovaComputeLibvirtType:
64     Type: String
65     Default: ''
66   NovaApiHost:
67     Type: String
68   NovaPassword:
69     Default: unset
70     Description: The password for the nova service account, used by nova-api.
71     Type: String
72     NoEcho: true
73   GlanceHost:
74     Type: String
75   CeilometerDSN:
76     Type: String
77   NovaDSN:
78     Type: String
79   NeutronDSN:
80     Type: String
81   NeutronBridgeMappings:
82     Type: String
83   NeutronNetworkVLANRanges:
84     Type: String
85   NeutronNetworkType:
86     Type: String
87   NeutronEnableTunnelling:
88     Type: String
89 Resources:
90   ComputeAccessPolicy:
91     Type: OS::Heat::AccessPolicy
92     Properties:
93       AllowedResources: [ NovaCompute0 ]
94   ComputeUser:
95     Type: AWS::IAM::User
96     Properties:
97       Policies: [ { Ref: ComputeAccessPolicy } ]
98   NovaCompute0Key:
99     Type: AWS::IAM::AccessKey
100     Properties:
101       UserName:
102         Ref: ComputeUser
103   NovaCompute0CompletionCondition:
104     Type: AWS::CloudFormation::WaitCondition
105     DependsOn: notCompute0
106     Properties:
107       Handle: {Ref: NovaCompute0CompletionHandle}
108       Count: '1'
109       Timeout: '1800'
110   NovaCompute0CompletionHandle:
111     Type: AWS::CloudFormation::WaitConditionHandle
112   NovaCompute0:
113     Type: OS::Nova::Server
114     Properties:
115       image:
116         {Ref: NovaImage}
117       image_update_policy:
118         Ref: ImageUpdatePolicy
119       flavor: {Ref: Flavor}
120       key_name: {Ref: KeyName}
121     Metadata:
122       os-collect-config:
123         cfn:
124           access_key_id:
125             Ref: NovaCompute0Key
126           secret_access_key:
127             Fn::GetAtt: [ NovaCompute0Key, SecretAccessKey ]
128           stack_name: {Ref: 'AWS::StackName'}
129           path: NovaCompute0Config.Metadata
130       OpenStack::ImageBuilder::Elements: [ nova-compute ]
131   NovaCompute0Config:
132     Type: AWS::AutoScaling::LaunchConfiguration
133     Properties:
134       InstanceType: '0'
135       ImageId: '0'
136     Metadata:
137       completion-handle:
138         Ref: NovaCompute0CompletionHandle
139       os-collect-config:
140         cfn:
141           access_key_id:
142             Ref: NovaCompute0Key
143           secret_access_key:
144             Fn::GetAtt: [ NovaCompute0Key, SecretAccessKey ]
145           stack_name: {Ref: 'AWS::StackName'}
146           path: NovaCompute0Config.Metadata
147       nova:
148         compute_driver: {Ref: NovaComputeDriver}
149         compute_libvirt_type: {Ref: NovaComputeLibvirtType}
150         db: {Ref: NovaDSN}
151         host: {Ref: NovaApiHost}
152         service-password:
153           Ref: NovaPassword
154       ceilometer:
155         db: {Ref: CeilometerDSN}
156         metering_secret: {Ref: CeilometerMeteringSecret}
157         service-password: {Ref: CeilometerPassword}
158         compute_agent: {Ref: CeilometerComputeAgent}
159       glance:
160         host: {Ref: GlanceHost}
161       keystone:
162         host: {Ref: KeystoneHost}
163       neutron:
164         flat-networks: {Ref: NeutronFlatNetworks}
165         host: {Ref: NeutronHost}
166         ovs_db: {Ref: NeutronDSN}
167         ovs:
168           local_ip:
169             Fn::Select:
170               - 0
171               - Fn::Select:
172                 - ctlplane
173                 - Fn::GetAtt:
174                   - NovaCompute0
175                   - networks
176           tenant_network_type: {Ref: NeutronNetworkType}
177           network_vlan_ranges: {Ref: NeutronNetworkVLANRanges}
178           bridge_mappings: {Ref: NeutronBridgeMappings}
179           enable_tunneling: {Ref: NeutronEnableTunnelling}
180           physical_bridge: {Ref: NeutronPhysicalBridge}
181           public_interface: {Ref: NeutronPublicInterface}
182         service-password:
183           Ref: NeutronPassword
184       admin-password: {Ref: AdminPassword}
185       rabbit:
186         host: {Ref: RabbitHost}
187         password: {Ref: RabbitPassword}