Merge "Set vnc to use controller virtual_ip"
[apex-tripleo-heat-templates.git] / nova-compute-instance.yaml
index 92e9a01..f8b5ebe 100644 (file)
-HeatTemplateFormatVersion: '2012-12-12'
-Description: 'Nova Compute'
-Parameters:
+heat_template_version: 2013-05-23
+description: 'Nova Compute'
+parameters:
   AdminPassword:
-    Default: unset
-    Description: The password for the keystone admin account, used for monitoring, querying neutron etc.
-    Type: String
-    NoEcho: true
-  KeyName: 
-    Description: Name of an existing EC2 KeyPair to enable SSH access to the instances
-    Type: String
-    Default: default
+    default: unset
+    description: The password for the keystone admin account, used for monitoring, querying neutron etc.
+    type: string
+    hidden: true
+  ExtraConfig:
+    description: |
+      Additional configuration to inject into the cluster. The JSON should have
+      the following structure:
+        {"FILEKEY":
+          {"config":
+            [{"section": "SECTIONNAME",
+              "values":
+                [{"option": "OPTIONNAME",
+                  "value": "VALUENAME"
+                 }
+                ]
+             }
+            ]
+          }
+        }
+      For instance:
+        {"nova":
+          {"config":
+            [{"section": "default",
+              "values":
+                [{"option": "compute_manager",
+                  "value": "ironic.nova.compute.manager.ClusterComputeManager"
+                 }
+                ]
+             },
+             {"section": "cells",
+              "values":
+                [{"option": "driver",
+                  "value": "nova.cells.rpc_driver.CellsRPCDriver"
+                 }
+                ]
+             }
+            ]
+          }
+        }
+    type: json
+  KeyName:
+    description: Name of an existing EC2 KeyPair to enable SSH access to the instances
+    type: string
+    default: default
   OvercloudComputeFlavor:
-    Description: Use this flavor
-    Type: String
-    Default: baremetal
+    description: Use this flavor
+    type: string
+    default: baremetal
   ImageUpdatePolicy:
-    Default: 'REBUILD_PRESERVE_EPHEMERAL'
-    Description: What policy to use when reconstructing instances. REBUILD for rebuilds, REBUILD_PRESERVE_EPHEMERAL to preserve /mnt.
-    Type: String
+    default: 'REBUILD_PRESERVE_EPHEMERAL'
+    description: What policy to use when reconstructing instances. REBUILD for rebuilds, REBUILD_PRESERVE_EPHEMERAL to preserve /mnt.
+    type: string
   NovaImage:
-    Type: String
-    Default: overcloud-compute
+    type: string
+    default: overcloud-compute
+  NtpServer:
+    type: string
+    default: ''
   KeystoneHost:
-    Type: String
+    type: string
   NeutronFlatNetworks:
-    Type: String
-    Default: ''
-    Description: If set, flat networks to configure in neutron plugins.
+    type: string
+    default: ''
+    description: If set, flat networks to configure in neutron plugins.
   NeutronHost:
-    Type: String
+    type: string
   NeutronPhysicalBridge:
-    Default: ''
-    Description: An OVS bridge to create for accessing external networks.
-    Type: String
+    default: ''
+    description: An OVS bridge to create for accessing external networks.
+    type: string
   NeutronPublicInterface:
-    Default: ''
-    Description: A port to add to the NeutronPhysicalBridge.
-    Type: String
+    default: ''
+    description: A port to add to the NeutronPhysicalBridge.
+    type: string
   RabbitHost:
-    Type: String
+    type: string
   RabbitUserName:
-    Type: String
+    type: string
   RabbitPassword:
-    Type: String
-    NoEcho: true
+    type: string
+    hidden: true
   CeilometerComputeAgent:
-    Description: Indicates whether the Compute agent is present and expects nova-compute to be configured accordingly
-    Type: String
-    Default: ''
-    AllowedValues: ['', Present]
+    description: Indicates whether the Compute agent is present and expects nova-compute to be configured accordingly
+    type: string
+    default: ''
+    constraints:
+    - allowed_values: ['', Present]
   CeilometerMeteringSecret:
