Use metadata IP instead of FQDN 47/60447/1
authorTim Rozet <trozet@redhat.com>
Tue, 31 Jul 2018 20:14:25 +0000 (16:14 -0400)
committerTim Rozet <trozet@redhat.com>
Tue, 31 Jul 2018 20:14:25 +0000 (16:14 -0400)
There is an issue with loss of external network connectivity that
prevents cloud init to instances working. This becomes a big problem
with snapshots where there is no external network connectivity. Cloud
init fails because each request takes over 30 seconds to get a response.
This is because in the background neutron metadata agent is proxying the
request to nova metadata agent with an HTTP GET using the FQDN. For
whatever reason, a DNS lookup happens even though the entry exists for
the FQDN in /etc/hosts and waits 30 seconds until timing out. After this
timeout, a 200 OK is sent and metadata works.

This patch modifies the config file for metadata to use nova metadata
server's internal IP rather than FQDN as there is no option in OOO to
use IPs instead of FQDN.

Change-Id: I6960181a227d0002c99aeae5112f59807dc41d7a
Signed-off-by: Tim Rozet <trozet@redhat.com>
lib/ansible/playbooks/post_deploy_overcloud.yml

index 372aea4..08460a0 100644 (file)
     - name: save iptables
       command: service iptables save
       become: yes
+    - name: Modify nova metadata host to be IP
+      shell: >
+        crudini --set /var/lib/config-data/puppet-generated/neutron/etc/neutron/metadata_agent.ini
+        DEFAULT nova_metadata_host $(hiera -c /etc/puppet/hiera.yaml nova_metadata_vip)
+      become: yes
+      when: "'controller' in ansible_hostname"
+    - name: Restart metadata service
+      shell: "docker restart neutron_metadata_agent"
+      become: yes
+      when:
+        - "'controller' in ansible_hostname"