Skip to content
Snippets Groups Projects
  • Pierre Riteau's avatar
    37899026
    Add ansible_nodename (system hostname) to /etc/hosts · 37899026
    Pierre Riteau authored
    Kolla-Ansible populates /etc/hosts with overcloud hosts using their API
    interface IP address. When configured correctly, this allows Nova to use
    the API interface for live migration of instances between compute hosts.
    
    The hostname used is from the `ansible_hostname` variable, which is a
    short hostname generated by Ansible using the first dot as a delimiter.
    However, Nova defaults to use the result of socket.gethostname() to
    register nova-compute services.
    
    In deployments where hostnames are set to FQDNs, for example when using
    FreeIPA, nova-compute would try to reach the other compute node using
    its FQDN (as registered in the Nova database), which was absent from
    /etc/hosts. This can result in failures to live migrate instances if
    DNS entries don't match.
    
    This commit populates /etc/hosts with `ansible_nodename` (hostname as
    reported by the system) in addition to `ansible_hostname`, if they are
    different.
    
    Change-Id: Id058aa1db8d60c979680e6a41f7f3e1c39f98235
    Closes-Bug: #1830023
    37899026
    History
    Add ansible_nodename (system hostname) to /etc/hosts
    Pierre Riteau authored
    Kolla-Ansible populates /etc/hosts with overcloud hosts using their API
    interface IP address. When configured correctly, this allows Nova to use
    the API interface for live migration of instances between compute hosts.
    
    The hostname used is from the `ansible_hostname` variable, which is a
    short hostname generated by Ansible using the first dot as a delimiter.
    However, Nova defaults to use the result of socket.gethostname() to
    register nova-compute services.
    
    In deployments where hostnames are set to FQDNs, for example when using
    FreeIPA, nova-compute would try to reach the other compute node using
    its FQDN (as registered in the Nova database), which was absent from
    /etc/hosts. This can result in failures to live migrate instances if
    DNS entries don't match.
    
    This commit populates /etc/hosts with `ansible_nodename` (hostname as
    reported by the system) in addition to `ansible_hostname`, if they are
    different.
    
    Change-Id: Id058aa1db8d60c979680e6a41f7f3e1c39f98235
    Closes-Bug: #1830023