-
Notifications
You must be signed in to change notification settings - Fork 42
[Draft] Add CDIUserDefinedDataImportCronOutdated runbook #307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sradco
wants to merge
1
commit into
kubevirt:main
Choose a base branch
from
sradco:fix_CDIDataImportCronOutdated_alert
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| # CDIUserDefinedDataImportCronOutdated | ||
|
|
||
| ## Meaning | ||
|
|
||
| This alert fires when `DataImportCron` cannot poll or import the latest disk | ||
| image versions. | ||
|
|
||
| `DataImportCron` polls disk images, checking for the latest versions, | ||
| and imports the images into persistent volume claims (PVCs) or | ||
| VolumeSnapshots. This process ensures that these sources are updated to | ||
| the latest version so that they can be used as reliable clone sources or | ||
| golden images for virtual machines (VMs). | ||
|
|
||
| For golden images, _latest_ refers to the latest operating system of the | ||
| distribution. For other disk images, _latest_ refers to the latest hash of the | ||
| image that is available. | ||
|
|
||
| **Note:** If the status of a `DataImportCron` PVC is `Pending` because | ||
| there is no default storage class, the | ||
| `CDIUserDefinedDataImportCronOutdated` alert is suppressed and the | ||
| `CDINoDefaultStorageClass` alert is triggered. | ||
|
|
||
| ## Impact | ||
|
|
||
| VMs might be created from outdated disk images. | ||
|
|
||
| VMs might fail to start because no boot source is available for cloning. | ||
|
|
||
| ## Diagnosis | ||
|
|
||
| 1. Check the cluster for a default Kubernetes storage class: | ||
| ```bash | ||
| $ kubectl get sc \ | ||
| -o jsonpath='{.items[?(.metadata.annotations.storageclass\.kubernetes\.io\/'\ | ||
| 'is-default-class=="true")].metadata.name}' | ||
| ``` | ||
|
|
||
| Check the cluster for a default virtualization storage class: | ||
| ```bash | ||
| $ kubectl get sc \ | ||
| -o jsonpath='{.items[?(.metadata.annotations.storageclass\.kubevirt\.io\/'\ | ||
| 'is-default-virt-class=="true")].metadata.name}' | ||
| ``` | ||
|
|
||
| The output displays the default (Kubernetes and/or virtualization) | ||
| storage class. You must either set a default storage class on the | ||
| cluster, or ask for a specific storage class in the `DataImportCron` | ||
| specification, in order for the `DataImportCron` to poll and import | ||
| golden images. If the default storage class does not exist, the | ||
| created import DataVolume and PVC will be in `Pending` phase. | ||
|
|
||
| 2. List the `DataImportCron` objects that are not up-to-date: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe add here how outputs should look like |
||
|
|
||
| ```bash | ||
| $ kubectl get dataimportcron -A \ | ||
| -o jsonpath='{range .items[*]}{.status.conditions[?(@.type=="UpToDate")]'\ | ||
| '.status}{"\t"}{.metadata.namespace}{"/"}{.metadata.name}{"\n"}{end}' \ | ||
| | grep False | ||
| ``` | ||
|
|
||
| 3. If a default storage class is not defined on the cluster, check the | ||
| `DataImportCron` specification for a `DataVolume` template storage class: | ||
|
|
||
| ```bash | ||
| $ kubectl -n <namespace> get dataimportcron <dataimportcron> \ | ||
| -o jsonpath='{.spec.template.spec.storage.storageClassName}{"\n"}' | ||
| ``` | ||
|
|
||
| 4. Obtain the name of the `DataVolume` associated with the `DataImportCron` | ||
| object: | ||
|
|
||
| ```bash | ||
| $ kubectl -n <namespace> get dataimportcron <dataimportcron> \ | ||
| -o jsonpath='{.status.lastImportedPVC.name}{"\n"}' | ||
| ``` | ||
|
|
||
| 5. Check the `DataVolume` status: | ||
|
|
||
| ```bash | ||
| $ kubectl -n <namespace> get dv <datavolume> \ | ||
| -o jsonpath-as-json='{.status}' | ||
| ``` | ||
|
|
||
| 6. Set the `CDI_NAMESPACE` environment variable: | ||
|
|
||
| ```bash | ||
| $ export CDI_NAMESPACE="$(kubectl get deployment -A \ | ||
| -o jsonpath='{.items[?(.metadata.name=="cdi-operator")]'\ | ||
| '.metadata.namespace}')" | ||
| ``` | ||
|
|
||
| 7. Check the `cdi-deployment` log for error messages: | ||
|
|
||
| ```bash | ||
| $ kubectl logs -n $CDI_NAMESPACE deployment/cdi-deployment | ||
| ``` | ||
|
|
||
| ## Mitigation | ||
|
|
||
| 1. Set a default storage class, either on the cluster or in the | ||
| `DataImportCron` specification, to poll and import golden images. The | ||
| updated Containerized Data Importer (CDI) should resolve the issue | ||
| within a few seconds. | ||
|
|
||
| 2. If the issue does not resolve itself, or, if you have changed the | ||
| default storage class in the cluster, you must delete the existing boot | ||
| sources (data volumes or volume snapshots) in the cluster namespace that | ||
| are configured with the previous default storage class. The CDI will | ||
| recreate the data volumes with the newly configured default storage | ||
| class. | ||
|
|
||
| 3. If your cluster is installed in a restricted network environment, disable the | ||
| `enableCommonBootImageImport` feature gate in order to opt out of automatic | ||
| updates: | ||
|
|
||
| ```bash | ||
| $ kubectl patch hco kubevirt-hyperconverged -n $CDI_NAMESPACE \ | ||
| --type json \ | ||
| -p '[{"op": "replace", "path": "/spec/featureGates/'\ | ||
| 'enableCommonBootImageImport", "value": false}]' | ||
| ``` | ||
|
|
||
| <!--DS: If you cannot resolve the issue, log in to the | ||
| link:https://access.redhat.com[Customer Portal] and open a support case, | ||
| attaching the artifacts gathered during the diagnosis procedure.--> | ||
| <!--USstart--> | ||
| See the [HCO cluster configuration documentation]( | ||
| https://github.com/kubevirt/hyperconverged-cluster-operator/blob/main/docs/cluster-configuration.md#enablecommonbootimageimport-feature-gate) | ||
| for more information. | ||
|
|
||
| If you cannot resolve the issue, see the following resources: | ||
|
|
||
| - [OKD Help](https://okd.io/docs/community/help/) | ||
| - [#virtualization Slack channel](https://kubernetes.slack.com/channels/virtualization) | ||
| <!--USend--> | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add here that it's only for user defined