# Migration to ceph storage on FES

This guide is intended to help you migrate to ceph storage.

> [!WARNING]
>
> This guide only applies to clusters in the FES region. Clusters in DBL or CBK do not offer Ceph storage.

## Kubernetes Nodes

Most flavors (`m1.*` variants) of MetaKube Nodes use network storage for the VM's root disk.

MetaKube does not allow migrating the volume used for a VM in-place. Instead, you must replace the MetaKube Nodes by changing the flavor to an equivalent `m2.*` variant in each of your MachineDeployments.

## New PersistentVolumes

First, ensure that any new PVs that get dynamically provisioned, use Ceph storage.

1. Check if the default StorageClass uses Ceph

   The following command should only show `sys11-ceph` as the default storage class:

   ```shell
   kubectl get storageclass | grep default
   ```
2. (Optional) Change default StorageClass to `sys11-ceph`

   MetaKube will automatically make `sys11-ceph` the default StorageClass if no other StorageClasses have the respective annotation. To remove it from another StorageClass, for example here the previous default, run:

   ```shell
   kubectl annotate storageclass sys11-quobyte-external-provisioner storageclass.kubernetes.io/is-default-class-
   ```

## Migrate existing PersistentVolumes

To find out if you have any PersistentVolumes that still use Quobyte, run:

```shell
kubectl get pv | grep quobyte
```

> [!NOTE]
>
> **Info**
>
> While unlikely, this list may not be 100% correct. The StorageClass of a PVC is only regarded when provisioning a new volume. After that, the StorageClass may change.
>
> The only way to make sure is to check the volume type of the OpenStack volume directly:
>
> ```shell
> openstack volume show $volume_id
> ```

For existing PVs, consider the following options:

1. Delete PVC of individual cluster members and replay data from active peers

   Most clustered databases store data redundantly, can tolerate the failure of individual members &amp; automatically perform recovery. By safely deleting the PVC for each replica before having a new one be created and synced from other peers, the entire storage may be migrated to new volumes without downtime.
2. Delete PVC and restore from backup

   Some applications make it easy to restore from a (logical) backup. This can be faster and simpler than cloning the volume "as is".
3. Clone volume and create PVC replacement

   For other applications, you can also clone a volume while it's not in use and create a PV and PVC replacements respectively. This is a more manual process and requires downtime of the application using the PVC.

   A guide on how to perform this, can be found in this [How-To](<https://documentation.syseleven.de/en/prior-docs/metakube-core/how-to/migrate-persistent-volume/index.md>)

## Object Storage

MetaKube doesn't directly integrate with Object Storage. You'll have to migrate data and switch endpoints yourself.
