Skip to content

Commit

Permalink
Merge pull request #318 from stackhpc/upstream/2024.1-2024-09-02
Browse files Browse the repository at this point in the history
Synchronise 2024.1 with upstream
  • Loading branch information
priteau authored Sep 5, 2024
2 parents dc9e849 + 8be90c5 commit af16f0a
Show file tree
Hide file tree
Showing 14 changed files with 99 additions and 15 deletions.
6 changes: 6 additions & 0 deletions ansible/inventory/group_vars/all/infra-vms
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ infra_vm_wait_connection_ssh_extra_args: '-o StrictHostKeyChecking=no'
# OS family. Needed for config drive generation.
infra_vm_os_family: "{{ 'RedHat' if os_distribution in ['centos', 'rocky'] else 'Debian' }}"

# Boot firmware. Possible values are 'bios' or 'efi'. Default is 'bios'.
infra_vm_boot_firmware: "bios"

# Machine type. Libvirt default configuration is used.
infra_vm_machine:

###############################################################################
# Infrastructure VM node configuration.

Expand Down
6 changes: 6 additions & 0 deletions ansible/inventory/group_vars/all/seed-vm
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,9 @@ seed_vm_data_format: qcow2

# List of network interfaces to attach to the seed VM.
seed_vm_interfaces: "{{ network_interfaces | sort | map('net_libvirt_vm_network') | list }}"

# Boot firmware. Possible values are 'bios' or 'efi'. Default is 'bios'.
seed_vm_boot_firmware: "bios"

# Machine type. Libvirt default configuration is used.
seed_vm_machine:
2 changes: 2 additions & 0 deletions ansible/roles/infra-vms/tasks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
libvirt_vm_image_cache_path: "{{ image_cache_path }}"
libvirt_vms:
- name: "{{ vm_name }}"
boot_firmware: "{{ vm_hostvars.infra_vm_boot_firmware | default }}"
machine: "{{ vm_hostvars.infra_vm_machine | default }}"
memory_mb: "{{ vm_hostvars.infra_vm_memory_mb }}"
vcpus: "{{ vm_hostvars.infra_vm_vcpus }}"
volumes: "{{ vm_hostvars.infra_vm_volumes + [vm_configdrive_volume] }}"
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/infra-vms/tasks/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
pool: "{{ hostvars[vm_hostvars.infra_vm_hypervisor].infra_vm_pool }}"
libvirt_vms:
- name: "{{ vm_name }}"
boot_firmware: "{{ vm_hostvars.infra_vm_boot_firmware | default }}"
memory_mb: "{{ vm_hostvars.infra_vm_memory_mb }}"
vcpus: "{{ vm_hostvars.infra_vm_vcpus }}"
volumes: "{{ vm_hostvars.infra_vm_volumes + [infra_vm_configdrive_volume] }}"
Expand Down
15 changes: 10 additions & 5 deletions ansible/seed-vm-deprovision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
seed_vm_configdrive_volume:
name: "{{ hostvars[seed_host].seed_vm_name }}-configdrive"
pool: "{{ hostvars[seed_host].seed_vm_pool }}"
libvirt_vm_name: "{{ hostvars[seed_host].seed_vm_name }}"
libvirt_vm_memory_mb: "{{ hostvars[seed_host].seed_vm_memory_mb }}"
libvirt_vm_vcpus: "{{ hostvars[seed_host].seed_vm_vcpus }}"
libvirt_vm_volumes: "{{ hostvars[seed_host].seed_vm_volumes + [seed_vm_configdrive_volume] }}"
libvirt_vm_state: "absent"
libvirt_vms:
- name: "{{ hostvars[seed_host].seed_vm_name }}"
boot_firmware: "{{ hostvars[seed_host].seed_vm_boot_firmware | default }}"
machine: "{{ hostvars[seed_host].seed_vm_machine | default }}"
memory_mb: "{{ hostvars[seed_host].seed_vm_memory_mb }}"
vcpus: "{{ hostvars[seed_host].seed_vm_vcpus }}"
volumes: "{{ hostvars[seed_host].seed_vm_volumes + [seed_vm_configdrive_volume] }}"
interfaces: "{{ hostvars[seed_host].seed_vm_interfaces }}"
console_log_enabled: true
state: absent
become: True
3 changes: 2 additions & 1 deletion ansible/seed-vm-provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,13 @@
libvirt_vm_image_cache_path: "{{ image_cache_path }}"
libvirt_vms:
- name: "{{ hostvars[seed_host].seed_vm_name }}"
boot_firmware: "{{ hostvars[seed_host].seed_vm_boot_firmware | default }}"
machine: "{{ hostvars[seed_host].seed_vm_machine | default }}"
memory_mb: "{{ hostvars[seed_host].seed_vm_memory_mb }}"
vcpus: "{{ hostvars[seed_host].seed_vm_vcpus }}"
volumes: "{{ hostvars[seed_host].seed_vm_volumes + [seed_vm_configdrive_volume] }}"
interfaces: "{{ hostvars[seed_host].seed_vm_interfaces }}"
console_log_enabled: true

