> For the complete documentation index, see [llms.txt](https://docs.storware.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.storware.eu/backup-and-recovery-7.5/protecting-storage-providers/storage-providers/ceph-rbd.md).

# Ceph RBD

## General

In order to connect to Ceph RBD you need to provide the keyring and configuration files. The Ceph RBD storage provider should detect the volumes and pools in the environment and allow you to assign backup policies. Storware Backup & Recovery uses the RBD-NBD approach to mount a remote RBD snapshot over NBD and read data.

{% hint style="info" %}
**Note:**

* Storware Backup & Recovery needs access to the monitors specified in the Ceph configuration file.
* When creating Ceph RBD storage provider for the OpenStack environment, only the credentials specified in the storage provider form are used by the OpenStack backup process - the actual technique (RBD-NBD mount or cinder in disk-attachment strategy) and **node** for connecting and the backup volumes depend on the OpenStack hypervisor manager settings, not in the storage provider settings.
  {% endhint %}

## Supported features

Requires Red Hat Ceph Storage version 4.0 or newer or Ceph v14.2.0 Nautilus or newer

| Full backup                       | Supported                 |
| --------------------------------- | ------------------------- |
| Incremental backup                | Supported (RBD snap-diff) |
| Secondary backup destination      | Supported                 |
| Restore                           | Supported                 |
| Single item restore               | Supported                 |
| Access to files backup over iSCSI | Supported                 |
| Name-based policy assignment      | Supported                 |

### Adding a Ceph RBD Storage Provider

Before adding the provider, install the required Ceph client packages on the Storware Backup & Recovery node.

{% tabs %}
{% tab title="RHEL / CentOS" %}
Install the Ceph client packages on each Storware Backup & Recovery **Node** responsible for Ceph RBD backup and restore operations.

{% hint style="info" %}
Remember to select the version of the Ceph repository that is compatible with the version of the cluster in your environment.
{% endhint %}

For Storware Backup & Recovery node installed on RHEL 8:

```bash
sudo subscription-manager repo --enable=rhceph-4-tools-for-rhel-8-x86_64-rpms
```

For Storware Backup & Recovery node installed on CentOS Stream 9:

```bash
sudo yum install epel-release
```

**Add Ceph repository**

```bash
vi /etc/yum.repos.d/ceph.repo
```

```bash
[ceph]
name=Ceph packages for $basearch
baseurl=https://download.ceph.com/rpm-reef/el9/$basearch
enabled=1
priority=2
gpgcheck=1
gpgkey=https://download.ceph.com/keys/release.asc
```

Install the rbd-nbd and ceph-common packages, with all dependencies:

```bash
yum install rbd-nbd ceph-common
```

{% endtab %}

{% tab title="Ubuntu / Debian" %}
Install the Ceph client packages on each Storware Backup & Recovery **Node** responsible for Ceph RBD backup and restore operations.

These instructions apply to **Ubuntu 22.04** and **Debian 12.5**.

1. Update the package index and check the available versions:

   ```bash
   sudo apt update
   apt-cache policy ceph-common rbd-nbd
   ```

{% hint style="info" %}
Make sure the available Ceph client version is compatible with the Ceph cluster in your environment.
{% endhint %}

2. Install both required packages with their dependencies:

   ```bash
   sudo apt install ceph-common rbd-nbd
   ```

After configuring the repository, repeat the package index update, version check and installation commands above.

3. Verify that the required commands are available:

   ```bash
   command -v ceph rbd rbd-nbd
   ceph --version
   rbd --version
   rbd-nbd --version
   ```
4. Ensure that the NBD kernel module can be loaded:

   ```bash
   sudo modprobe nbd
   ```

   If the module is unavailable, install the kernel modules package appropriate for the running kernel and operating system before proceeding.
   {% endtab %}

{% tab title="SLES" %}
Install the Ceph client packages on each Storware Backup & Recovery **Node** responsible for Ceph RBD backup and restore operations.

1. Ensure that the node is registered and has access to the **Basesystem Module** repositories and updates matching its installed Service Pack.

   Check the registered extensions and configured repositories:

   ```bash
   sudo SUSEConnect --status-text
   sudo zypper repos --uri
   ```

{% hint style="info" %}
Both `ceph-common` and `rbd-nbd` are provided through the Basesystem Module for these SLES versions. If the module is not enabled, use `sudo SUSEConnect --list-extensions` to find the activation command matching your installed Service Pack.

Do not use repositories for a different Service Pack.
{% endhint %}

2. Refresh the repositories and check the available package versions:

   ```bash
   sudo zypper refresh
   zypper search -s --match-exact ceph-common rbd-nbd
   ```

{% hint style="info" %}
Make sure the available Ceph client version is compatible with the Ceph cluster in your environment.
{% endhint %}

3. Install both required packages with their dependencies:

   ```bash
   sudo zypper install ceph-common rbd-nbd
   ```

   If either package is unavailable, verify that the Basesystem Module repositories are enabled and accessible for your installed Service Pack.

4. Verify that the required commands are available:

   ```bash
   command -v ceph rbd rbd-nbd
   ceph --version
   rbd --version
   rbd-nbd --version
   ```

5. Ensure that the NBD kernel module can be loaded:

   ```bash
   sudo modprobe nbd
   ```

   If the module is unavailable, install the kernel modules package appropriate for the running kernel and operating system before proceeding.
   {% endtab %}
   {% endtabs %}

6. Go to **Storage > Storage Providers**.

7. Click **+ Create** to open the **Add Storage Provider** window.

8. In **Select Storage Provider**, select **Ceph RBD**.

9. In the **General** tab:
   1. Specify **Node configuration** for the nodes communicating with the Ceph cluster.
   2. Enter a descriptive **Name** for the provider.
   3. Enter the Ceph **User** associated with the keyring that you will upload.

10. In the **Ceph RBD Settings** tab:
    1. Click **Upload keyring file** and select the keyring file, which can be obtained from the Cinder host - for example, in /etc/ceph/ceph.client.admin.keyring
    2. Provide **Ceph configuration file content**, for example:<br>

       ```
       [global]
       cluster network = 10.40.0.0/16
       fsid = cc3a4e9f-d2ca-4fec-805d-2c40605723b3
       mon host = ceph-mon.domain.local
       mon initial members = ceph-00
       osd pool default crush rule = -1
       public network = 10.40.0.0/16
       [client.images]
       keyring = /etc/ceph/ceph.client.images.keyring
       [client.volumes]
       keyring = /etc/ceph/ceph.client.volumes.keyring
       [client.nova]
       keyring = /etc/ceph/ceph.client.nova.keyring

       ```

{% hint style="info" %}
Use the configuration and keyring from the same Ceph cluster. The Ceph user must match the uploaded keyring and have the permissions required for backup and restore operations.

The node must be able to reach the Ceph monitors specified in the configuration.
{% endhint %}

{% hint style="info" %}
Make sure the configuration content ends with a newline.
{% endhint %}

4. Click **Save**.

#### Inventory Synchronization

1. Start inventory synchronization when prompted after saving the provider. You can also use the provider's **Inventory Synchronization** action later.
2. Wait for synchronization to complete.
3. Go to **Storage > Instances** to view the discovered volumes and configure their protection.

Run a test backup and restore to verify the integration.
