Compute all hosts matrix once
authorClint Byrum <clint@fewbar.com>
Wed, 4 Jun 2014 07:42:29 +0000 (00:42 -0700)
committerTomas Sedovic <tsedovic@redhat.com>
Mon, 30 Jun 2014 10:28:57 +0000 (12:28 +0200)
Then feed in through separate deployments. This reduces the exponential
growth of calculating the entire list for every server.

Change-Id: Ib1187eabeb91b46e29ddcf5065056e43a69bb2a0

nova-compute-config.yaml
nova-compute-instance.yaml
overcloud-source.yaml

index ebc8fbd..2da60d1 100644 (file)
@@ -21,7 +21,6 @@ Resources:
           readonly_user_password: {get_input: snmpd_readonly_user_password}
         glance:
           host: {get_input: glance_host}
-        hosts: {get_input: static_hosts}
         keystone:
           host: {get_input: keystone_host}
         neutron:
index d32159a..f0a64cb 100644 (file)
@@ -145,10 +145,9 @@ Parameters:
     Type: String
   NeutronEnableTunnelling:
     Type: String
-  StaticHosts:
-    Default: ''
-    Description: Static content to append to /etc/hosts
+  HostsConfig:
     Type: String
+    Description: OS::Heat::Config to use for hosts file deployment
   LiveUpdateUserName:
     Type: String
     Description: The live-update username for the undercloud Glance API.
@@ -202,7 +201,6 @@ Resources:
         glance_host: {Ref: GlanceHost}
         glance_port: {Ref: GlancePort}
         glance_protocol: {Ref: GlanceProtocol}
-        static_hosts: {Ref: StaticHosts}
         keystone_host: {Ref: KeystoneHost}
         neutron_flat_networks: {Ref: NeutronFlatNetworks}
         neutron_host: {Ref: NeutronHost}
@@ -226,6 +224,12 @@ Resources:
         nova_image: {Ref: NovaImage}
         live_update_image_id: {Ref: LiveUpdateComputeImage}
         ntp_server: {Ref: NtpServer}
+  NovaCompute0HostsDeploy:
+    Type: OS::Heat::StructuredDeployment
+    Properties:
+      config: {Ref: HostsConfig}
+      server: {Ref: NovaCompute0}
+      signal_transport: NO_SIGNAL
   NovaCompute0Passthrough:
     Type: OS::Heat::StructuredDeployment
     Properties:
index e4439f0..02ecdfa 100644 (file)
@@ -303,62 +303,12 @@ Resources:
             Ref: HypervisorNeutronPublicInterface
         NeutronBridgeMappings:
             Ref: NeutronBridgeMappings
-        StaticHosts:
-          Fn::Join:
-          - "\n"
-          - - Fn::Join:
-              - "\n"
-              - Merge::Map:
-                  NovaCompute0:
-                    Fn::Join:
-                    - ' '
-                    - - Fn::Select:
-                        - 0
-                        - Fn::Select:
-                          - ctlplane
-                          - Fn::GetAtt:
-                            - NovaCompute0
-                            - networks
-                      - Fn::Select:
-                        - name
-                        - Fn::GetAtt:
-                          - NovaCompute0
-                          - show
-                      - Fn::Join:
-                        - '.'
-                        - - Fn::Select:
-                            - name
-                            - Fn::GetAtt:
-                              - NovaCompute0
-                              - show
-                          - 'novalocal'
-            - Fn::Join:
-              - "\n"
-              - Merge::Map:
-                  controller0:
-                    Fn::Join:
-                    - ' '
-                    - - Fn::Select:
-                        - 0
-                        - Fn::Select:
-                          - ctlplane
-                          - Fn::GetAtt:
-                            - controller0
-                            - networks
-                      - Fn::Select:
-                        - name
-                        - Fn::GetAtt:
-                          - controller0
-                          - show
-                      - Fn::Join:
-                        - '.'
-                        - - Fn::Select:
-                            - name
-                            - Fn::GetAtt:
-                              - controller0
-                              - show
-                          - 'novalocal'
-                      - {Ref: CloudName}
+  NovaCompute0Hosts:
+    Type: FileInclude
+    Path: nova-compute-instance.yaml
+    SubKey: Resources.NovaCompute0HostsDeploy
+    Parameters:
+        HostsConfig: {Ref: allHostsConfig}
   NovaCompute0Passthrough:
     Type: OS::Heat::StructuredDeployment
     Properties:
@@ -440,7 +390,6 @@ Resources:
           watch_server_url: {get_input: heat.watch_server_url}
           metadata_server_url: {get_input: heat.metadata_server_url}
           waitcondition_server_url: {get_input: heat.waitcondition_server_url}
-        hosts: {get_input: hosts}
         keystone:
           db: mysql://keystone:unset@localhost/keystone
           host:
@@ -532,6 +481,12 @@ Resources:
       key_name:
         Ref: KeyName
       user_data_format: SOFTWARE_CONFIG
+  controller0Hosts:
+    Type: OS::Heat::StructuredDeployment
+    Properties:
+      config: {Ref: allHostsConfig}
+      server: {Ref: controller0}
+      signal_transport: NO_SIGNAL
   controller0Deployment:
     Type: OS::Heat::StructuredDeployment
     Properties:
@@ -552,6 +507,8 @@ Resources:
               - Fn::GetAtt:
                 - controller0
                 - networks
+        controller_virtual_ip:
+          {'Fn::Select': [ip_address, 'Fn::Select': [0, 'Fn::GetAtt': [ControlVirtualIP, fixed_ips]]]}
         heat.watch_server_url:
           Fn::Join:
             - ''
@@ -570,6 +527,10 @@ Resources:
             - - 'http://'
               - {'Fn::Select': [ip_address, 'Fn::Select': [0, 'Fn::GetAtt': [ControlVirtualIP, fixed_ips]]]}
               - ':8000/v1/waitcondition'
+  allHostsConfig:
+    Type: OS::Heat::StructuredConfig
+    Properties:
+      config:
         hosts:
           Fn::Join:
           - "\n"
@@ -626,8 +587,6 @@ Resources:
                               - show
                           - 'novalocal'
                       - {Ref: CloudName}
-        controller_virtual_ip:
-          {'Fn::Select': [ip_address, 'Fn::Select': [0, 'Fn::GetAtt': [ControlVirtualIP, fixed_ips]]]}
   controller0SSLDeployment:
     Type: OS::Heat::StructuredDeployment
     Properties: