Update overcloud to support N compute hosts.
[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   NeutronHost:
27     Type: String
28   RabbitHost:
29     Type: String
30   RabbitPassword:
31     Type: String
32     NoEcho: true
33   CeilometerComputeAgent:
34     Description: Indicates whether the Compute agent is present and expects nova-compute to be configured accordingly
35     Type: String
36     Default: ''
37     AllowedValues: ['', Present]
38   CeilometerMeteringSecret:
39     Default: unset
40     Description: Secret shared by the ceilometer services.
41     Type: String
42     NoEcho: true
43   CeilometerPassword:
44     Default: unset
45     Description: The password for the ceilometer service account.
46     Type: String
47     NoEcho: true
48   NovaComputeDriver:
49     Type: String
50     Default: libvirt.LibvirtDriver
51   NovaComputeLibvirtType:
52     Type: String
53     Default: ''
54   NovaApiHost:
55     Type: String
56   NovaPassword:
57     Default: unset
58     Description: The password for the nova service account, used by nova-api.
59     Type: String
60     NoEcho: true
61   GlanceHost:
62     Type: String
63   CeilometerDSN:
64     Type: String
65   NovaDSN:
66     Type: String
67   NeutronDSN:
68     Type: String
69   NeutronBridgeMappings:
70     Type: String
71   NeutronNetworkVLANRanges:
72     Type: String
73   NeutronNetworkType:
74     Type: String
75   NeutronEnableTunnelling:
76     Type: String
77 Resources:
78   ComputeAccessPolicy:
79     Type: OS::Heat::AccessPolicy
80     Properties:
81       AllowedResources: [ NovaCompute0 ]
82   ComputeUser:
83     Type: AWS::IAM::User
84     Properties:
85       Policies: [ { Ref: ComputeAccessPolicy } ]
86   NovaCompute0Key:
87     Type: AWS::IAM::AccessKey
88     Properties:
89       UserName:
90         Ref: ComputeUser
91   NovaCompute0CompletionCondition:
92     Type: AWS::CloudFormation::WaitCondition
93     DependsOn: notcompute
94     Properties:
95       Handle: {Ref: NovaCompute0CompletionHandle}
96       Count: '1'
97       Timeout: '1800'
98   NovaCompute0CompletionHandle:
99     Type: AWS::CloudFormation::WaitConditionHandle
100   NovaCompute0:
101     Type: OS::Nova::Server
102     Properties:
103       image:
104         {Ref: NovaImage}
105       image_update_policy:
106         Ref: ImageUpdatePolicy
107       flavor: {Ref: Flavor}
108       key_name: {Ref: KeyName}
109     Metadata:
110       os-collect-config:
111         cfn:
112           access_key_id:
113             Ref: NovaCompute0Key
114           secret_access_key:
115             Fn::GetAtt: [ NovaCompute0Key, SecretAccessKey ]
116           stack_name: {Ref: 'AWS::StackName'}
117           path: NovaCompute0Config.Metadata
118       OpenStack::ImageBuilder::Elements: [ nova-compute ]
119   NovaCompute0Config:
120     Type: AWS::AutoScaling::LaunchConfiguration
121     Properties:
122       InstanceType: '0'
123       ImageId: '0'
124     Metadata:
125       completion-handle:
126         Ref: NovaCompute0CompletionHandle
127       os-collect-config:
128         cfn:
129           access_key_id:
130             Ref: NovaCompute0Key
131           secret_access_key:
132             Fn::GetAtt: [ NovaCompute0Key, SecretAccessKey ]
133           stack_name: {Ref: 'AWS::StackName'}
134           path: NovaCompute0Config.Metadata
135       nova:
136         compute_driver: {Ref: NovaComputeDriver}
137         compute_libvirt_type: {Ref: NovaComputeLibvirtType}
138         db: {Ref: NovaDSN}
139         host: {Ref: NovaApiHost}
140         service-password:
141           Ref: NovaPassword
142       ceilometer:
143         db: {Ref: CeilometerDSN}
144         metering_secret: {Ref: CeilometerMeteringSecret}
145         service-password: {Ref: CeilometerPassword}
146         compute_agent: {Ref: CeilometerComputeAgent}
147       glance:
148         host: {Ref: GlanceHost}
149       keystone:
150         host: {Ref: KeystoneHost}
151       neutron:
152         host: {Ref: NeutronHost}
153         ovs_db: {Ref: NeutronDSN}
154         ovs:
155           local_ip:
156             Fn::Select:
157               - 0
158               - Fn::Select:
159                 - ctlplane
160                 - Fn::GetAtt:
161                   - NovaCompute0
162                   - networks
163           tenant_network_type: {Ref: NeutronNetworkType}
164           network_vlan_ranges: {Ref: NeutronNetworkVLANRanges}
165           bridge_mappings: {Ref: NeutronBridgeMappings}
166           enable_tunneling: {Ref: NeutronEnableTunnelling}
167         service-password:
168           Ref: NeutronPassword
169       admin-password: {Ref: AdminPassword}
170       rabbit:
171         host: {Ref: RabbitHost}
172         password: {Ref: RabbitPassword}