diff --git a/devstack/lib/ironic b/devstack/lib/ironic index e01ada2577..efb0801d1b 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -111,6 +111,14 @@ IRONIC_HW_NODE_DISK=${IRONIC_HW_NODE_DISK:-10} IRONIC_HW_EPHEMERAL_DISK=${IRONIC_HW_EPHEMERAL_DISK:-0} IRONIC_HW_ARCH=${IRONIC_HW_ARCH:-x86_64} +# Deploy Ironic Nodes & configure n-cpu for sharding +# Currently only supports 0 (old behavior) or 1 (adds all nodes +# to the same shard). You can still use this with multinode to +# get multiple shards in one Ironic install. +# IRONIC_SHARD_1_NAME + IRONIC_SHARDS will also configure n-cpu +IRONIC_SHARDS=${IRONIC_SHARDS:-0} +IRONIC_SHARD_1_NAME=${IRONIC_SHARD_1_NAME:-ds_shard_1} + # The file is composed of multiple lines, each line includes fields # separated by white space, in the format: # @@ -699,6 +707,10 @@ if [[ "$IRONIC_BOOT_MODE" == "uefi" ]]; then fi fi +if [[ "$IRONIC_SHARDS" != "0" ]] && [[ "$IRONIC_SHARDS" != "1" ]]; then + die $LINENO "Only support 0 or 1 shards at this time." +fi + # TODO(pas-ha) find a way to (cross-)sign the custom CA bundle used by tls-proxy # with default iPXE cert - for reference see http://ipxe.org/crypto if is_service_enabled tls-proxy && [[ "$IRONIC_IPXE_USE_SWIFT" == "True" ]]; then @@ -2643,6 +2655,10 @@ function enroll_nodes { root_device='{"vendor": "0x1af4"}' fi + if [[ $IRONIC_SHARDS == "1" ]]; then + openstack --os-cloud devstack-system-admin baremetal node set $node_id --shard $IRONIC_SHARD_1_NAME + fi + # In case we using portgroups, we should API version that support them. # Othervise API will return 406 ERROR # NOTE(vsaienko) interface_info is in the following format here: diff --git a/zuul.d/ironic-jobs.yaml b/zuul.d/ironic-jobs.yaml index e922ee2211..4df51d06d4 100644 --- a/zuul.d/ironic-jobs.yaml +++ b/zuul.d/ironic-jobs.yaml @@ -284,6 +284,8 @@ IRONIC_BOOT_MODE: bios # Make sure this feature works even with the minumum implementation IRONIC_REDFISH_EMULATOR_FEATURE_SET: minimum + # Test sharding support + IRONIC_SHARDS: 1 devstack_services: # Parent job uses swift, this one does not, thus we can turn it off. s-account: False @@ -742,6 +744,25 @@ q-ovn-metadata-agent: False n-cpu: True +- job: + # NOTE(JayF) This job sets up two nova-computes with two different shards + # TODO(JayF) Add a post-run validation to ensure the two n-cpus did not + # see each others' nodes + name: ironic-tempest-ipa-wholedisk-direct-tinyipa-multinode-shard + description: ironic-tempest-ipa-wholedisk-direct-tinyipa-multinode-shard + parent: ironic-tempest-ipa-wholedisk-direct-tinyipa-multinode + nodeset: openstack-two-node-jammy + vars: + tempest_test_regex: "BaremetalBasicOps" + devstack_localrc: + IRONIC_SHARDS: 1 + IRONIC_SHARD_1_NAME: "main-node" + group-vars: + subnode: + devstack_localrc: + IRONIC_SHARDS: 1 + IRONIC_SHARD_1_NAME: "subnode" + - job: name: ironic-tox-unit-with-driver-libs parent: openstack-tox diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 61351b19a1..9969c32ad3 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -40,6 +40,8 @@ # understand it in mind for the upcoming release. - ironic-tempest-ipa-wholedisk-direct-tinyipa-multinode: voting: false + - ironic-tempest-ipa-wholedisk-direct-tinyipa-multinode-shard: + voting: false - ironic-tempest-bios-ipmi-direct-tinyipa - ironic-tempest-bfv - ironic-tempest-ipa-partition-uefi-pxe-grub2