Repository navigation
ocp4_workload_openshift_virtualization: make the boot source format configurable, opt-in - #202
Merged
Merged
Conversation
… both directions ocp4_workload_openshift_virtualization_boot_sources_snapshot defaulted to true but only did something when false, patching the StorageProfile to pvc. With true the role patched nothing and the cluster silently kept CDI's own default of pvc, so every VM cloned from a boot source first had to snapshot the source PVC. On AWS EBS that is 13-15 minutes per VM; with the snapshot format set it is under 90 seconds. Run the block unconditionally and set the format from the variable. Also replace default_sc[0] with first/default so the existing 'no default storage class' abort reports its message instead of raising an index error, now that the block runs on every deployment.
wkulhanek
requested review from
fridim,
rut31337 and
stencell
as code owners
November 12, 2026 13:02
…pt-in Default the variable to null so the StorageProfile is left alone unless a config asks for a format. Flipping the default either way would have moved the 43 catalog items that never set it into an active branch: - true for all would patch them to snapshot - false for all would patch them to pvc and, through the template, create HyperConverged with enableCommonBootImageImport disabled With null they keep today's behaviour exactly - no StorageProfile patch and the import enabled at creation. The two items that set false are unaffected. Items that want fast clones on CSI storage opt in with true.
stencell
reviewed
Nov 12, 2026
stencell
approved these changes
Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ocp4_workload_openshift_virtualization_boot_sources_snapshotdefaulted totrue, which reads as "store boot sources as VolumeSnapshots". It did not do that. The whole block was gated onwhen: not ...boot_sources_snapshot | booland the only StorageProfile patch inside it wasdataImportCronSourceFormat: pvc. With the defaulttruethe role patched nothing, and the cluster silently kept CDI's own default, which ispvc.The consequence on CSI storage is that every VM cloned from a boot source must first create a snapshot of the 30Gi source PVC. Measured on an AWS cluster (
gp3-csi,ebs.csi.aws.com):dataImportCronSourceFormat: pvcdataImportCronSourceFormat: snapshotWith
snapshot, the DataImportCron keeps each image as a VolumeSnapshot once and a new VM restores straight from it, so no per-VM snapshot is created at all.Change
The variable becomes three-state and defaults to unset, so this PR changes behaviour for no existing catalog item:
truedataImportCronSourceFormat: snapshotfalsedataImportCronSourceFormat: pvcAcross agnosticv, 45 catalog items use this workload and 2 set the variable (
rh1-2027/lb1543-ocp-ops-day-cnv,rh1-2027/lb2076-ocp5-virt-infra, bothfalse). Those two keep their exact current path. The other 43 leave it unset and keep theirs: no StorageProfile patch, import enabled at creation.Flipping the default in either direction was considered and rejected - both would have moved those 43 into an active branch.
truefor all would patch them tosnapshot, which is wrong for any Ceph-backed item relying on the default;falsefor all would patch them topvcand, through the template, create HyperConverged withenableCommonBootImageImport: false, adding a window where boot images never import if the play fails before the enabling patch.Making fast clones the default is still worth doing, but as a separate deliberate change once someone has audited which items are Ceph-backed.
Also replaces
default_sc[0]withdefault_sc | first | default('', true), so the existing "No default storage class found" abort reports its message instead of raising an index error first.Opting in
Recommended for any lab on CSI storage where users create VMs from boot sources. rhpds/agnosticv#29040 adds it to LB1066.
Verification
ansible-lintclean on the role, profileproduction, 0 failuresnull/true/false/"true"/"false": block runs only when not null, format resolves tosnapshot/pvccorrectly, and string values coerce the same as booleansenableCommonBootImageImportistruefor unset, undefined andtrue, andfalseonly for an explicitfalsesnapshotformat applied by hand to a live AWS cluster produced the 80 s result above, restoring from the persistent snapshot with notmp-snapshot-*created