From 7df20fd5738e9c00a4daf7e4f633c634f3b81f69 Mon Sep 17 00:00:00 2001 From: Oliver Walsh Date: Thu, 22 Mar 2018 12:09:13 +0000 Subject: [PATCH] Explicitly set nova/neutron/ceilometer host to expected fqdn This avoids any issues where the host/domainname is altered by a DHCP lease. Also the puppet/facter fqdn can be unpredictable when there are multiple NICs. Change-Id: I7ed52727d1515ee7f191a82b0b1d645a9d597cd3 Closes-bug: 1758034 (cherry picked from commit 31e4c0194dd1d6e049a728c876347df93ce89908) (cherry picked from commit 3381d59f0a6bafac47c98ed8754ee4170e749354) (cherry picked from commit c48ae0b42f06dacd8615ef52f718674ec95c12af) --- puppet/blockstorage-role.yaml | 10 ++++++++++ puppet/cephstorage-role.yaml | 10 ++++++++++ puppet/compute-role.yaml | 12 +++++++++++- puppet/controller-role.yaml | 10 ++++++++++ puppet/objectstorage-role.yaml | 10 ++++++++++ puppet/role.role.j2.yaml | 11 ++++++++++- puppet/services/ceilometer-base.yaml | 2 +- puppet/services/neutron-base.yaml | 2 +- puppet/services/nova-base.yaml | 2 +- .../notes/fix_nova_host-0b82c88597703353.yaml | 9 +++++++++ 10 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 releasenotes/notes/fix_nova_host-0b82c88597703353.yaml diff --git a/puppet/blockstorage-role.yaml b/puppet/blockstorage-role.yaml index 222dbb149d..9eec36ca5c 100644 --- a/puppet/blockstorage-role.yaml +++ b/puppet/blockstorage-role.yaml @@ -343,6 +343,14 @@ resources: - '.' - - {get_attr: [BlockStorage, name]} - ctlplane + canonical: + fqdn: + list_join: + - '.' + - - {get_attr: [BlockStorage, name]} + - {get_param: CloudDomain} + short: + - {get_attr: [BlockStorage, name]} PreNetworkConfig: type: OS::TripleO::BlockStorage::PreNetworkConfig @@ -428,6 +436,7 @@ resources: fqdn_management: {get_attr: [NetHostMap, value, management, fqdn]} fqdn_ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]} fqdn_external: {get_attr: [NetHostMap, value, external, fqdn]} + fqdn_canonical: {get_attr: [NetHostMap, value, canonical, fqdn]} # Resource for site-specific injection of root certificate NodeTLSCAData: @@ -481,6 +490,7 @@ outputs: tenant: {get_attr: [NetHostMap, value, tenant, fqdn]} management: {get_attr: [NetHostMap, value, management, fqdn]} ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]} + canonical: {get_attr: [NetHostMap, value, canonical, fqdn]} hosts_entry: value: str_replace: diff --git a/puppet/cephstorage-role.yaml b/puppet/cephstorage-role.yaml index 29f8203a78..789cbb8cd8 100644 --- a/puppet/cephstorage-role.yaml +++ b/puppet/cephstorage-role.yaml @@ -349,6 +349,14 @@ resources: - '.' - - {get_attr: [CephStorage, name]} - ctlplane + canonical: + fqdn: + list_join: + - '.' + - - {get_attr: [CephStorage, name]} + - {get_param: CloudDomain} + short: + - {get_attr: [CephStorage, name]} PreNetworkConfig: type: OS::TripleO::CephStorage::PreNetworkConfig @@ -433,6 +441,7 @@ resources: fqdn_management: {get_attr: [NetHostMap, value, management, fqdn]} fqdn_ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]} fqdn_external: {get_attr: [NetHostMap, value, external, fqdn]} + fqdn_canonical: {get_attr: [NetHostMap, value, canonical, fqdn]} # Resource for site-specific injection of root certificate NodeTLSCAData: @@ -492,6 +501,7 @@ outputs: tenant: {get_attr: [NetHostMap, value, tenant, fqdn]} management: {get_attr: [NetHostMap, value, management, fqdn]} ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]} + canonical: {get_attr: [NetHostMap, value, canonical, fqdn]} hosts_entry: value: str_replace: diff --git a/puppet/compute-role.yaml b/puppet/compute-role.yaml index 45794c1299..3242a4c59c 100644 --- a/puppet/compute-role.yaml +++ b/puppet/compute-role.yaml @@ -352,6 +352,14 @@ resources: - '.' - - {get_attr: [NovaCompute, name]} - ctlplane + canonical: + fqdn: + list_join: + - '.' + - - {get_attr: [NovaCompute, name]} + - {get_param: CloudDomain} + short: + - {get_attr: [NovaCompute, name]} PreNetworkConfig: type: OS::TripleO::Compute::PreNetworkConfig @@ -446,6 +454,7 @@ resources: fqdn_management: {get_attr: [NetHostMap, value, management, fqdn]} fqdn_ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]} fqdn_external: {get_attr: [NetHostMap, value, external, fqdn]} + fqdn_canonical: {get_attr: [NetHostMap, value, canonical, fqdn]} NovaComputeDeployment: type: OS::TripleO::SoftwareDeployment @@ -534,6 +543,7 @@ outputs: tenant: {get_attr: [NetHostMap, value, tenant, fqdn]} management: {get_attr: [NetHostMap, value, management, fqdn]} ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]} + canonical: {get_attr: [NetHostMap, value, canonical, fqdn]} hosts_entry: description: > Server's IP address and hostname in the /etc/hosts format @@ -600,4 +610,4 @@ CTLPLANEIP,CTLPLANEHOST.DOMAIN,CTLPLANEHOST HOSTSSHPUBKEY" nova_server_resource: description: Heat resource handle for the Nova compute server value: - {get_resource: NovaCompute} \ No newline at end of file + {get_resource: NovaCompute} diff --git a/puppet/controller-role.yaml b/puppet/controller-role.yaml index 5593d15ead..ec77c5ab32 100644 --- a/puppet/controller-role.yaml +++ b/puppet/controller-role.yaml @@ -371,6 +371,14 @@ resources: - '.' - - {get_attr: [Controller, name]} - ctlplane + canonical: + fqdn: + list_join: + - '.' + - - {get_attr: [Controller, name]} + - {get_param: CloudDomain} + short: + - {get_attr: [Controller, name]} PreNetworkConfig: type: OS::TripleO::Controller::PreNetworkConfig @@ -502,6 +510,7 @@ resources: fqdn_management: {get_attr: [NetHostMap, value, management, fqdn]} fqdn_ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]} fqdn_external: {get_attr: [NetHostMap, value, external, fqdn]} + fqdn_canonical: {get_attr: [NetHostMap, value, canonical, fqdn]} # Hook for site-specific additional pre-deployment config, e.g extra hieradata ControllerExtraConfigPre: @@ -573,6 +582,7 @@ outputs: tenant: {get_attr: [NetHostMap, value, tenant, fqdn]} management: {get_attr: [NetHostMap, value, management, fqdn]} ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]} + canonical: {get_attr: [NetHostMap, value, canonical, fqdn]} hosts_entry: description: > Server's IP address and hostname in the /etc/hosts format diff --git a/puppet/objectstorage-role.yaml b/puppet/objectstorage-role.yaml index 7cffbd4a75..934e0bee0a 100644 --- a/puppet/objectstorage-role.yaml +++ b/puppet/objectstorage-role.yaml @@ -343,6 +343,14 @@ resources: - '.' - - {get_attr: [SwiftStorage, name]} - ctlplane + canonical: + fqdn: + list_join: + - '.' + - - {get_attr: [SwiftStorage, name]} + - {get_param: CloudDomain} + short: + - {get_attr: [SwiftStorage, name]} PreNetworkConfig: type: OS::TripleO::ObjectStorage::PreNetworkConfig @@ -417,6 +425,7 @@ resources: fqdn_management: {get_attr: [NetHostMap, value, management, fqdn]} fqdn_ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]} fqdn_external: {get_attr: [NetHostMap, value, external, fqdn]} + fqdn_canonical: {get_attr: [NetHostMap, value, canonical, fqdn]} SwiftStorageHieraDeploy: type: OS::Heat::StructuredDeployment @@ -479,6 +488,7 @@ outputs: tenant: {get_attr: [NetHostMap, value, tenant, fqdn]} management: {get_attr: [NetHostMap, value, management, fqdn]} ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]} + canonical: {get_attr: [NetHostMap, value, canonical, fqdn]} hosts_entry: value: str_replace: diff --git a/puppet/role.role.j2.yaml b/puppet/role.role.j2.yaml index c12206d039..f6f6349e59 100644 --- a/puppet/role.role.j2.yaml +++ b/puppet/role.role.j2.yaml @@ -365,7 +365,14 @@ resources: - '.' - - {get_attr: [{{role}}, name]} - ctlplane - + canonical: + fqdn: + list_join: + - '.' + - - {get_attr: [{{role}}, name]} + - {get_param: CloudDomain} + short: + - {get_attr: [{{role}}, name]} PreNetworkConfig: type: OS::TripleO::{{role}}::PreNetworkConfig properties: @@ -454,6 +461,7 @@ resources: fqdn_management: {get_attr: [NetHostMap, value, management, fqdn]} fqdn_ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]} fqdn_external: {get_attr: [NetHostMap, value, external, fqdn]} + fqdn_canonical: {get_attr: [NetHostMap, value, canonical, fqdn]} {%- if 'controller' in role.lower() %} tripleo::haproxy::service_certificate: {get_attr: [NodeTLSData, deployed_ssl_certificate_path]} {%- endif -%} @@ -532,6 +540,7 @@ outputs: tenant: {get_attr: [NetHostMap, value, tenant, fqdn]} management: {get_attr: [NetHostMap, value, management, fqdn]} ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]} + canonical: {get_attr: [NetHostMap, value, canonical, fqdn]} hosts_entry: value: str_replace: diff --git a/puppet/services/ceilometer-base.yaml b/puppet/services/ceilometer-base.yaml index b0642e78ba..58cbf0207a 100644 --- a/puppet/services/ceilometer-base.yaml +++ b/puppet/services/ceilometer-base.yaml @@ -126,7 +126,7 @@ outputs: ceilometer::db::database_db_max_retries: -1 ceilometer::db::database_max_retries: -1 ceilometer::telemetry_secret: {get_param: CeilometerMeteringSecret} - ceilometer::host: '%{::fqdn}' + ceilometer::host: "%{hiera('fqdn_canonical')}" service_config_settings: keystone: ceilometer_auth_enabled: true diff --git a/puppet/services/neutron-base.yaml b/puppet/services/neutron-base.yaml index b3748ae450..bdc76f8a79 100644 --- a/puppet/services/neutron-base.yaml +++ b/puppet/services/neutron-base.yaml @@ -98,7 +98,7 @@ outputs: neutron::purge_config: {get_param: EnableConfigPurge} neutron::allow_overlapping_ips: true neutron::rabbit_heartbeat_timeout_threshold: 60 - neutron::host: '%{::fqdn}' + neutron::host: "%{hiera('fqdn_canonical')}" neutron::db::database_db_max_retries: -1 neutron::db::database_max_retries: -1 neutron::global_physnet_mtu: {get_param: NeutronGlobalPhysnetMtu} diff --git a/puppet/services/nova-base.yaml b/puppet/services/nova-base.yaml index c0892d4c7e..c3343edabf 100644 --- a/puppet/services/nova-base.yaml +++ b/puppet/services/nova-base.yaml @@ -193,7 +193,7 @@ outputs: nova::network::neutron::neutron_auth_url: {get_param: [EndpointMap, KeystoneV3Admin, uri]} nova::rabbit_heartbeat_timeout_threshold: 60 nova::cinder_catalog_info: 'volumev2:cinderv2:internalURL' - nova::host: '%{::fqdn}' + nova::host: "%{hiera('fqdn_canonical')}" nova::notify_on_state_change: 'vm_and_task_state' nova::notification_driver: messagingv2 nova::notification_format: 'unversioned' diff --git a/releasenotes/notes/fix_nova_host-0b82c88597703353.yaml b/releasenotes/notes/fix_nova_host-0b82c88597703353.yaml new file mode 100644 index 0000000000..7430490e0f --- /dev/null +++ b/releasenotes/notes/fix_nova_host-0b82c88597703353.yaml @@ -0,0 +1,9 @@ +--- +fixes: + - | + The nova/neutron/ceilometer host parameter is now explicitly set to the + same value that is written to /etc/hosts. On a correctly configured + deployment they should be already be identical. However if the hostname + or domainname is altered (e.g via DHCP) then the hostname is unlikely to + resolve to the correct IP address for live-migraiton. + Related bug: https://bugs.launchpad.net/tripleo/+bug/1758034