-    Default: unset
-    Description: Secret shared by the ceilometer services.
-    Type: String
-    NoEcho: true
+    default: unset
+    description: Secret shared by the ceilometer services.
+    type: string
+    hidden: true
   CeilometerPassword:
-    Default: unset
-    Description: The password for the ceilometer service account.
-    Type: String
-    NoEcho: true
+    default: unset
+    description: The password for the ceilometer service account.
+    type: string
+    hidden: true
+  SnmpdReadonlyUserName:
+    default: ro_snmp_user
+    description: The user name for SNMPd with readonly rights running on all Overcloud nodes
+    type: string
+  SnmpdReadonlyUserPassword:
+    default: unset
+    description: The user password for SNMPd with readonly rights running on all Overcloud nodes
+    type: string
+    hidden: true
   NovaComputeDriver:
-    Type: String
-    Default: libvirt.LibvirtDriver
+    type: string
+    default: libvirt.LibvirtDriver
   NovaComputeLibvirtType:
-    Type: String
-    Default: ''
+    type: string
+    default: ''
   NovaApiHost:
-    Type: String
+    type: string
   NovaPassword:
-    Default: unset
-    Description: The password for the nova service account, used by nova-api.
-    Type: String
-    NoEcho: true
+    default: unset
+    description: The password for the nova service account, used by nova-api.
+    type: string
+    hidden: true
   GlanceHost:
-    Type: String
+    type: string
+  GlancePort:
+    default: 9292
+    description: Glance port.
+    type: string
+  GlanceProtocol:
+    default: http
+    description: Protocol to use when connecting to glance, set to https for SSL.
+    type: string
   CeilometerDSN:
-    Type: String
+    type: string
   NovaDSN:
-    Type: String
+    type: string
+  NovaPublicIP:
+    type: string
   NeutronDSN:
-    Type: String
+    type: string
   NeutronBridgeMappings:
-    Type: String
+    type: string
   NeutronNetworkVLANRanges:
-    Type: String
+    type: string
   NeutronNetworkType:
-    Type: String
+    type: string
   NeutronEnableTunnelling:
-    Type: String
-  StaticHosts:
-    Default: ''
-    Description: Static content to append to /etc/hosts
-    Type: String
+    type: string
+  AllNodesConfig:
+    type: string
+    description: OS::Heat::Config to use for all nodes deployment
   LiveUpdateUserName:
-    Type: String
-    Description: The live-update username for the undercloud Glance API.
-    Default: ''
+    type: string
+    description: The live-update username for the undercloud Glance API.
+    default: ''
   LiveUpdateTenantName:
-    Type: String
-    Description: The live-update tenant name for the undercloud Glance API.
-    Default: ''
+    type: string
+    description: The live-update tenant name for the undercloud Glance API.
+    default: ''
   LiveUpdateHost:
-    Type: String
-    Description: The IP address for the undercloud Glance API.
-    Default: ''
+    type: string
+    description: The IP address for the undercloud Glance API.
+    default: ''
   LiveUpdatePassword:
-    Type: String
-    Default: ''
-    Description: The live-update password for the undercloud Glance API.
-    NoEcho: true
+    type: string
+    default: ''
+    description: The live-update password for the undercloud Glance API.
+    hidden: true
   LiveUpdateComputeImage:
