Skip to content

ocp4_workload_openshift_virtualization: make the boot source format configurable, opt-in - #202

Merged
wkulhanek merged 2 commits into
mainfrom
boot_sources_snapshot_symmetric
Nov 12, 2026
Merged

wkulhanek merged 2 commits into
mainfrom
boot_sources_snapshot_symmetric

Conversation

@wkulhanek

@wkulhanek wkulhanek commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

ocp4_workload_openshift_virtualization_boot_sources_snapshot defaulted to true, which reads as "store boot sources as VolumeSnapshots". It did not do that. The whole block was gated on when: not ...boot_sources_snapshot | bool and the only StorageProfile patch inside it was dataImportCronSourceFormat: pvc. With the default true the role patched nothing, and the cluster silently kept CDI's own default, which is pvc.

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):

time for a VM to reach Running
dataImportCronSourceFormat: pvc 13-15 min
dataImportCronSourceFormat: snapshot ~80 s

With 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:

value StorageProfile HyperConverged at creation
unset (new default) not touched, CDI decides import enabled
true dataImportCronSourceFormat: snapshot import enabled
false dataImportCronSourceFormat: pvc import deferred, enabled after the patch

Across 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, both false). 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. true for all would patch them to snapshot, which is wrong for any Ceph-backed item relying on the default; false for all would patch them to pvc and, through the template, create HyperConverged with enableCommonBootImageImport: 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] with default_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

ocp4_workload_openshift_virtualization_boot_sources_snapshot: true

Recommended for any lab on CSI storage where users create VMs from boot sources. rhpds/agnosticv#29040 adds it to LB1066.

Verification

  • ansible-lint clean on the role, profile production, 0 failures
  • Under ansible-core 2.22, for null / true / false / "true" / "false": block runs only when not null, format resolves to snapshot / pvc correctly, and string values coerce the same as booleans
  • The real template rendered for all four states including undefined: enableCommonBootImageImport is true for unset, undefined and true, and false only for an explicit false
  • snapshot format applied by hand to a live AWS cluster produced the 80 s result above, restoring from the persistent snapshot with no tmp-snapshot-* created

… 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.
…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.
@wkulhanek wkulhanek changed the title ocp4_workload_openshift_virtualization: set the boot source format in both directions ocp4_workload_openshift_virtualization: make the boot source format configurable, opt-in Nov 12, 2026
@wkulhanek
wkulhanek merged commit ee3c41d into main Nov 12, 2026
1 check passed
@wkulhanek
wkulhanek deleted the boot_sources_snapshot_symmetric branch November 12, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants