From caf1a4f5ba1249fdc06924b00ea0968daa4d2399 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Wed, 26 Aug 2020 14:25:10 -0700 Subject: [PATCH] Add a Centos8 UEFI based job Turns out we seem to be using bios boot with all of the metalsmith jobs, but we need to further test UEFI and ensure that we cover uefi and partition/wholedisk code in the ramdisk... and these jobs are actually not bad for this purpose. Since we ultimately want to replace the centos7 job, but centos8.2 has some incompatabilities with our IPA image and bootloader installation process with partition images, we need to resolve those issues before making this job voting OR replacing the centos7 job. Change-Id: Ibe6c543179c811c3ef43feca173a4e744c7f5671 --- .zuul.yaml | 32 ++++++++ playbooks/integration/centos8-image.yaml | 76 +++++++++++++++++++ .../integration/centos8-integration.yaml | 37 +++++++++ 3 files changed, 145 insertions(+) create mode 100644 playbooks/integration/centos8-image.yaml create mode 100644 playbooks/integration/centos8-integration.yaml diff --git a/.zuul.yaml b/.zuul.yaml index c0ecd45..0d0baaa 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -21,6 +21,7 @@ - ^tox.ini$ timeout: 5400 required-projects: + - openstack/diskimage-builder - openstack/keystone - openstack/neutron - openstack/glance @@ -139,6 +140,35 @@ metalsmith_swap_size: 1024 metalsmith_traits: [CUSTOM_GOLD] +- job: + name: metalsmith-integration-glance-localboot-centos8-uefi + description: | + Integration job using Glance as image source and CentOS8 with local boot + and UEFI. Images are built with diskimage-builder. + parent: metalsmith-integration-base + timeout: 7200 + run: playbooks/integration/centos8-integration.yaml + vars: + devstack_localrc: + # NOTE(dtantsur): we need to use streaming, otherwise the image won't + # fit in RAM. + IRONIC_AGENT_IMAGE_DOWNLOAD_SOURCE: http + IRONIC_BOOT_MODE: uefi + IRONIC_VM_SPECS_RAM: 3072 + devstack_services: + # Since we're using streaming, try non-swift backends. + s-account: false + s-container: false + s-object: false + s-proxy: false + configure_instance_user: metalsmith + metalsmith_netboot: false + metalsmith_precreate_port: false + metalsmith_partition_image: test-centos-partition + metalsmith_whole_disk_image: test-centos-wholedisk + metalsmith_swap_size: 1024 + metalsmith_traits: [CUSTOM_GOLD] + - job: name: metalsmith-integration-glance-netboot-cirros-iscsi description: | @@ -183,6 +213,8 @@ check: jobs: - metalsmith-integration-glance-localboot-centos7 + - metalsmith-integration-glance-localboot-centos8-uefi: + voting: false - metalsmith-integration-glance-netboot-cirros-iscsi - metalsmith-integration-glance-netboot-cirros-direct - metalsmith-integration-http-netboot-cirros-direct diff --git a/playbooks/integration/centos8-image.yaml b/playbooks/integration/centos8-image.yaml new file mode 100644 index 0000000..3d030de --- /dev/null +++ b/playbooks/integration/centos8-image.yaml @@ -0,0 +1,76 @@ +--- +- name: "Set centos image facts" + set_fact: + centos_image_file: ~/centos8-wholedisk.qcow2 + centos_initramfs_file: ~/centos8-partition.initrd + centos_kernel_file: ~/centos8-partition.vmlinuz + centos_partition_file: ~/centos8-partition.qcow2 + +- name: Install kpartx + package: + name: kpartx + state: present + become: true + +- name: Install DIB + pip: + name: diskimage-builder + become: true + vars: + ansible_python_interpreter: /usr/bin/{{ metalsmith_python | default('python') }} + +- name: Make kernel files readable (workaround for Ubuntu) + shell: chmod 0644 /boot/vmlinuz-* + become: true + +- name: Build a centos8 wholedisk image + command: disk-image-create centos grub2 vm block-device-efi -o centos8-wholedisk + environment: + OS_RELEASE: 8 + +- name: Build a centos8 partition image + command: disk-image-create centos grub2 baremetal -o centos8-partition + environment: + OS_RELEASE: 8 + +- name: Upload the CentOS whole-disk image + command: > + openstack image create --disk-format qcow2 + --public --file {{ centos_image_file }} + {{ centos_glance_whole_disk_image }} + environment: + OS_CLOUD: devstack-admin + when: centos_glance_whole_disk_image is defined + +- name: Upload the CentOS kernel image + command: > + openstack image create --disk-format aki --container-format aki \ + --public --file {{ centos_kernel_file }} -f value -c id + {{ centos_glance_kernel_image }} + register: centos_kernel_id + failed_when: centos_kernel_id.stdout == "" + environment: + OS_CLOUD: devstack-admin + when: centos_glance_kernel_image is defined + +- name: Upload the CentOS initramfs image + command: > + openstack image create --disk-format ari --container-format ari \ + --public --file {{ centos_initramfs_file }} -f value -c id + {{ centos_glance_initramds_image }} + register: centos_initramfs_id + failed_when: centos_initramfs_id.stdout == "" + environment: + OS_CLOUD: devstack-admin + when: centos_glance_initramds_image is defined + +- name: Upload the CentOS partition image + command: > + openstack image create --disk-format qcow2 + --public --file {{ centos_partition_file }} + --property kernel_id={{ centos_kernel_id.stdout }} + --property ramdisk_id={{ centos_initramfs_id.stdout }} + {{ centos_glance_root_image }} + environment: + OS_CLOUD: devstack-admin + when: centos_glance_root_image is defined diff --git a/playbooks/integration/centos8-integration.yaml b/playbooks/integration/centos8-integration.yaml new file mode 100644 index 0000000..0f0a8a6 --- /dev/null +++ b/playbooks/integration/centos8-integration.yaml @@ -0,0 +1,37 @@ +--- +- name: Perform initial setup + include: initial-setup.yaml + +- hosts: all + environment: + OS_CLOUD: devstack-admin + + tasks: + - include_tasks: ssh-key.yaml + + - include_tasks: centos8-image.yaml + when: + - metalsmith_whole_disk_image is defined + - metalsmith_partition_image is defined + + - include_tasks: cirros-image.yaml + when: + - metalsmith_whole_disk_image is undefined + - metalsmith_partition_image is undefined + + - name: Test a whole-disk image + include_tasks: exercise.yaml + vars: + metalsmith_image: "{{ metalsmith_whole_disk_image }}" + metalsmith_image_checksum: "{{ metalsmith_whole_disk_checksum | default('') }}" + metalsmith_root_size: + # NOTE(dtantsur): cannot specify swap with whole disk images + metalsmith_swap_size: + + - name: Test a partition image + include_tasks: exercise.yaml + vars: + metalsmith_image: "{{ metalsmith_partition_image }}" + metalsmith_image_checksum: "{{ metalsmith_partition_checksum | default('') }}" + metalsmith_image_kernel: "{{ metalsmith_partition_kernel_image | default('') }}" + metalsmith_image_ramdisk: "{{ metalsmith_partition_ramdisk_image | default('') }}"