-    Type: String
-    Description: The image ID for live-updates to the overcloud compute nodes.
-    Default: ''
-Resources:
-  ComputeAccessPolicy:
-    Type: OS::Heat::AccessPolicy
-    Properties:
-      AllowedResources: [ NovaCompute0 ]
-  ComputeUser:
-    Type: AWS::IAM::User
-    Properties:
-      Policies: [ { Ref: ComputeAccessPolicy } ]
-  NovaCompute0Key:
-    Type: AWS::IAM::AccessKey
-    Properties:
-      UserName:
-        Ref: ComputeUser
-  NovaCompute0CompletionCondition:
-    Type: AWS::CloudFormation::WaitCondition
-    DependsOn: notCompute0Config
-    Properties:
-      Handle: {Ref: NovaCompute0CompletionHandle}
-      Count: '1'
-      Timeout: '1800'
-  NovaCompute0CompletionHandle:
-    Type: AWS::CloudFormation::WaitConditionHandle
+    type: string
+    description: The image ID for live-updates to the overcloud compute nodes.
+    default: ''
+  DefaultSignalTransport:
+    default: CFN_SIGNAL
+    description: Transport to use for software-config signals.
+    type: string
+    constraints:
+      - allowed_values: [ CFN_SIGNAL, HEAT_SIGNAL, NO_SIGNAL ]
+resources:
   NovaCompute0:
-    Type: OS::Nova::Server
-    Properties:
+    type: OS::Nova::Server
+    properties:
       image:
-        {Ref: NovaImage}
+        {get_param: NovaImage}
       image_update_policy:
