Skip to content

Commit

Permalink
Handle create/delete of storage pool for bootMode iso:
Browse files Browse the repository at this point in the history
In the bootMode: iso, the redfish emulator needs a storage
location named "default" to exist for media mounting.
So we create it. To clean it up, we need to delete all
the ISO files that get put into there.

Signed-off-by: Jacob Weinstock <[email protected]>
  • Loading branch information
jacobweinstock committed Dec 6, 2024
1 parent db84082 commit 839bc1f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion capt/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tasks:
create-playground:
silent: true
summary: |
Create the CAPT playground. Use the .playground file to define things like cluster size and Kubernetes version.
Create the CAPT playground. Use the config.yaml file to define things like cluster size and Kubernetes version.
cmds:
- task: system-deps-warnings
- task: validate-binaries
Expand Down
2 changes: 1 addition & 1 deletion capt/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ counts:
versions:
capt: v0.6.1
chart: 0.6.1
kube: v1.28.9
kube: v1.29.4
os: 20.04
kubevip: 0.8.7
capt:
Expand Down
10 changes: 10 additions & 0 deletions capt/tasks/Taskfile-create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ tasks:
- task: bmc-secret
- task: vms
- task: vbmc:start-vbmcs
- task: default-storage-pool
- task: apply-bmc-secret
- task: apply-bmc-machines
- task: apply-hardware
Expand Down Expand Up @@ -240,3 +241,12 @@ tasks:
- echo "Workload cluster kubeconfig saved to {{.OUTPUT_DIR}}/{{.CLUSTER_NAME}}.kubeconfig."
status:
- echo ; [ -f {{.OUTPUT_DIR}}/{{.CLUSTER_NAME}}.kubeconfig ]

default-storage-pool:
summary: |
Create the default storage pool for the redfish emulator to work properly.
cmds:
- virsh --connect qemu:///system pool-define-as --name default --type dir --target /tmp/iso
- virsh --connect qemu:///system pool-start --build default
status:
- virsh --connect qemu:///system pool-info default
11 changes: 11 additions & 0 deletions capt/tasks/Taskfile-delete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ tasks:
- task: vbmc-container
- task: vbmc-generated-files
- task: vms
- task: default-storage-pool
- task: output-dir

kind-cluster:
Expand Down Expand Up @@ -38,6 +39,16 @@ tasks:
status:
- got=$(virsh --connect qemu:///system list --all --name | grep -ce "{{.VM_BASE_NAME}}*" || :); [[ "$got" == "0" ]]

default-storage-pool:
summary: |
Delete the default storage pool.
cmds:
- for vol in $(virsh --connect qemu:///system -q vol-list default | xargs | cut -d " " -f1,3,5,7,9); do virsh --connect qemu:///system vol-delete --pool default $vol; done
- virsh --connect qemu:///system pool-destroy default || true
- virsh --connect qemu:///system pool-undefine default
status:
- (! virsh --connect qemu:///system pool-info default )

vbmc-container:
summary: |
Delete the Virtual BMC container.
Expand Down

0 comments on commit 839bc1f

Please sign in to comment.