tasks:
- name: Wait for SSH access to the seed VM
local_action:
Expand Down
6 changes: 6 additions & 0 deletions etc/kayobe/infra-vms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@
# OS family. Needed for config drive generation.
#infra_vm_os_family:

# Boot firmware. Possible values are 'bios' or 'efi'. Default is 'bios'.
#infra_vm_boot_firmware:

# Machine type. Libvirt default configuration is used.
#infra_vm_machine:

###############################################################################
# Infrastructure VM node configuration.

Expand Down
6 changes: 6 additions & 0 deletions etc/kayobe/seed-vm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@
#
#seed_vm_interfaces:

# Boot firmware. Possible values are 'bios' or 'efi'. Default is 'bios'.
#seed_vm_boot_firmware:

# Machine type. Libvirt default configuration is used.
#seed_vm_machine:

###############################################################################
# Dummy variable to allow Ansible to accept this file.
workaround_ansible_issue_8743: yes
22 changes: 15 additions & 7 deletions kayobe/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,8 @@ def take_action(self, parsed_args):
playbooks = _build_playbook_list(
"seed-deploy-containers")
extra_vars = {"kayobe_action": "deploy"}
self.run_kayobe_playbooks(parsed_args, playbooks, extra_vars=extra_vars)
self.run_kayobe_playbooks(parsed_args, playbooks,
extra_vars=extra_vars)
self.generate_kolla_ansible_config(parsed_args, service_config=False,
bifrost_config=True)

Expand All @@ -740,10 +741,12 @@ def take_action(self, parsed_args):
"seed-credentials",
"seed-introspection-rules",
"dell-switch-bmp")
self.run_kayobe_playbooks(parsed_args, playbooks, extra_vars=extra_vars)
self.run_kayobe_playbooks(parsed_args, playbooks,
extra_vars=extra_vars)


class SeedServiceDestroy(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin,
Command):
Command):
"""Destroy the seed services.
* Destroys user defined containers
Expand All @@ -762,13 +765,15 @@ def take_action(self, parsed_args):
self.generate_kolla_ansible_config(parsed_args, service_config=False,
bifrost_config=False)
extra_args = ["--yes-i-really-really-mean-it"]
self.run_kolla_ansible_seed(parsed_args, "destroy", extra_args=extra_args)
self.run_kolla_ansible_seed(parsed_args, "destroy",
extra_args=extra_args)

extra_vars = {"kayobe_action": "destroy"}
playbooks = _build_playbook_list(
"seed-deploy-containers",
"docker-registry")
self.run_kayobe_playbooks(parsed_args, playbooks, extra_vars=extra_vars)
self.run_kayobe_playbooks(parsed_args, playbooks,
extra_vars=extra_vars)

def get_parser(self, prog_name):
parser = super(SeedServiceDestroy, self).get_parser(prog_name)
Expand All @@ -779,6 +784,7 @@ def get_parser(self, prog_name):
"permanently destroy all services and data.")
return parser


class SeedServiceUpgrade(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin,
Command):
"""Upgrade the seed services.
Expand All @@ -800,7 +806,8 @@ def take_action(self, parsed_args):
playbooks = _build_playbook_list(
"seed-deploy-containers")
extra_vars = {"kayobe_action": "deploy"}
self.run_kayobe_playbooks(parsed_args, playbooks, extra_vars=extra_vars)
self.run_kayobe_playbooks(parsed_args, playbooks,
extra_vars=extra_vars)
self.generate_kolla_ansible_config(parsed_args, service_config=False,
bifrost_config=True)

