Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create VMs with proper FQDN instead of shortname only #2151

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions roles/libvirt_manager/tasks/manage_vms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@
- vm_type is not match('^(crc|ocp).*$')
delegate_to: "{{ vm }}.{{ inventory_hostname }}"
remote_user: "{{ _init_admin_user }}"
vars:
_fqdn: "{{ vm }}.{{ cifmw_reproducer_domain | default('local') }}"
ansible.builtin.shell:
executable: /bin/bash
cmd: |-
test -d /home/zuul && exit 0;
set -xe -o pipefail;
echo "{{ vm }}" | sudo tee /etc/hostname;
sudo hostname -F /etc/hostname;
sudo hostnamectl hostname "{{ _fqdn }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let hostnamectl set it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the canonical hostname of the edpm node if its hosting a nova is required to be the ctrlplane fqdn

so cifmw_reproducer_domain must always equal the ctlplane network domain in the network atachmetn definition.

without this it will break live migration and tls and it will cause issues with adoption potentially too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you set hostname with fqdn, and use the same in nodeset spec node hostName, it would be used as canonical_hostname and resolve to the ctlplane network ip. I guess you're not updating the nodeset spec with the correct hostName.

sudo useradd -m -d /home/zuul zuul;
echo "zuul ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/zuul;
sudo -u zuul mkdir -p /home/zuul/.ssh /home/zuul/src/github.com/openstack-k8s-operators;
Expand Down
2 changes: 1 addition & 1 deletion roles/libvirt_manager/templates/inventory.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% for host in hosts %}
{% set ocp_name = host.key | replace('_', '-') | replace('ocp-worker', 'worker') | replace('ocp', 'master') -%}
{% set hostname = (host.key is match('^ocp.*')) | ternary(ocp_name, host.key) %}
{{ host.key }}:
{{ host.key }}.{{ cifmw_reproducer_domain | default('local') }}:
ansible_host: {{ hostname }}.utility
ansible_user: {{ _cifmw_libvirt_manager_layout.vms[item].admin_user | default('zuul') }}
ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
Expand Down
28 changes: 2 additions & 26 deletions roles/reproducer/molecule/crc_layout/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,41 +131,17 @@
ansible.builtin.stat:
path: "{{ ansible_user_dir }}/ci-framework-data/parameters/interfaces-info.yml"

- name: Load crc inventory
register: _crc_inv
ansible.builtin.slurp:
src: "{{ ansible_user_dir }}/reproducer-inventory/crc-group.yml"

- name: Load compute inventory
register: _compute_inv
ansible.builtin.slurp:
src: "{{ ansible_user_dir }}/reproducer-inventory/compute-group.yml"

- name: Ensure we can ping compute-0 on osp_trunk net
register: _cmp0_ping
failed_when: false
vars:
_inv: >-
{{
_compute_inv.content | b64decode | from_yaml
}}
_ip: >-
{{ _inv.computes.hosts['compute-0'].ansible_host }}
ansible.builtin.command:
cmd: "ping -c1 -w1 {{ _ip }}"
cmd: "ping -c1 -w1 compute-0.utility"

- name: Ensure we can ping crc-0 on osp_trunk net
register: _crc_ping
failed_when: false
vars:
_inv: >-
{{
_crc_inv.content | b64decode | from_yaml
}}
_ip: >-
{{ _inv.ocps.hosts['crc-0'].ansible_host }}
ansible.builtin.command:
cmd: "ping -c1 -w1 {{ _ip }}"
cmd: "ping -c1 -w1 crc-0.utility"

- name: Check secret files
block:
Expand Down