Skip to content

Commit

Permalink
NO-ISSUE Add VM_EXTRADISKS_LIST and VM_EXTRADISKS_SIZE
Browse files Browse the repository at this point in the history
This PR adds the ability to configure VM_EXTRADISKS_LIST and
VM_EXTRADISKS_SIZE that are required by the Assisted Service
to deploy the Local Storage Operator.

Configuration of the extra disks is automatically picked by the script
so that `storageClassDevices` in the `LocalVolume` manifest is filled
correctly with all the additional drives and does not require a manual
modification.

Co-authored-by: Lisa Rashidi-Ranjbar <[email protected]>
  • Loading branch information
mkowalski and lranjbar committed May 25, 2021
1 parent 1f185dd commit 03d20a3
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
19 changes: 16 additions & 3 deletions assisted_deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,28 @@ spec:
logLevel: Normal
managementState: Managed
storageClassDevices:
- devicePaths:
- /dev/sdb
- /dev/sdc
$(storage_devices_config)
storageClassName: assisted-service
volumeMode: Filesystem
EOCR
}


function storage_devices_config() {
if [ ! -z "${VM_EXTRADISKS_LIST}" ]; then
cat <<EOF
- devicePaths:
EOF
fi

for disk in ${VM_EXTRADISKS_LIST}; do
cat <<EOF
- /dev/$disk
EOF
done
}


function deploy_hive() {
echo "Installing Hive..."

Expand Down
2 changes: 2 additions & 0 deletions common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ export NUM_WORKERS=${NUM_WORKERS:-"2"}
export NUM_EXTRA_WORKERS=${NUM_EXTRA_WORKERS:-"0"}
export EXTRA_WORKERS_ONLINE_STATUS=${EXTRA_WORKERS_ONLINE_STATUS:-"true"}
export VM_EXTRADISKS=${VM_EXTRADISKS:-"false"}
export VM_EXTRADISKS_LIST=${VM_EXTRADISKS_LIST:-"vdb"}
export VM_EXTRADISKS_SIZE=${VM_EXTRADISKS_SIZE:-"8G"}
export MASTER_HOSTNAME_FORMAT=${MASTER_HOSTNAME_FORMAT:-"master-%d"}
export WORKER_HOSTNAME_FORMAT=${WORKER_HOSTNAME_FORMAT:-"worker-%d"}

Expand Down
10 changes: 10 additions & 0 deletions config_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,16 @@ set -x
#export WORKER_DISK=20
#export WORKER_VCPU=4

# Add extradisks to VMs
# export VM_EXTRADISKS=true

# Configure how many extra disks to add to VMs. Takes a string of disk
# names delimited by spaces. Example "vdb vdc"
# export VM_EXTRADISKS_LIST="vdb vdc"

# Configure size of extra disks added to VMs
# export VM_EXTRADISKS_SIZE="10G"

# Provide additional master/worker ignition configuration, will be
# merged with the installer provided config, can be used to modify
# the default nic configuration etc
Expand Down
2 changes: 2 additions & 0 deletions vm_setup_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ironic_prefix: "{{ ironic_prefix }}"
# in metal3-dev-env
num_masters: 3
num_workers: 1
extradisks_list: "{{ lookup('env', 'VM_EXTRADISKS_LIST').split(' ') | default(['vdb']) }}"
extradisks_size: "{{ lookup('env', 'VM_EXTRADISKS_SIZE') | default(['8G']) }}"
flavors:
master:
memory: "{{ lookup('env', 'MASTER_MEMORY') | default('16384', true) }}"
Expand Down

0 comments on commit 03d20a3

Please sign in to comment.