Skip to content

Commit

Permalink
Build: (0936a0f) Add CDI default storage class alert runbooks
Browse files Browse the repository at this point in the history
CDINoDefaultStorageClass & CDIDefaultStorageClassDegraded.

Signed-off-by: Arnon Gilboa <[email protected]>
  • Loading branch information
sradco committed Dec 6, 2023
1 parent 6499f7f commit 34a31ac
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 0 deletions.
51 changes: 51 additions & 0 deletions runbooks/CDIDefaultStorageClassDegraded.md
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-->
45 changes: 45 additions & 0 deletions runbooks/CDINoDefaultStorageClass.md
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-->
2 changes: 2 additions & 0 deletions runbooks_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 34a31ac

Please sign in to comment.