-        Ref: ImageUpdatePolicy
-      flavor: {Ref: OvercloudComputeFlavor}
-      key_name: {Ref: KeyName}
-    Metadata:
-      os-collect-config:
-        cfn:
-          access_key_id:
-            Ref: NovaCompute0Key
-          secret_access_key:
-            Fn::GetAtt: [ NovaCompute0Key, SecretAccessKey ]
-          stack_name: {Ref: 'AWS::StackName'}
-          path: NovaCompute0Config.Metadata
-      OpenStack::ImageBuilder::Elements: [ nova-compute ]
-  NovaCompute0Config:
-    Type: AWS::AutoScaling::LaunchConfiguration
-    Properties:
-      InstanceType: '0'
-      ImageId: '0'
-    Metadata:
-      completion-handle:
-        Ref: NovaCompute0CompletionHandle
-      os-collect-config:
-        cfn:
-          access_key_id:
-            Ref: NovaCompute0Key
-          secret_access_key:
-            Fn::GetAtt: [ NovaCompute0Key, SecretAccessKey ]
-          stack_name: {Ref: 'AWS::StackName'}
-          path: NovaCompute0Config.Metadata
-      nova:
-        compute_driver: {Ref: NovaComputeDriver}
-        compute_libvirt_type: {Ref: NovaComputeLibvirtType}
-        db: {Ref: NovaDSN}
-        host: {Ref: NovaApiHost}
-        service-password:
-          Ref: NovaPassword
-      ceilometer:
-        db: {Ref: CeilometerDSN}
-        metering_secret: {Ref: CeilometerMeteringSecret}
-        service-password: {Ref: CeilometerPassword}
-        compute_agent: {Ref: CeilometerComputeAgent}
-      glance:
-        host: {Ref: GlanceHost}
-      hosts: {Ref: StaticHosts}
-      keystone:
-        host: {Ref: KeystoneHost}
-      neutron:
-        flat-networks: {Ref: NeutronFlatNetworks}
-        host: {Ref: NeutronHost}
-        ovs_db: {Ref: NeutronDSN}
-        ovs:
-          local_ip:
-            Fn::Select:
-              - 0
-              - Fn::Select:
-                - ctlplane
-                - Fn::GetAtt:
-                  - NovaCompute0
-                  - networks
-          tenant_network_type: {Ref: NeutronNetworkType}
-          network_vlan_ranges: {Ref: NeutronNetworkVLANRanges}
-          bridge_mappings: {Ref: NeutronBridgeMappings}
-          enable_tunneling: {Ref: NeutronEnableTunnelling}
-          physical_bridge: {Ref: NeutronPhysicalBridge}
-          public_interface: {Ref: NeutronPublicInterface}
-        service-password:
-          Ref: NeutronPassword
-      admin-password: {Ref: AdminPassword}
-      rabbit:
-        host: {Ref: RabbitHost}
-        username: {Ref: RabbitUserName}
-        password: {Ref: RabbitPassword}
-      live-update:
-        host: {Ref: LiveUpdateHost}
-        username: {Ref: LiveUpdateUserName}
-        password: {Ref: LiveUpdatePassword}
-        tenant-name: {Ref: LiveUpdateTenantName}
-        base_image_id: {Ref: NovaImage}
-        live_update_image_id: {Ref: LiveUpdateComputeImage}
+        get_param: ImageUpdatePolicy
+      flavor: {get_param: OvercloudComputeFlavor}
+      key_name: {get_param: KeyName}
+      networks:
+        - network: ctlplane
+      user_data_format: SOFTWARE_CONFIG
+  NovaCompute0Deployment:
+    depends_on: [controller0AllNodesDeployment]
+    type: OS::Heat::StructuredDeployment
+    properties:
+      signal_transport: NO_SIGNAL
+      config: {get_resource: NovaComputeConfig}
+      server: {get_resource: NovaCompute0}
+      input_values:
+        nova_compute_driver: {get_param: NovaComputeDriver}
+        nova_compute_libvirt_type: {get_param: NovaComputeLibvirtType}
+        nova_dsn: {get_param: NovaDSN}
+        nova_public_ip: {get_param: NovaPublicIP}
+        nova_api_host: {get_param: NovaApiHost}
+        nova_password: {get_param: NovaPassword}
+        ceilometer_dsn: {get_param: CeilometerDSN}
+        ceilometer_metering_secret: {get_param: CeilometerMeteringSecret}
+        ceilometer_password: {get_param: CeilometerPassword}
+        ceilometer_compute_agent: {get_param: CeilometerComputeAgent}
+        snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
+        snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
+        glance_host: {get_param: GlanceHost}
+        glance_port: {get_param: GlancePort}
+        glance_protocol: {get_param: GlanceProtocol}
+        keystone_host: {get_param: KeystoneHost}
+        neutron_flat_networks: {get_param: NeutronFlatNetworks}
+        neutron_host: {get_param: NeutronHost}
+        neutron_dsn: {get_param: NeutronDSN}
+        neutron_local_ip: {get_attr: [NovaCompute0, networks, ctlplane, 0]}
+        neutron_tenant_network_type: {get_param: NeutronNetworkType}
+        neutron_network_vlan_ranges: {get_param: NeutronNetworkVLANRanges}
+        neutron_bridge_mappings: {get_param: NeutronBridgeMappings}
+        neutron_enable_tunneling: {get_param: NeutronEnableTunnelling}
+        neutron_physical_bridge: {get_param: NeutronPhysicalBridge}
+        neutron_public_interface: {get_param: NeutronPublicInterface}
+        neutron_password: {get_param: NeutronPassword}
+        admin_password: {get_param: AdminPassword}
+        rabbit_host: {get_param: RabbitHost}
+        rabbit_username: {get_param: RabbitUserName}
+        rabbit_password: {get_param: RabbitPassword}
+        live_update_host: {get_param: LiveUpdateHost}
+        live_update_username: {get_param: LiveUpdateUserName}
+        live_update_password: {get_param: LiveUpdatePassword}
+        live_update_tenant_name: {get_param: LiveUpdateTenantName}
+        nova_image: {get_param: NovaImage}
+        live_update_image_id: {get_param: LiveUpdateComputeImage}
+        ntp_server: {get_param: NtpServer}
+  NovaCompute0AllNodesDeployment:
+    depends_on: [NovaCompute0Passthrough]
+    type: OS::Heat::StructuredDeployment
+    properties:
+      signal_transport: {get_param: DefaultSignalTransport}
+      config: {get_param: AllNodesConfig}
+      server: {get_resource: NovaCompute0}
+  NovaCompute0Passthrough:
+    depends_on: [NovaCompute0Deployment]
+    type: OS::Heat::StructuredDeployment
+    properties:
+      config: {get_resource: NovaComputePassthrough}
+      server: {get_resource: NovaCompute0}
+      signal_transport: NO_SIGNAL
+      input_values:
+        passthrough_config: {get_param: ExtraConfig}