From 821f4a9f410c573e137012b4f8aac75bcf42aa74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Peliz=C3=A4us?= Date: Mon, 5 Feb 2024 09:45:29 +0100 Subject: [PATCH 1/4] bin/helpers: Add createPowerFlexPool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julian Pelizäus --- bin/helpers | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/helpers b/bin/helpers index 4cdcf62ab..4ab03ad1d 100644 --- a/bin/helpers +++ b/bin/helpers @@ -154,6 +154,17 @@ runsMinimumKernel() ( return 0 ) +# createPowerFlexPool: creates a new storage pool using the PowerFlex driver. +createPowerFlexPool() ( + lxc storage create "${1}" powerflex \ + powerflex.pool="${POWERFLEX_POOL}" \ + powerflex.domain="${POWERFLEX_DOMAIN}" \ + powerflex.gateway="${POWERFLEX_GATEWAY}" \ + powerflex.gateway.verify="${POWERFLEX_GATEWAY_VERIFY:-true}" \ + powerflex.user.name="${POWERFLEX_USER}" \ + powerflex.user.password="${POWERFLEX_PASSWORD}" +) + # cleanup: report if the test passed or not and return the appropriate return code. cleanup() { set +e From bf25c147c09100c7e2b5bd55ead3241c723a2f8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Peliz=C3=A4us?= Date: Mon, 5 Feb 2024 09:52:45 +0100 Subject: [PATCH 2/4] tests/storage-vm: Adapt to PowerFlex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julian Pelizäus --- tests/storage-vm | 128 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 103 insertions(+), 25 deletions(-) diff --git a/tests/storage-vm b/tests/storage-vm index 82a3bb3ef..501015a79 100755 --- a/tests/storage-vm +++ b/tests/storage-vm @@ -29,12 +29,18 @@ do lxc storage create "${poolName}" "${poolDriver}" size=60GiB lvm.use_thinpool=false elif [ "${poolDriver}" = "lvm-thin" ]; then lxc storage create "${poolName}" lvm size=20GiB + elif [ "${poolDriver}" = "powerflex" ]; then + createPowerFlexPool "${poolName}" else lxc storage create "${poolName}" "${poolDriver}" size=20GiB fi echo "==> Create VM and boot with small root" - lxc init "${TEST_IMG:-ubuntu-minimal-daily:22.04}" v1 --vm -s "${poolName}" -d root,size=4GiB + if [ "${poolDriver}" != "powerflex" ]; then + lxc init "${TEST_IMG:-ubuntu-minimal-daily:22.04}" v1 --vm -s "${poolName}" -d root,size=4GiB + else + lxc init "${TEST_IMG:-ubuntu-minimal-daily:22.04}" v1 --vm -s "${poolName}" -d root,size=8GiB + fi lxc start v1 waitInstanceReady v1 lxc info v1 @@ -57,8 +63,13 @@ do ! lxc exec v1 -- touch /srv/lxd-test || false lxc exec v1 -- umount /srv - echo "==> Checking VM root disk size is 4GiB" - [ "$(($(lxc exec v1 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "4" ] + if [ "${poolDriver}" != "powerflex" ]; then + echo "==> Checking VM root disk size is 4GiB" + [ "$(($(lxc exec v1 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "4" ] + else + echo "==> Checking VM root disk size is 8GiB" + [ "$(($(lxc exec v1 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "8" ] + fi echo "foo" | lxc exec v1 -- tee /root/foo.txt lxc exec v1 -- sync @@ -89,8 +100,13 @@ do waitInstanceReady v2 lxc exec v2 -- cat /root/foo.txt | grep -Fx "foo" - echo "==> Checking VM snapshot copy root disk size is 4GiB" - [ "$(($(lxc exec v2 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "4" ] + if [ "${poolDriver}" != "powerflex" ]; then + echo "==> Checking VM snapshot copy root disk size is 4GiB" + [ "$(($(lxc exec v2 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "4" ] + else + echo "==> Checking VM snapshot copy root disk size is 8GiB" + [ "$(($(lxc exec v2 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "8" ] + fi lxc delete -f v2 lxc delete v1/snap0 @@ -129,14 +145,23 @@ do waitInstanceReady v1 echo "==> Increasing VM root disk size for next boot" - lxc config device set v1 root size=11GiB + if [ "${poolDriver}" != "powerflex" ]; then + lxc config device set v1 root size=11GiB + else + lxc config device set v1 root size=16GiB + fi lxc config get v1 volatile.root.apply_quota | grep true lxc stop -f v1 lxc start v1 waitInstanceReady v1 - echo "==> Checking VM root disk size is 11GiB" - [ "$(($(lxc exec v1 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "11" ] + if [ "${poolDriver}" != "powerflex" ]; then + echo "==> Checking VM root disk size is 11GiB" + [ "$(($(lxc exec v1 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "11" ] + else + echo "==> Checking VM root disk size is 16GiB" + [ "$(($(lxc exec v1 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "16" ] + fi echo "==> Check VM shrink is blocked" ! lxc config device set v1 root size=10GiB || false @@ -225,7 +250,11 @@ do waitInstanceReady v1 # Hotplug disks - lxc storage volume create "${poolName}" vol1 --type=block size=10MB + if [ "${poolDriver}" != "powerflex" ]; then + lxc storage volume create "${poolName}" vol1 --type=block size=10MB + else + lxc storage volume create "${poolName}" vol1 --type=block size=8GiB + fi lxc storage volume attach "${poolName}" vol1 v1 sleep 3 lxc exec v1 -- stat -c "%F" /dev/sdb | grep "block special file" @@ -262,14 +291,24 @@ do lxc delete -f v1 echo "==> Change volume.size on pool and create VM" - lxc storage set "${poolName}" volume.size 6GiB + if [ "${poolDriver}" != "powerflex" ]; then + lxc storage set "${poolName}" volume.size 6GiB + else + # Set to something else than the default of 8GiB. + lxc storage set "${poolName}" volume.size 16GiB + fi lxc init "${TEST_IMG:-ubuntu-minimal-daily:22.04}" v1 --vm -s "${poolName}" lxc start v1 waitInstanceReady v1 lxc info v1 - echo "==> Checking VM root disk size is 6GiB" - [ "$(($(lxc exec v1 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "6" ] + if [ "${poolDriver}" != "powerflex" ]; then + echo "==> Checking VM root disk size is 6GiB" + [ "$(($(lxc exec v1 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "6" ] + else + echo "==> Checking VM root disk size is 16GiB" + [ "$(($(lxc exec v1 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "16" ] + fi echo "==> Deleting VM and reset pool volume.size" lxc delete -f v1 @@ -294,14 +333,23 @@ do echo "==> Create VM from profile with small disk size" lxc profile copy default vmsmall - lxc profile device add vmsmall root disk pool="${poolName}" path=/ size=3GiB + if [ "${poolDriver}" != "powerflex" ]; then + lxc profile device add vmsmall root disk pool="${poolName}" path=/ size=3GiB + else + lxc profile device add vmsmall root disk pool="${poolName}" path=/ size=8GiB + fi lxc init "${TEST_IMG:-ubuntu-minimal-daily:22.04}" v1 --vm -p vmsmall lxc start v1 waitInstanceReady v1 lxc info v1 - echo "==> Checking VM root disk size is 3GiB" - [ "$(($(lxc exec v1 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "3" ] + if [ "${poolDriver}" != "powerflex" ]; then + echo "==> Checking VM root disk size is 3GiB" + [ "$(($(lxc exec v1 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "3" ] + else + echo "==> Checking VM root disk size is 8GiB" + [ "$(($(lxc exec v1 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "8" ] + fi lxc stop -f v1 echo "==> Copy to different storage pool with same driver and check size" @@ -311,6 +359,8 @@ do lxc storage create "${poolName}2" "${poolDriver}" size=40GiB lvm.use_thinpool=false elif [ "${poolDriver}" = "lvm-thin" ]; then lxc storage create "${poolName}2" lvm size=20GiB + elif [ "${poolDriver}" = "powerflex" ]; then + createPowerFlexPool "${poolName}2" else lxc storage create "${poolName}2" "${poolDriver}" size=20GiB fi @@ -320,8 +370,13 @@ do waitInstanceReady v2 lxc info v2 - echo "==> Checking copied VM root disk size is 3GiB" - [ "$(($(lxc exec v2 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "3" ] + if [ "${poolDriver}" != "powerflex" ]; then + echo "==> Checking copied VM root disk size is 3GiB" + [ "$(($(lxc exec v2 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "3" ] + else + echo "==> Checking copied VM root disk size is 8GiB" + [ "$(($(lxc exec v2 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "8" ] + fi lxc delete -f v2 lxc storage delete "${poolName}2" @@ -337,19 +392,33 @@ do waitInstanceReady v2 lxc info v2 - echo "==> Checking copied VM root disk size is 3GiB" - [ "$(($(lxc exec v2 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "3" ] + if [ "${poolDriver}" != "powerflex" ]; then + echo "==> Checking copied VM root disk size is 3GiB" + [ "$(($(lxc exec v2 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "3" ] + else + echo "==> Checking copied VM root disk size is 8GiB" + [ "$(($(lxc exec v2 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "8" ] + fi lxc delete -f v2 echo "==> Grow above default volume size and copy to different storage pool" - lxc config device override v1 root size=11GiB + if [ "${poolDriver}" != "powerflex" ]; then + lxc config device override v1 root size=11GiB + else + lxc config device override v1 root size=16GiB + fi lxc copy v1 v2 -s "${poolName}2" lxc start v2 waitInstanceReady v2 lxc info v2 - echo "==> Checking copied VM root disk size is 11GiB" - [ "$(($(lxc exec v2 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "11" ] + if [ "${poolDriver}" != "powerflex" ]; then + echo "==> Checking copied VM root disk size is 11GiB" + [ "$(($(lxc exec v2 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "11" ] + else + echo "==> Checking copied VM root disk size is 16GiB" + [ "$(($(lxc exec v2 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "16" ] + fi lxc delete -f v2 lxc storage delete "${poolName}2" @@ -360,7 +429,11 @@ do lxc stop -f v1 lxc publish v1 --alias vmbig lxc delete -f v1 - lxc storage set "${poolName}" volume.size 9GiB + if [ "${poolDriver}" != "powerflex" ]; then + lxc storage set "${poolName}" volume.size 9GiB + else + lxc storage set "${poolName}" volume.size 8GiB + fi echo "==> Check VM create fails when image larger than volume.size" ! lxc init vmbig v1 --vm -s "${poolName}" || false @@ -372,8 +445,13 @@ do waitInstanceReady v1 lxc info v1 - echo "==> Checking new VM root disk size is 11GiB" - [ "$(($(lxc exec v1 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "11" ] + if [ "${poolDriver}" != "powerflex" ]; then + echo "==> Checking new VM root disk size is 11GiB" + [ "$(($(lxc exec v1 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "11" ] + else + echo "==> Checking new VM root disk size is 16GiB" + [ "$(($(lxc exec v1 -- blockdev --getsize64 /dev/sda) / GiB))" -eq "16" ] + fi echo "===> Renaming VM" lxc stop -f v1 From 133a25445deff801cd7ffa73df56719af1e44c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Peliz=C3=A4us?= Date: Mon, 5 Feb 2024 10:35:51 +0100 Subject: [PATCH 3/4] tests/storage-volumes-vm: Adapt to PowerFlex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julian Pelizäus --- tests/storage-volumes-vm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/storage-volumes-vm b/tests/storage-volumes-vm index 41efb2708..09451f1ac 100755 --- a/tests/storage-volumes-vm +++ b/tests/storage-volumes-vm @@ -32,6 +32,8 @@ do lxc storage create "${poolName}" "${poolDriver}" size=40GiB lvm.use_thinpool=false volume.size=5GB elif [ "${poolDriver}" = "lvm-thin" ]; then lxc storage create "${poolName}" lvm size=20GiB volume.size=5GB + elif [ "${poolDriver}" = "powerflex" ]; then + createPowerFlexPool "${poolName}" else lxc storage create "${poolName}" "${poolDriver}" size=20GB volume.size=5GB fi @@ -41,11 +43,19 @@ do lxc init "${TEST_IMG:-ubuntu-minimal-daily:22.04}" v2 --vm -s "${poolName}" echo "==> Create custom block volume and attach it to VM" - lxc storage volume create "${poolName}" vol1 --type=block size=10MB + if [ "${poolDriver}" != "powerflex" ]; then + lxc storage volume create "${poolName}" vol1 --type=block size=10MB + else + lxc storage volume create "${poolName}" vol1 --type=block size=8GiB + fi lxc storage volume attach "${poolName}" vol1 v1 echo "==> Create custom volume and attach it to VM" - lxc storage volume create "${poolName}" vol4 size=10MB + if [ "${poolDriver}" != "powerflex" ]; then + lxc storage volume create "${poolName}" vol4 size=10MB + else + lxc storage volume create "${poolName}" vol4 size=8GiB + fi lxc storage volume attach "${poolName}" vol4 v1 /foo echo "==> Start VM and add content to custom block volume" From 474282e1d03c6e3faf1a1b6d3793afae683917c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Peliz=C3=A4us?= Date: Mon, 5 Feb 2024 11:59:20 +0100 Subject: [PATCH 4/4] readme: Add details for running the storage tests on PowerFlex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julian Pelizäus --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 28253e6d6..39748f881 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,17 @@ Or to run individual tests (`tests/pylxd` against `latest/edge`): ./bin/openstack-run jammy default tests/pylxd latest/edge ``` +# Running Dell PowerFlex VM storage tests + +To run the VM storage tests on the Dell PowerFlex driver, provide the following environment variables: + +* `POWERFLEX_POOL`: Name of the PowerFlex storage pool +* `POWERFLEX_DOMAIN`: Name of the PowerFlex domain +* `POWERFLEX_GATEWAY`: Address of the PowerFlex HTTP gateway +* `POWERFLEX_GATEWAY_VERIFY`: Whether to verify the HTTP gateway's certificate. The default is `true`. +* `POWERFLEX_USER`: Name of the PowerFlex user +* `POWERFLEX_PASSWORD`: Password of the PowerFlex user + # Infrastructure managed by IS The PS6 environment has inbound and outbound firewalling applied at the network edge. In order to access some external sites here are the firewall rules we added to firewall maintained by IS: