From 75b69ea7451ec311e53591b37a2d30eda35048c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= Date: Mon, 10 Jan 2022 17:10:46 +0000 Subject: [PATCH] Make nova_ssh listen on api_interface as well This is required as nova_compute tries to reach my_ip of the other node when resizing an instance and my_ip is set to api_interface_address. This potential issue was introduced with [1]. [1] https://review.opendev.org/c/openstack/kolla-ansible/+/569131 Closes-Bug: #1956976 Change-Id: Id57a672c69a2d5aa74e55f252d05bb756bbc945a --- ansible/roles/nova-cell/tasks/precheck.yml | 17 ++++++++++++++++- .../roles/nova-cell/templates/sshd_config.j2 | 3 +++ .../notes/bug-1956976-8a2623ca1fbfd546.yaml | 5 +++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/bug-1956976-8a2623ca1fbfd546.yaml diff --git a/ansible/roles/nova-cell/tasks/precheck.yml b/ansible/roles/nova-cell/tasks/precheck.yml index 861081e3dd..e05919c990 100644 --- a/ansible/roles/nova-cell/tasks/precheck.yml +++ b/ansible/roles/nova-cell/tasks/precheck.yml @@ -68,7 +68,21 @@ - nova_spicehtml5proxy.enabled | bool - inventory_hostname in groups[nova_spicehtml5proxy.group] -- name: Checking free port for Nova SSH +- name: Checking free port for Nova SSH (API interface) + vars: + nova_ssh: "{{ nova_cell_services['nova-ssh'] }}" + wait_for: + host: "{{ api_interface_address }}" + port: "{{ nova_ssh_port }}" + connect_timeout: 1 + timeout: 1 + state: stopped + when: + - container_facts['nova_ssh'] is not defined + - nova_ssh.enabled | bool + - inventory_hostname in groups[nova_ssh.group] + +- name: Checking free port for Nova SSH (migration interface) vars: nova_ssh: "{{ nova_cell_services['nova-ssh'] }}" wait_for: @@ -78,6 +92,7 @@ timeout: 1 state: stopped when: + - migration_interface_address != api_interface_address - container_facts['nova_ssh'] is not defined - nova_ssh.enabled | bool - inventory_hostname in groups[nova_ssh.group] diff --git a/ansible/roles/nova-cell/templates/sshd_config.j2 b/ansible/roles/nova-cell/templates/sshd_config.j2 index 5426d48a31..d51db02d0d 100644 --- a/ansible/roles/nova-cell/templates/sshd_config.j2 +++ b/ansible/roles/nova-cell/templates/sshd_config.j2 @@ -1,5 +1,8 @@ Port {{ nova_ssh_port }} +ListenAddress {{ api_interface_address }} +{% if migration_interface_address != api_interface_address %} ListenAddress {{ migration_interface_address }} +{% endif %} SyslogFacility AUTHPRIV UsePAM yes diff --git a/releasenotes/notes/bug-1956976-8a2623ca1fbfd546.yaml b/releasenotes/notes/bug-1956976-8a2623ca1fbfd546.yaml new file mode 100644 index 0000000000..033b08e370 --- /dev/null +++ b/releasenotes/notes/bug-1956976-8a2623ca1fbfd546.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixes Nova resize failing when ``migration_interface`` is customised. + `LP#1956976 `__