Skip to content

Commit 3ae8ee4

Browse files
Merge pull request #202 from jacobweinstock/librvirt-storage
Handle create/delete of storage pool for bootMode iso: ## Description <!--- Please describe what this PR is going to change --> 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. ## Why is this needed <!--- Link to issue you have raised --> Fixes: # ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> ## How are existing users impacted? What migration steps/scripts do we need? <!--- Fixes a bug, unblocks installation, removes a component of the stack etc --> <!--- Requires a DB migration script, etc. --> ## Checklist: I have: - [ ] updated the documentation and/or roadmap (if required) - [ ] added unit or e2e tests - [ ] provided instructions on how to upgrade
2 parents db84082 + 891010d commit 3ae8ee4

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

capt/Taskfile.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ tasks:
1919
create-playground:
2020
silent: true
2121
summary: |
22-
Create the CAPT playground. Use the .playground file to define things like cluster size and Kubernetes version.
22+
Create the CAPT playground. Use the config.yaml file to define things like cluster size and Kubernetes version.
2323
cmds:
2424
- task: system-deps-warnings
2525
- task: validate-binaries

capt/config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ counts:
99
versions:
1010
capt: v0.6.1
1111
chart: 0.6.1
12-
kube: v1.28.9
12+
kube: v1.29.4
1313
os: 20.04
1414
kubevip: 0.8.7
1515
capt:

capt/tasks/Taskfile-create.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ tasks:
2121
- task: bmc-secret
2222
- task: vms
2323
- task: vbmc:start-vbmcs
24+
- task: default-storage-pool
2425
- task: apply-bmc-secret
2526
- task: apply-bmc-machines
2627
- task: apply-hardware
@@ -240,3 +241,12 @@ tasks:
240241
- echo "Workload cluster kubeconfig saved to {{.OUTPUT_DIR}}/{{.CLUSTER_NAME}}.kubeconfig."
241242
status:
242243
- echo ; [ -f {{.OUTPUT_DIR}}/{{.CLUSTER_NAME}}.kubeconfig ]
244+
245+
default-storage-pool:
246+
summary: |
247+
Create the default storage pool for the redfish emulator to work properly.
248+
cmds:
249+
- virsh --connect qemu:///system pool-define-as --name default --type dir --target /tmp/iso
250+
- virsh --connect qemu:///system pool-start --build default
251+
status:
252+
- virsh --connect qemu:///system pool-info default

capt/tasks/Taskfile-delete.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ tasks:
99
- task: vbmc-container
1010
- task: vbmc-generated-files
1111
- task: vms
12+
- task: default-storage-pool
1213
- task: output-dir
1314

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

42+
default-storage-pool:
43+
summary: |
44+
Delete the default storage pool.
45+
cmds:
46+
- 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
47+
- virsh --connect qemu:///system pool-destroy default || true
48+
- virsh --connect qemu:///system pool-undefine default
49+
status:
50+
- (! virsh --connect qemu:///system pool-info default )
51+
4152
vbmc-container:
4253
summary: |
4354
Delete the Virtual BMC container.

0 commit comments

Comments
 (0)