-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build: (0936a0f) Add CDI default storage class alert runbooks
CDINoDefaultStorageClass & CDIDefaultStorageClassDegraded. Signed-off-by: Arnon Gilboa <[email protected]>
- Loading branch information
Showing
3 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,51 @@ | ||
# CDIDefaultStorageClassDegraded | ||
<!-- Edited by agilboa, 6 Dec 2023 --> | ||
|
||
## Meaning | ||
|
||
This alert fires when the default (Kubernetes or virtualization) storage class supports smart clone (either CSI or snapshot based) and ReadWriteMany. | ||
|
||
A default virtualization storage class has precedence over a default Kubernetes storage class for creating a VirtualMachine disk image. | ||
|
||
## Impact | ||
|
||
If the default storage class does not support smart clone, we fallback to host-assisted cloning, which is the least efficient method of cloning. | ||
|
||
If the default storage class does not suppprt ReadWriteMany, a virtual machine using it is not live-migratable. | ||
|
||
## Diagnosis | ||
|
||
Get the default virtualization storage class: | ||
```bash | ||
$ export CDI_DEFAULT_VIRT_SC="$(kubectl get sc -o json | jq -r '.items[].metadata|select(.annotations."storageclass.kubevirt.io/is-default-virt-class"=="true")|.name')" | ||
$ echo default_virt_sc=$CDI_DEFAULT_VIRT_SC | ||
``` | ||
|
||
If the default virtualization storage class is set, check if it supports ReadWriteMany | ||
```bash | ||
$ kubectl get storageprofile $CDI_DEFAULT_VIRT_SC -o json | jq '.status.claimPropertySets'| grep ReadWriteMany | ||
``` | ||
|
||
Otherwise, if the default virtualization storage class is not set, get the default Kubernetes storage class: | ||
```bash | ||
$ export CDI_DEFAULT_K8S_SC="$(kubectl get sc -o json | jq -r '.items[].metadata|select(.annotations."storageclass.kubernetes.io/is-default-class"=="true")|.name')" | ||
$ echo default_k8s_sc=$CDI_DEFAULT_K8S_SC | ||
``` | ||
|
||
If the default Kubernetes storage class is set, check if it supports ReadWriteMany: | ||
```bash | ||
$ kubectl get storageprofile $CDI_DEFAULT_K8S_SC -o json | jq '.status.claimPropertySets'| grep ReadWriteMany | ||
``` | ||
|
||
See [doc](https://github.com/kubevirt/containerized-data-importer/blob/main/doc/efficient-cloning.md) for details about smart clone prerequisites. | ||
|
||
## Mitigation | ||
|
||
Ensure that the default storage class supports smart clone and ReadWriteMany. | ||
|
||
<!--USstart--> | ||
If you cannot resolve the issue, see the following resources: | ||
|
||
- [OKD Help](https://www.okd.io/help/) | ||
- [#virtualization Slack channel](https://kubernetes.slack.com/channels/virtualization) | ||
<!--USend--> |
This file contains 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,45 @@ | ||
# CDINoDefaultStorageClass | ||
<!-- Edited by agilboa, 6 Dec 2023 --> | ||
|
||
## Meaning | ||
|
||
This alert fires when there is no default (Kubernetes or virtualization) storage class, and a data volume is pending for one. | ||
|
||
A default virtualization storage class has precedence over a default Kubernetes storage class for creating a VirtualMachine disk image. | ||
|
||
## Impact | ||
|
||
If there is no default (k8s or virt) storage class, a data volume that requests a default storage class (storage class not explicitly specified) will be pending for one. | ||
|
||
## Diagnosis | ||
|
||
Get the default Kubernetes storage class: | ||
```bash | ||
$ kubectl get sc -o json | jq '.items[].metadata|select(.annotations."storageclass.kubernetes.io/is-default-class"=="true")|.name' | ||
``` | ||
|
||
Get the default virtualization storage class: | ||
```bash | ||
$ kubectl get sc -o json | jq '.items[].metadata|select(.annotations."storageclass.kubevirt.io/is-default-virt-class"=="true")|.name' | ||
``` | ||
|
||
To set the default Kubernetes storage class if needed: | ||
```bash | ||
$ kubectl patch storageclass <storage-class-name> -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' | ||
``` | ||
|
||
To set the default virtualization storage class if needed: | ||
```bash | ||
$ kubectl patch storageclass <storage-class-name> -p '{"metadata": {"annotations":{"storageclass.kubevirt.io/is-default-virt-class":"true"}}}' | ||
``` | ||
|
||
## Mitigation | ||
|
||
Ensure that there is one storage class that has the default (k8s or virt) storage class annotation. | ||
|
||
<!--USstart--> | ||
If you cannot resolve the issue, see the following resources: | ||
|
||
- [OKD Help](https://www.okd.io/help/) | ||
- [#virtualization Slack channel](https://kubernetes.slack.com/channels/virtualization) | ||
<!--USend--> |
This file contains 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