From 6f1c603b5b39228776a74a49ca9e0e9a819141d9 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Thu, 5 Sep 2024 13:20:23 -0700 Subject: [PATCH] CI: Enable the ability to have test VMs with different block sizes Recently we became aware that some operators might need a larger block size, but our CI testing doesn't represent any ability to assert a different block size. We can now assert a block size override in the scripting which allows us to create a CI job. Change-Id: I8470fb5b2827226dc155938a94c3a2cbe98912b5 --- devstack/tools/ironic/scripts/configure-vm.py | 3 +++ devstack/tools/ironic/scripts/create-node.sh | 8 ++++++-- devstack/tools/ironic/templates/vm.xml | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/devstack/tools/ironic/scripts/configure-vm.py b/devstack/tools/ironic/scripts/configure-vm.py index dee17b886f..18590279ae 100755 --- a/devstack/tools/ironic/scripts/configure-vm.py +++ b/devstack/tools/ironic/scripts/configure-vm.py @@ -91,6 +91,8 @@ def main(): help=('The absolute path of the non-volatile memory ' 'to store the UEFI variables. Should be used ' 'only when --uefi-loader is also specified.')) + parser.add_argument('--block-size', default='512', + help='The block size for the block storage.') args = parser.parse_args() env = jinja2.Environment(loader=jinja2.FileSystemLoader(templatedir)) @@ -117,6 +119,7 @@ def main(): 'disk_format': args.disk_format, 'uefi_loader': args.uefi_loader, 'uefi_nvram': args.uefi_nvram, + 'block_size': args.block_size, } if args.emulator: diff --git a/devstack/tools/ironic/scripts/create-node.sh b/devstack/tools/ironic/scripts/create-node.sh index 8530b846ff..5cca0ffc25 100755 --- a/devstack/tools/ironic/scripts/create-node.sh +++ b/devstack/tools/ironic/scripts/create-node.sh @@ -12,7 +12,7 @@ export PS4='+ ${BASH_SOURCE:-}:${FUNCNAME[0]:-}:L${LINENO:-}: ' # Keep track of the DevStack directory TOP_DIR=$(cd $(dirname "$0")/.. && pwd) -while getopts "n:c:i:m:M:d:a:b:e:E:p:o:f:l:L:N:A:D:v:P:t:" arg; do +while getopts "n:c:i:m:M:d:a:b:e:E:p:o:f:l:L:N:A:D:v:P:t:B:" arg; do case $arg in n) NAME=$OPTARG;; c) CPU=$OPTARG;; @@ -37,6 +37,7 @@ while getopts "n:c:i:m:M:d:a:b:e:E:p:o:f:l:L:N:A:D:v:P:t:" arg; do v) VOLUME_COUNT=$OPTARG;; P) STORAGE_POOL=$OPTARG;; t) MACHINE_TYPE=$OPTARG;; + B) BLOCK_SIZE=$OPTARG;; esac done @@ -77,6 +78,8 @@ if [ ! -z "$UEFI_LOADER" ]; then fi fi +BLOCK_SIZE=${BLOCK_SIZE:-512} + # Create bridge and add VM interface to it. # Additional interface will be added to this bridge and # it will be plugged to OVS. @@ -129,7 +132,8 @@ if ! virsh list --all | grep -q $NAME; then --bootdev network --name $NAME \ --arch $ARCH --cpus $CPU --memory $MEM --libvirt-nic-driver $LIBVIRT_NIC_DRIVER \ --disk-format $DISK_FORMAT $VM_LOGGING --engine $ENGINE $UEFI_OPTS $vm_opts \ - --interface-count $INTERFACE_COUNT $MAC_ADDRESS --machine_type $MACHINE_TYPE >&2 + --interface-count $INTERFACE_COUNT $MAC_ADDRESS --machine_type $MACHINE_TYPE \ + --block-size $BLOCK_SIZE >&2 fi # echo mac in format mac1,ovs-node-0i1;mac2,ovs-node-0i2;...;macN,ovs-node0iN diff --git a/devstack/tools/ironic/templates/vm.xml b/devstack/tools/ironic/templates/vm.xml index bd36e9f360..f91b166b78 100644 --- a/devstack/tools/ironic/templates/vm.xml +++ b/devstack/tools/ironic/templates/vm.xml @@ -46,6 +46,7 @@ + {% endfor %} {% for n in range(1, interface_count+1) %}