From 022b2be9fc160c0731a9c97fc6eeb66992431ee5 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Tue, 20 Aug 2024 11:23:52 +0100 Subject: [PATCH 1/2] CI: Add openstack-tox-pep8 job, fix pep8 failures Since I8f5338b7eee31f1b8bc3e783d10666e3092a6540 we have not been running pep8 jobs in CI. This change fixes the issues introduced since then, and adds the job back. Unlike the original change, we are not using the openstack-python3-jobs template since it would use py38 on this branch. Change-Id: Ie15019f91b9e7b7f8cf97b628886f6b0beeb24fa (cherry picked from commit 610433b11ba3819869a892489546d9f8b2b743c2) --- doc/source/configuration/reference/hosts.rst | 2 +- kayobe/cli/commands.py | 23 ++++++++++++++------ zuul.d/project.yaml | 1 + 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/doc/source/configuration/reference/hosts.rst b/doc/source/configuration/reference/hosts.rst index 4eade8470..e69de543d 100644 --- a/doc/source/configuration/reference/hosts.rst +++ b/doc/source/configuration/reference/hosts.rst @@ -1414,4 +1414,4 @@ using journald defaults). See `journald documentation for more details. Should you wish to disable this feature, you can set ``journald_storage`` to -``volatile``. \ No newline at end of file +``volatile``. diff --git a/kayobe/cli/commands.py b/kayobe/cli/commands.py index adeed5426..63fb711c8 100644 --- a/kayobe/cli/commands.py +++ b/kayobe/cli/commands.py @@ -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) @@ -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 @@ -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) @@ -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. @@ -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) @@ -1896,6 +1903,7 @@ def take_action(self, parsed_args): playbooks = _build_playbook_list("network-connectivity") self.run_kayobe_playbooks(parsed_args, playbooks) + class BaremetalComputeRegister(KayobeAnsibleMixin, VaultMixin, Command): """Register baremetal compute nodes in Ironic.""" @@ -1915,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 diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index fea62304d..98aa14e92 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -34,6 +34,7 @@ - kayobe-seed-vm-ubuntu-jammy - kayobe-infra-vm-rocky9 - kayobe-infra-vm-ubuntu-jammy + - openstack-tox-pep8 - openstack-tox-py39 - openstack-tox-py310 - openstack-tox-py311 From dda83ae0c8ee9cc7a7883786436b9f1a3fa6ce8d Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Mon, 10 Jun 2024 14:16:02 +0200 Subject: [PATCH 2/2] seed-vm/infra-vms: Add support for EFI and q35 Bump stackhpc.libvirt-vm to v1.16.1. Change-Id: I88f20112ab4740fe114a6484f88f4fbfb66863e5 (cherry picked from commit 9702736b3ec3c0dc44657b34c90594ccc3c75493) --- ansible/inventory/group_vars/all/infra-vms | 6 +++++ ansible/inventory/group_vars/all/seed-vm | 6 +++++ ansible/roles/infra-vms/tasks/deploy.yml | 2 ++ ansible/roles/infra-vms/tasks/destroy.yml | 1 + ansible/seed-vm-deprovision.yml | 15 +++++++---- ansible/seed-vm-provision.yml | 3 ++- etc/kayobe/infra-vms.yml | 6 +++++ etc/kayobe/seed-vm.yml | 6 +++++ .../kayobe-seed-vm-base/overrides.yml.j2 | 7 ++++++ ...a-vm-boot-fw-machine-096251c45653f98c.yaml | 8 ++++++ requirements.yml | 4 +-- zuul.d/jobs.yaml | 25 +++++++++++++++++++ zuul.d/project.yaml | 2 ++ 13 files changed, 83 insertions(+), 8 deletions(-) create mode 100644 releasenotes/notes/seed-infra-vm-boot-fw-machine-096251c45653f98c.yaml diff --git a/ansible/inventory/group_vars/all/infra-vms b/ansible/inventory/group_vars/all/infra-vms index c78494ca4..569ab6b73 100644 --- a/ansible/inventory/group_vars/all/infra-vms +++ b/ansible/inventory/group_vars/all/infra-vms @@ -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. diff --git a/ansible/inventory/group_vars/all/seed-vm b/ansible/inventory/group_vars/all/seed-vm index 8f63d0e83..953d580fd 100644 --- a/ansible/inventory/group_vars/all/seed-vm +++ b/ansible/inventory/group_vars/all/seed-vm @@ -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: diff --git a/ansible/roles/infra-vms/tasks/deploy.yml b/ansible/roles/infra-vms/tasks/deploy.yml index 214d0be3f..2000bfdc6 100644 --- a/ansible/roles/infra-vms/tasks/deploy.yml +++ b/ansible/roles/infra-vms/tasks/deploy.yml @@ -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] }}" diff --git a/ansible/roles/infra-vms/tasks/destroy.yml b/ansible/roles/infra-vms/tasks/destroy.yml index a621e4e30..c45b996c7 100644 --- a/ansible/roles/infra-vms/tasks/destroy.yml +++ b/ansible/roles/infra-vms/tasks/destroy.yml @@ -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] }}" diff --git a/ansible/seed-vm-deprovision.yml b/ansible/seed-vm-deprovision.yml index 1ed2179e9..9edd634b7 100644 --- a/ansible/seed-vm-deprovision.yml +++ b/ansible/seed-vm-deprovision.yml @@ -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 diff --git a/ansible/seed-vm-provision.yml b/ansible/seed-vm-provision.yml index 41f97996c..8be7364ef 100644 --- a/ansible/seed-vm-provision.yml +++ b/ansible/seed-vm-provision.yml @@ -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: diff --git a/etc/kayobe/infra-vms.yml b/etc/kayobe/infra-vms.yml index a8f1fd9b2..ba75c641c 100644 --- a/etc/kayobe/infra-vms.yml +++ b/etc/kayobe/infra-vms.yml @@ -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. diff --git a/etc/kayobe/seed-vm.yml b/etc/kayobe/seed-vm.yml index f10fbaa19..5fdcc1690 100644 --- a/etc/kayobe/seed-vm.yml +++ b/etc/kayobe/seed-vm.yml @@ -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 diff --git a/playbooks/kayobe-seed-vm-base/overrides.yml.j2 b/playbooks/kayobe-seed-vm-base/overrides.yml.j2 index 57706d809..c7284ce5e 100644 --- a/playbooks/kayobe-seed-vm-base/overrides.yml.j2 +++ b/playbooks/kayobe-seed-vm-base/overrides.yml.j2 @@ -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 diff --git a/releasenotes/notes/seed-infra-vm-boot-fw-machine-096251c45653f98c.yaml b/releasenotes/notes/seed-infra-vm-boot-fw-machine-096251c45653f98c.yaml new file mode 100644 index 000000000..db4c48a5d --- /dev/null +++ b/releasenotes/notes/seed-infra-vm-boot-fw-machine-096251c45653f98c.yaml @@ -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``. diff --git a/requirements.yml b/requirements.yml index 8916a4621..99b1a551f 100644 --- a/requirements.yml +++ b/requirements.yml @@ -38,8 +38,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 diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 8d9b81e06..54f723d6b 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -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 diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index fea62304d..9ca1e592e 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -31,7 +31,9 @@ - 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-py39