Expand Down Expand Up @@ -1916,7 +1923,8 @@ def take_action(self, parsed_args):
self.run_kayobe_playbooks(parsed_args, playbooks)


class BaremetalComputeIntrospectionDataSave(KayobeAnsibleMixin, VaultMixin, Command):
class BaremetalComputeIntrospectionDataSave(KayobeAnsibleMixin, VaultMixin,
Command):
"""Save hardware introspection data for the baremetal compute nodes.
Save hardware introspection data from the overcloud's ironic inspector
Expand Down
7 changes: 7 additions & 0 deletions playbooks/kayobe-seed-vm-base/overrides.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ seed_vm_memory_mb: "{{ 1 * 1024 }}"
seed_bootstrap_user: cirros
seed_vm_root_image: /opt/cache/files/cirros-0.5.3-x86_64-disk.img

{% if seed_vm_boot_firmware is defined %}
seed_vm_boot_firmware: "{{ seed_vm_boot_firmware }}"
{% endif %}
{% if seed_vm_machine is defined %}
seed_vm_machine: "{{ seed_vm_machine }}"
{% endif %}

# Cirros doesn't load cdom drivers by default.
seed_vm_configdrive_device: disk

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
features:
- |
Adds support for specifying ``boot_firmware`` and ``machine`` variables to
seed and infra VMs. This can be used to launch VMs in UEFI boot mode with
Q35 machine type.
- |
Bumps stackhpc.libvirt-vm Ansible role to ``v1.16.1``.
4 changes: 2 additions & 2 deletions requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ roles:
version: 1.0.0
- src: stackhpc.libvirt-host
version: v1.12.1
- src: stackhpc.libvirt-vm
version: v1.14.2
- name: stackhpc.libvirt-vm
version: v1.16.1
- src: stackhpc.luks
version: 0.4.2
- src: stackhpc.os-ironic-state
Expand Down
25 changes: 25 additions & 0 deletions zuul.d/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,31 @@
parent: kayobe-seed-vm-base
nodeset: kayobe-ubuntu-jammy

- job:
name: kayobe-seed-vm-efi-base
parent: kayobe-seed-vm-base
description: |
Base job for testing seed VM provisioning with EFI and q35
vars:
seed_vm_boot_firmware: efi
seed_vm_machine: q35

- job:
name: kayobe-seed-vm-centos9s-efi
parent: kayobe-seed-vm-efi-base
nodeset: kayobe-centos9s
voting: false

- job:
name: kayobe-seed-vm-rocky9-efi
parent: kayobe-seed-vm-efi-base
nodeset: kayobe-rocky9

- job:
name: kayobe-seed-vm-ubuntu-jammy-efi
parent: kayobe-seed-vm-efi-base
nodeset: kayobe-ubuntu-jammy

- job:
name: kayobe-infra-vm-base
parent: kayobe-base
Expand Down
3 changes: 3 additions & 0 deletions zuul.d/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@
- kayobe-seed-upgrade-slurp-rocky9
- kayobe-seed-upgrade-slurp-ubuntu-jammy
- kayobe-seed-vm-rocky9
- kayobe-seed-vm-rocky9-efi
- kayobe-seed-vm-ubuntu-jammy
- kayobe-seed-vm-ubuntu-jammy-efi
- kayobe-infra-vm-rocky9
- kayobe-infra-vm-ubuntu-jammy
- openstack-tox-pep8
- openstack-tox-py39
- openstack-tox-py310
- openstack-tox-py311
Expand Down

0 comments on commit af16f0a

Please sign in to comment.