cpe-deployments/scripts/post-deployment/02-create-host-types.sh

28 lines
719 B
Bash
Raw Normal View History

2021-10-29 09:57:19 +01:00
#!/bin/bash
# Name Description Compute Nodes
# default 2:1 CPU 04,05,06
declare -A COMPUTE_NODES
COMPUTE_NODES=(
["default"]="04 05 06"
)
NODE_NAME_PREFIX="node0"
for aggregate in "${!COMPUTE_NODES[@]}"; do
# Create aggregate
echo "Creating host aggregate ${aggregate}..."
openstack aggregate create \
--property host_aggregate=${aggregate} \
${aggregate}
# Add COMPUTE_NODES to the host aggregate
for node in ${COMPUTE_NODES[$aggregate]}; do
echo "Adding node ${NODE_NAME_PREFIX}${node} to host aggregate ${aggregate}..."
openstack aggregate add host ${aggregate} ${NODE_NAME_PREFIX}${node}
done
done