Stop using notCompute in favor of controller
[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   OvercloudComputeFlavor:
14     Description: Use this flavor
15     Type: String
16     Default: baremetal
17   ImageUpdatePolicy:
18     Default: 'REBUILD_PRESERVE_EPHEMERAL'
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   RabbitUserName:
43     Type: String
44   RabbitPassword:
45     Type: String
46     NoEcho: true
47   CeilometerComputeAgent:
48     Description: Indicates whether the Compute agent is present and expects nova-compute to be configured accordingly
49     Type: String
50     Default: ''
51     AllowedValues: ['', Present]
52   CeilometerMeteringSecret:
53     Default: unset
54     Description: Secret shared by the ceilometer services.
55     Type: String
56     NoEcho: true
57   CeilometerPassword:
58     Default: unset
59     Description: The password for the ceilometer service account.
60     Type: String
61     NoEcho: true
62   NovaComputeDriver:
63     Type: String
64     Default: libvirt.LibvirtDriver
65   NovaComputeLibvirtType:
66     Type: String
67     Default: ''
68   NovaApiHost:
69     Type: String
70   NovaPassword:
71     Default: unset
72     Description: The password for the nova service account, used by nova-api.
73     Type: String
74     NoEcho: true
75   GlanceHost:
76     Type: String
77   CeilometerDSN:
78     Type: String
79   NovaDSN:
80     Type: String
81   NeutronDSN:
82     Type: String
83   NeutronBridgeMappings:
84     Type: String
85   NeutronNetworkVLANRanges:
86     Type: String
87   NeutronNetworkType:
88     Type: String
89   NeutronEnableTunnelling:
90     Type: String
91   StaticHosts:
92     Default: ''
93     Description: Static content to append to /etc/hosts
94     Type: String
95   LiveUpdateUserName:
96     Type: String
97     Description: The live-update username for the undercloud Glance API.
98     Default: ''
99   LiveUpdateTenantName:
100     Type: String
101     Description: The live-update tenant name for the undercloud Glance API.
102     Default: ''
103   LiveUpdateHost:
104     Type: String
105     Description: The IP address for the undercloud Glance API.
106     Default: ''
107   LiveUpdatePassword:
108     Type: String
109     Default: ''
110     Description: The live-update password for the undercloud Glance API.
111     NoEcho: true
112   LiveUpdateComputeImage:
113     Type: String
114     Description: The image ID for live-updates to the overcloud compute nodes.
115     Default: ''
116 Resources:
117   ComputeAccessPolicy:
118     Type: OS::Heat::AccessPolicy
119     Properties:
120       AllowedResources: [ NovaCompute0 ]
121   ComputeUser:
122     Type: AWS::IAM::User
123     Properties:
124       Policies: [ { Ref: ComputeAccessPolicy } ]
125   NovaCompute0Key:
126     Type: AWS::IAM::AccessKey
127     Properties:
128       UserName:
129         Ref: ComputeUser
130   NovaCompute0CompletionCondition:
131     Type: AWS::CloudFormation::WaitCondition
132     DependsOn: controller0Config
133     Properties:
134       Handle: {Ref: NovaCompute0CompletionHandle}
135       Count: '1'
136       Timeout: '1800'
137   NovaCompute0CompletionHandle:
138     Type: AWS::CloudFormation::WaitConditionHandle
139   NovaCompute0:
140     Type: OS::Nova::Server
141     Properties:
142       image:
143         {Ref: NovaImage}
144       image_update_policy:
145         Ref: ImageUpdatePolicy
146       flavor: {Ref: OvercloudComputeFlavor}
147       key_name: {Ref: KeyName}
148     Metadata:
149       os-collect-config:
150         cfn:
151           access_key_id:
152             Ref: NovaCompute0Key
153           secret_access_key:
154             Fn::GetAtt: [ NovaCompute0Key, SecretAccessKey ]
155           stack_name: {Ref: 'AWS::StackName'}
156           path: NovaCompute0Config.Metadata
157       OpenStack::ImageBuilder::Elements: [ nova-compute ]
158   NovaCompute0Config:
159     Type: AWS::AutoScaling::LaunchConfiguration
160     Properties:
161       InstanceType: '0'
162       ImageId: '0'
163     Metadata:
164       completion-handle:
165         Ref: NovaCompute0CompletionHandle
166       os-collect-config:
167         cfn:
168           access_key_id:
169             Ref: NovaCompute0Key
170           secret_access_key:
171             Fn::GetAtt: [ NovaCompute0Key, SecretAccessKey ]
172           stack_name: {Ref: 'AWS::StackName'}
173           path: NovaCompute0Config.Metadata
174       nova:
175         compute_driver: {Ref: NovaComputeDriver}
176         compute_libvirt_type: {Ref: NovaComputeLibvirtType}
177         db: {Ref: NovaDSN}
178         host: {Ref: NovaApiHost}
179         service-password:
180           Ref: NovaPassword
181       ceilometer:
182         db: {Ref: CeilometerDSN}
183         metering_secret: {Ref: CeilometerMeteringSecret}
184         service-password: {Ref: CeilometerPassword}
185         compute_agent: {Ref: CeilometerComputeAgent}
186       glance:
187         host: {Ref: GlanceHost}
188       hosts: {Ref: StaticHosts}
189       keystone:
190         host: {Ref: KeystoneHost}
191       neutron:
192         flat-networks: {Ref: NeutronFlatNetworks}
193         host: {Ref: NeutronHost}
194         ovs_db: {Ref: NeutronDSN}
195         ovs:
196           local_ip:
197             Fn::Select:
198               - 0
199               - Fn::Select:
200                 - ctlplane
201                 - Fn::GetAtt:
202                   - NovaCompute0
203                   - networks
204           tenant_network_type: {Ref: NeutronNetworkType}
205           network_vlan_ranges: {Ref: NeutronNetworkVLANRanges}
206           bridge_mappings: {Ref: NeutronBridgeMappings}
207           enable_tunneling: {Ref: NeutronEnableTunnelling}
208           physical_bridge: {Ref: NeutronPhysicalBridge}
209           public_interface: {Ref: NeutronPublicInterface}
210         service-password:
211           Ref: NeutronPassword
212       admin-password: {Ref: AdminPassword}
213       rabbit:
214         host: {Ref: RabbitHost}
215         username: {Ref: RabbitUserName}
216         password: {Ref: RabbitPassword}
217       live-update:
218         host: {Ref: LiveUpdateHost}
219         username: {Ref: LiveUpdateUserName}
220         password: {Ref: LiveUpdatePassword}
221         tenant-name: {Ref: LiveUpdateTenantName}
222         base_image_id: {Ref: NovaImage}
223         live_update_image_id: {Ref: LiveUpdateComputeImage}