<a id="storage-cephobject"></a>

# Ceph Object - `cephobject`

<!-- Include content from [storage_ceph.md](storage_ceph.md) -->

[Ceph](https://ceph.io/en/) is an open-source storage platform that stores its data in a storage cluster based on .
It is highly scalable and, as a distributed system without a single point of failure, very reliable.

#### TIP
If you want to quickly set up a basic Ceph cluster, check out [MicroCeph](https://canonical.com/microcloud).

Ceph provides different components for block storage and for file systems.

[Ceph Object Gateway](https://docs.ceph.com/en/latest/radosgw/) is an object storage interface built on top of [`librados`](https://docs.ceph.com/en/latest/rados/api/librados-intro/) to provide applications with a RESTful gateway to [Ceph Storage Clusters](https://docs.ceph.com/en/latest/rados/).
It provides object storage functionality with an interface that is compatible with a large subset of the Amazon S3 RESTful API.

## Terminology

<!-- Include content from [storage_ceph.md](storage_ceph.md) -->

Ceph uses the term *object* for the data that it stores.
The daemon that is responsible for storing and managing data is the *Ceph* .
Ceph’s storage is divided into *pools*, which are logical partitions for storing objects.
They are also referred to as *data pools*, *storage pools* or *OSD pools*.

A *Ceph Object Gateway* consists of several OSD pools and one or more *Ceph Object Gateway daemon* (`radosgw`) processes that provide object gateway functionality.

## `cephobject` driver in LXD

#### NOTE
The `cephobject` driver can only be used for buckets.

For storage volumes, use the [Ceph](https://canonical.com/lxd/docs/latest/reference/storage_ceph/index.html.md#storage-ceph) or [CephFS](https://canonical.com/lxd/docs/latest/reference/storage_cephfs/index.html.md#storage-cephfs) drivers.

<!-- Include content from [storage_ceph.md](storage_ceph.md) -->

Unlike other storage drivers, this driver does not set up the storage system but assumes that you already have a Ceph cluster installed.

You must set up a `radosgw` environment beforehand and ensure that its HTTP/HTTPS endpoint URL is reachable from the LXD server or servers.
See [Manual Deployment](https://docs.ceph.com/en/latest/install/manual-deployment/) for information on how to set up a Ceph cluster and [Ceph Object Gateway](https://docs.ceph.com/en/latest/radosgw/) on how to set up a `radosgw` environment.

The `radosgw` URL can be specified at pool creation time using the [`cephobject.radosgw.endpoint`](#storage-cephobject-pool-conf:cephobject.radosgw.endpoint) option.

LXD uses the `radosgw-admin` command to manage buckets. So this command must be available and operational on the LXD servers.

<!-- Include content from [storage_ceph.md](storage_ceph.md) -->

This driver also behaves differently than other drivers in that it provides remote storage.
As a result and depending on the internal network, storage access might be a bit slower than for local storage.
On the other hand, using remote storage has big advantages in a cluster setup, because all cluster members have access to the same storage pools with the exact same contents, without the need to synchronize storage pools.

<!-- Include content from [storage_ceph.md](storage_ceph.md) -->

LXD assumes that it has full control over the OSD storage pool.
Therefore, you should never maintain any file system entities that are not owned by LXD in a LXD OSD storage pool, because LXD might delete them.

## Configuration options

The following configuration options are available for storage pools that use the `cephobject` driver and for storage buckets in these pools.

<a id="storage-cephobject-pool-config"></a>

### Storage pool configuration

<!-- Include content from [../metadata.txt](../metadata.txt) -->

<a id="storage-cephobject-pool-conf:cephobject.bucket.name_prefix"></a>
`cephobject.bucket.name_prefix`

Prefix to add to bucket names in Ceph

[<i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i>](#storage-cephobject-pool-conf:cephobject.bucket.name_prefix)

| **Key:**    | `cephobject.bucket.name_prefix`   |
|-------------|-----------------------------------|
| **Type:**   | string                            |
| **Scope:**  | global                            |

<a id="storage-cephobject-pool-conf:cephobject.cluster_name"></a>
`cephobject.cluster_name`

The Ceph cluster to use

[<i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i>](#storage-cephobject-pool-conf:cephobject.cluster_name)

| **Key:**    | `cephobject.cluster_name`   |
|-------------|-----------------------------|
| **Type:**   | string                      |
| **Scope:**  | global                      |

<a id="storage-cephobject-pool-conf:cephobject.radosgw.endpoint"></a>
`cephobject.radosgw.endpoint`

URL of the `radosgw` gateway process

[<i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i>](#storage-cephobject-pool-conf:cephobject.radosgw.endpoint)

| **Key:**    | `cephobject.radosgw.endpoint`   |
|-------------|---------------------------------|
| **Type:**   | string                          |
| **Scope:**  | global                          |

<a id="storage-cephobject-pool-conf:cephobject.radosgw.endpoint_cert_file"></a>
`cephobject.radosgw.endpoint_cert_file`

TLS client certificate to use for endpoint communication

[<i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i>](#storage-cephobject-pool-conf:cephobject.radosgw.endpoint_cert_file)

| **Key:**    | `cephobject.radosgw.endpoint_cert_file`   |
|-------------|-------------------------------------------|
| **Type:**   | string                                    |
| **Scope:**  | global                                    |

Specify the path to the file that contains the TLS client certificate.

<a id="storage-cephobject-pool-conf:cephobject.user.name"></a>
`cephobject.user.name`

The Ceph user to use

[<i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i>](#storage-cephobject-pool-conf:cephobject.user.name)

| **Key:**     | `cephobject.user.name`   |
|--------------|--------------------------|
| **Type:**    | string                   |
| **Default:** | `admin`                  |
| **Scope:**   | global                   |

<a id="storage-cephobject-pool-conf:volatile.pool.pristine"></a>
`volatile.pool.pristine`

Whether the `radosgw` `lxd-admin` user existed at creation time

[<i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i>](#storage-cephobject-pool-conf:volatile.pool.pristine)

| **Key:**     | `volatile.pool.pristine`   |
|--------------|----------------------------|
| **Type:**    | string                     |
| **Default:** | `true`                     |
| **Scope:**   | global                     |

### Storage bucket configuration

<!-- Include content from [../metadata.txt](../metadata.txt) -->

<a id="storage-cephobject-bucket-conf:size"></a>
`size`

Quota of the storage bucket

[<i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i>](#storage-cephobject-bucket-conf:size)

| **Key:**    | `size`   |
|-------------|----------|
| **Type:**   | string   |
| **Scope:**  | local    |
