Skip to content

Commit

Permalink
Merge pull request #474 from rackerlabs/PUC-551-20241113-1
Browse files Browse the repository at this point in the history
feat: set raid config during ironic baremetal node enroll
  • Loading branch information
nicholaskuechler authored Nov 13, 2024
2 parents 583969e + ead12b5 commit 413b004
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions workflows/argo-events/workflowtemplates/enroll-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ spec:
parameters:
- name: device_id
value: "{{steps.enroll-server.outputs.result}}"
- - name: openstack-set-baremetal-node-raid-config
template: openstack-set-baremetal-node-raid-config
arguments:
parameters:
- name: device_id
value: "{{steps.enroll-server.outputs.result}}"
- - name: manage-server
template: openstack-wait-cmd
arguments:
Expand Down Expand Up @@ -109,6 +115,45 @@ spec:
- name: openstack-svc-acct
secret:
secretName: openstack-svc-acct
- name: openstack-set-baremetal-node-raid-config
inputs:
parameters:
- name: device_id
# https://rackerlabs.github.io/understack/user-guide/openstack-ironic/#setting-baremetal-node-flavor
script:
image: ghcr.io/rackerlabs/understack/openstack-client:2024.2-ubuntu_jammy
command: [sh]
source: |
echo "setting RAID1 config for node: {{inputs.parameters.device_id}}"
# create the raid1-config.json file. I find this easier to read
# than passing a big json string on command line
cat <<'EOF' >> raid1-config.json
{ "logical_disks":
[ { "controller": "RAID.SL.1-1",
"is_root_volume": true,
"physical_disks": [
"Disk.Bay.0:Enclosure.Internal.0-1:RAID.SL.1-1",
"Disk.Bay.1:Enclosure.Internal.0-1:RAID.SL.1-1"
],
"raid_level": "1",
"size_gb": "MAX"
}
]
}
EOF
# apply the target raid config to the node
openstack baremetal node set {{inputs.parameters.device_id}} --target-raid-config raid1-config.json
env:
- name: OS_CLOUD
value: understack
volumeMounts:
- mountPath: /etc/openstack
name: openstack-svc-acct
readOnly: true
volumes:
- name: openstack-svc-acct
secret:
secretName: openstack-svc-acct
- name: openstack-state-cmd
inputs:
parameters:
Expand Down

0 comments on commit 413b004

Please sign in to comment.