[nova][ironic] Support configuring 1 shard on n-cpu

Allows for testing of basic sharding configuration.

Change-Id: Idfb2bd1822898d95af8643d69d97d9a76b4d64cc
Needed-By: https://review.opendev.org/c/openstack/ironic/+/894460
This commit is contained in:
Jay Faulkner 2023-09-10 16:24:38 -07:00
parent d51a6b9a11
commit e1297193dc
2 changed files with 10 additions and 0 deletions

View File

@ -1114,6 +1114,12 @@ function is_ironic_enforce_scope {
return 1
}
function is_ironic_sharded {
# todo(JayF): Support >1 shard with multiple n-cpu instances for each
is_service_enabled ironic && [[ "$IRONIC_SHARDS" == "1" ]] && return 0
return 1
}
# Package Functions
# =================

View File

@ -53,6 +53,10 @@ function configure_nova_hypervisor {
iniset $NOVA_CONF ironic project_domain_id default
iniset $NOVA_CONF ironic project_name demo
fi
if is_ironic_sharded; then
iniset $NOVA_CONF ironic shard $IRONIC_SHARD_1_NAME
fi
iniset $NOVA_CONF ironic user_domain_id default
iniset $NOVA_CONF ironic region_name $REGION_NAME