fix(vm): secureboot vm no default storageclass#2614
Open
danilrwx wants to merge 2 commits into
Open
Conversation
222514e to
42aff7c
Compare
…torageClass SecureBoot VMs need a StorageClass for the persistent NVRAM backend-storage PVC. When the module has a default storage class for virtual disks but the cluster has no default k8s StorageClass, KubeVirt could not resolve one and the VM failed to start. Render configuration.vmStateStorageClass from virtualDisks.defaultStorageClassName so backend-storage resolves the module default when set. Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
…ult storage class SecureBoot VMs set EFI.Persistent=true, so KubeVirt provisions a backend storage PVC for NVRAM. Without a default StorageClass its creation fails with "no default storage class found" on the internal VMI Synchronized condition (reason FailedBackendStorageCreate), which the VM controller did not recognize — the VM stalled in Starting with no explanation. Recognize the FailedBackendStorageCreate reason so the VM moves to Pending and relays the underlying message on its Running condition. Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
42aff7c to
277d228
Compare
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.
Description
A SecureBoot virtual machine stores its firmware state in a persistent volume, which needs a StorageClass. KubeVirt only looked at the cluster-wide default StorageClass, so on clusters that rely on the module's own default storage class for virtual disks the volume could not be created and the VM never started — with no reason shown on the VirtualMachine.
Now that module default storage class is also used for the firmware state, and if no storage class can be resolved anywhere, the VirtualMachine reports a clear reason instead of staying pending silently.
Why do we need it, and what problem does it solve?
Enabling SecureBoot without a cluster-wide default StorageClass was a dead end: the VM never started and nothing on the VirtualMachine explained why. Now it works when the module has a default disk storage class, and explains itself when a storage class truly cannot be found.
What is the expected result?
Runningcondition turnsFalsewith a message ending inno default storage class found, and starts automatically once one appears.Checklist
Changelog entries