From fde2cd608ecbd1f0dbe592c4739e30a6e4ad6131 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Tue, 1 Oct 2024 13:29:31 -0700 Subject: [PATCH] CI: Change 4k block device job to use LVM An interesting, and frustrating aspect of 4k block devices is that the math begins to be impacted across the whole of the useage of the device. Specifically the LVM block spacing also begins to be thrown "out of alignment" which changes user calculations. Most users doing smaller allocations likely won't matter, but users doing thin volumes or filling the percentage of the remaining usable volume, also then break. So realistically, the best path to ensure we have appropriate 4k device testing, and our dependent tooling in diskimage-builder is also getting tested, is to run the more complex case in our CI job. This change is dependent upon two other changes which are under review. Change-Id: I5b23403c783fa84b4158708741524c3dc9a92722 --- devstack/files/ci-block-device-for-lvm.yaml | 73 +++++++++++++++++++++ devstack/lib/ironic | 9 +-- zuul.d/ironic-jobs.yaml | 6 ++ 3 files changed, 84 insertions(+), 4 deletions(-) create mode 100644 devstack/files/ci-block-device-for-lvm.yaml diff --git a/devstack/files/ci-block-device-for-lvm.yaml b/devstack/files/ci-block-device-for-lvm.yaml new file mode 100644 index 0000000000..a8c9083d8c --- /dev/null +++ b/devstack/files/ci-block-device-for-lvm.yaml @@ -0,0 +1,73 @@ +- local_loop: + name: image0 + +- partitioning: + base: image0 + label: gpt + partitions: + - name: ESP + type: 'EF00' + size: 350MiB + mkfs: + type: vfat + mount: + mount_point: /boot/efi + fstab: + options: "defaults" + fsck-passno: 2 + - name: BSP + type: 'EF02' + size: 8MiB + - name: root + flags: [ boot ] + size: 6G +- lvm: + name: lvm + base: [ root ] + pvs: + - name: pv + base: root + options: [ "--force" ] + vgs: + - name: vg + base: [ "pv" ] + options: [ "--force" ] + lvs: + - name: lv_root + base: vg + extents: 50%VG + - name: lv_var + base: vg + extents: 15%VG + - name: lv_home + base: vg + extents: 10%VG +- mkfs: + name: fs_root + base: lv_root + type: xfs + label: "img-rootfs" + mount: + mount_point: / + fstab: + options: "rw,relatime" + fsck-passno: 1 +- mkfs: + name: fs_var + base: lv_var + type: ext4 + mount: + mount_point: /var + fstab: + options: "rw,relatime" + fsck-passno: 2 +- mkfs: + name: fs_home + base: lv_home + type: ext4 + mount: + mount_point: /home + fstab: + options: "rw,nodev,relatime" + fsck-passno: 2 + diff --git a/devstack/lib/ironic b/devstack/lib/ironic index a994179964..d2c322a3bb 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -401,7 +401,7 @@ IRONIC_DIB_IMAGE_OPTIONS=${IRONIC_DIB_IMAGE_OPTIONS:-} IRONIC_DIB_IMAGE_OS=${IRONIC_DIB_IMAGE_OS:-centos} IRONIC_DIB_IMAGE_RELEASE=${IRONIC_DIB_IMAGE_RELEASE:-9-stream} if [[ -z "$IRONIC_DIB_IMAGE_OPTIONS" ]]; then - IRONIC_DIB_IMAGE_OPTIONS="$IRONIC_DIB_IMAGE_OS bootloader block-device-efi" + IRONIC_DIB_IMAGE_OPTIONS="$IRONIC_DIB_IMAGE_OS bootloader block-device-efi-lvm growvols dracut-regenerate" fi # Some drivers in Ironic require deploy ramdisk in bootable ISO format. @@ -3085,12 +3085,13 @@ function build_dib_image { if ! $(type -P disk-image-create > /dev/null); then install_diskimage_builder fi - # NOTE(TheJulia): Explicitly setting an release is likely not - # needed, but just in case! + DIB_GROWVOLS_TRIGGER=systemd \ + DIB_GROWVOLS_ARGS="img-rootfs=60%" \ DIB_BLOCK_SIZE=$IRONIC_VM_BLOCK_SIZE \ DIB_RELEASE=$IRONIC_DIB_IMAGE_RELEASE \ + DIB_BLOCK_DEVICE_CONFIG=file://$IRONIC_DEVSTACK_FILES_DIR/ci-block-device-for-lvm.yaml \ disk-image-create "$IRONIC_DIB_IMAGE_OPTIONS" \ - -x -t qcow2 -o "$tempdir/target-os-image" + -x -t qcow2 -o "$tempdir/target-os-image" --image-size 7 chmod -R +r $tempdir mv "$tempdir/target-os-image.qcow2" "$target_path" rm -rf $tempdir diff --git a/zuul.d/ironic-jobs.yaml b/zuul.d/ironic-jobs.yaml index 7acc74c4d7..b229043c4c 100644 --- a/zuul.d/ironic-jobs.yaml +++ b/zuul.d/ironic-jobs.yaml @@ -1023,9 +1023,15 @@ description: "Build 4k disk artifacts with 4k VMs" parent: ironic-tempest-uefi-redfish-vmedia vars: + tempest_test_timeout: 2800 devstack_localrc: + # NOTE(TheJulia): This job takes a while because it is blending + # vmedia *and* 4k block device layouts which requires mastering and + # streaming a real image as opposed to cirros. + BUILD_TIMEOUT: 2400 IRONIC_AUTOMATED_CLEAN_ENABLED: False IRONIC_VM_COUNT: 1 + IRONIC_VM_SPECS_DISK: 20 IRONIC_VM_BLOCK_SIZE: 4096 IRONIC_BUILD_DIB_IMAGE: True SWIFT_ENABLE_TEMPURLS: False