diff --git a/runbooks/CDIDefaultStorageClassDegraded.md b/runbooks/CDIDefaultStorageClassDegraded.md new file mode 100644 index 00000000..7c8d33ee --- /dev/null +++ b/runbooks/CDIDefaultStorageClassDegraded.md @@ -0,0 +1,51 @@ +# CDIDefaultStorageClassDegraded + + +## 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. + + +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) + \ No newline at end of file diff --git a/runbooks/CDINoDefaultStorageClass.md b/runbooks/CDINoDefaultStorageClass.md new file mode 100644 index 00000000..ac9267db --- /dev/null +++ b/runbooks/CDINoDefaultStorageClass.md @@ -0,0 +1,45 @@ +# CDINoDefaultStorageClass + + +## 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 -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' +``` + +To set the default virtualization storage class if needed: +```bash +$ kubectl patch storageclass -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. + + +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) + \ No newline at end of file diff --git a/runbooks_index.md b/runbooks_index.md index a8122145..a4ab2106 100644 --- a/runbooks_index.md +++ b/runbooks_index.md @@ -46,10 +46,12 @@ - [OutdatedVirtualMachineInstanceWorkloads.md](runbooks/OutdatedVirtualMachineInstanceWorkloads.md) - [KubeMacPoolDuplicateMacsFound.md](runbooks/KubeMacPoolDuplicateMacsFound.md) - [CDINotReady.md](runbooks/CDINotReady.md) +- [CDINoDefaultStorageClass.md](runbooks/CDINoDefaultStorageClass.md) - [LowVirtControllersCount.md](runbooks/LowVirtControllersCount.md) - [LowReadyVirtControllersCount.md](runbooks/LowReadyVirtControllersCount.md) - [VirtApiRESTErrorsHigh.md](runbooks/VirtApiRESTErrorsHigh.md) - [KubeVirtNoAvailableNodesToRunVMs.md](runbooks/KubeVirtNoAvailableNodesToRunVMs.md) +- [CDIDefaultStorageClassDegraded.md](runbooks/CDIDefaultStorageClassDegraded.md) - [KubeVirtVMIExcessiveMigrations.md](runbooks/KubeVirtVMIExcessiveMigrations.md) - [NoReadyVirtController.md](runbooks/NoReadyVirtController.md) - [SSPTemplateValidatorDown.md](runbooks/SSPTemplateValidatorDown.md)