pveceph install
Proxmox VE unifies your compute and storage systems, that is, you can use the same physical nodes within a cluster for both computing (processing VMs and containers) and replicated storage. The traditional silos of compute and storage resources can be wrapped up into a single hyper-converged appliance. Separate storage networks (SANs) and connections via network attached storage (NAS) disappear. With the integration of Ceph, an open source software-defined storage platform, Proxmox VE has the ability to run and manage Ceph storage directly on the hypervisor nodes.
Ceph is a distributed object store and file system designed to provide excellent performance, reliability and scalability.
Easy setup and management via CLI and GUI
Thin provisioning
Snapshot support
Self healing
Scalable to the exabyte level
Provides block, file system, and object storage
Setup pools with different performance and redundancy characteristics
Data is replicated, making it fault tolerant
Runs on commodity hardware
No need for hardware RAID controllers
Open source
For small to medium-sized deployments, it is possible to install a Ceph server for using RADOS Block Devices (RBD) or CephFS directly on your Proxmox VE cluster nodes (see Ceph RADOS Block Devices (RBD)). Recent hardware has a lot of CPU power and RAM, so running storage services and virtual guests on the same node is possible.
To simplify management, Proxmox VE provides you native integration to install and manage Ceph services on Proxmox VE nodes either via the built-in web interface, or using the pveceph command line tool.
Ceph Monitor (ceph-mon, or MON)
Ceph Manager (ceph-mgr, or MGR)
Ceph Metadata Service (ceph-mds, or MDS)
Ceph Object Storage Daemon (ceph-osd, or OSD)
|
|
We highly recommend to get familiar with Ceph
[Ceph intro https://docs.ceph.com/en/tentacle/start/] , its architecture [Ceph architecture https://docs.ceph.com/en/tentacle/architecture/] and vocabulary [Ceph glossary https://docs.ceph.com/en/tentacle/glossary] . |
To build a hyper-converged Proxmox + Ceph Cluster, you must use at least three (preferably) identical servers for the setup.
Check also the recommendations from Ceph’s website.
|
|
The recommendations below should be seen as a rough guidance for choosing hardware. Therefore, it is still essential to adapt it to your specific needs. You should test your setup and monitor health and performance continuously. |
Ceph services can be classified into two categories:
Intensive CPU usage, benefiting from high CPU base frequencies and multiple cores. Members of that category are:
Object Storage Daemon (OSD) services
Meta Data Service (MDS) used for CephFS
Moderate CPU usage, not needing multiple CPU cores. These are:
Monitor (MON) services
Manager (MGR) services
As a simple rule of thumb, you should assign at least one CPU core (or thread) to each Ceph service to provide the minimum resources required for stable and durable Ceph performance.
For example, if you plan to run a Ceph monitor, a Ceph manager and 6 Ceph OSDs services on a node you should reserve 8 CPU cores purely for Ceph when targeting basic and stable performance.
Note that an OSD’s CPU usage depends mostly on the disk’s performance. The higher the possible IOPS (IO Operations per Second) of a disk, the more CPU can be utilized by an OSD service. For modern enterprise SSD disks, like NVMes that can permanently sustain a high IOPS load over 100’000 with sub millisecond latency, each OSD can use multiple CPU threads, e.g., four to six CPU threads utilized per NVMe backed OSD is likely for very high performance disks.
Especially in a hyper-converged setup, the memory consumption needs to be carefully planned out and monitored. In addition to the predicted memory usage of virtual machines and containers, you must also account for having enough memory available for Ceph to provide excellent and stable performance.
While usage may be less under normal conditions, it will consume more memory during critical operations, such as recovery, rebalancing, or backfilling. That means you should avoid maxing out your available memory already on regular operation, but rather leave some headroom to cope with outages.
The current recommendation is to configure OSDs with at least 8 GiB of memory for good performance. The OSD daemon requires 4 GiB by default.
|
|
Total memory consumption is primarily determined by the number of OSD daemons. However, for critical operations, all Ceph services may require additional memory. |
We recommend a network bandwidth of at least 10 Gbps, or more, to be used
exclusively for Ceph traffic. A meshed network setup
[Full Mesh Network for Ceph https://pve.proxmox.com/wiki/Full_Mesh_Network_for_Ceph_Server]
is also an option for three to five node clusters, if there are no 10+ Gbps
switches available.
|
|
The volume of traffic, especially during recovery, will interfere with other services on the same network, especially the latency sensitive Proxmox VE corosync cluster stack can be affected, resulting in possible loss of cluster quorum. Moving the Ceph traffic to dedicated and physical separated networks will avoid such interference, not only for corosync, but also for the networking services provided by any virtual guests. |
For estimating your bandwidth needs, you need to take the performance of your disks into account.. While a single HDD might not saturate a 1 Gb link, multiple HDD OSDs per node can already saturate 10 Gbps too. If modern NVMe-attached SSDs are used, a single one can already saturate 10 Gbps of bandwidth, or more. For such high-performance setups we recommend at least a 25 Gpbs, while even 40 Gbps or 100+ Gbps might be required to utilize the full performance potential of the underlying disks.
If unsure, we recommend using three (physical) separate networks for high-performance setups:
one very high bandwidth (25+ Gbps) network for Ceph (internal) cluster traffic.
one high bandwidth (10+ Gpbs) network for Ceph (public) traffic between the ceph server and ceph client storage traffic. Depending on your needs this can also be used to host the virtual guest traffic and the VM live-migration traffic.
one medium bandwidth (1 Gbps) exclusive for the latency sensitive corosync cluster communication.
If a firewall is enabled you will have to open the ports used by Ceph, the easiest way to do this is to use a firewall macro.
When planning the size of your Ceph cluster, it is important to take the recovery time into consideration. Especially with small clusters, recovery might take long. It is recommended that you use SSDs instead of HDDs in small setups to reduce recovery time, minimizing the likelihood of a subsequent failure event during recovery.
In general, SSDs will provide more IOPS than spinning disks. With this in mind, in addition to the higher cost, it may make sense to implement a class based separation of pools. Another way to speed up OSDs is to use a faster disk as a journal or DB/Write-Ahead-Log device, see creating Ceph OSDs. If a faster disk is used for multiple OSDs, a proper balance between OSD and WAL / DB (or journal) disk must be selected, otherwise the faster disk becomes the bottleneck for all linked OSDs.
Aside from the disk type, Ceph performs best with an evenly sized, and an evenly distributed amount of disks per node. For example, 4 x 500 GB disks within each node is better than a mixed setup with a single 1 TB and three 250 GB disk.
You also need to balance OSD count and single OSD capacity. More capacity allows you to increase storage density, but it also means that a single OSD failure forces Ceph to recover more data at once.
As Ceph handles data object redundancy and multiple parallel writes to disks (OSDs) on its own, using a RAID controller normally doesn’t improve performance or availability. On the contrary, Ceph is designed to handle whole disks on its own, without any abstraction in between. RAID controllers are not designed for the Ceph workload and may complicate things and sometimes even reduce performance, as their write and caching algorithms may interfere with the ones from Ceph.
|
|
Avoid RAID controllers. Use host bus adapter (HBA) instead. |
With Proxmox VE you have the benefit of an easy to use installation wizard for Ceph. Click on one of your cluster nodes and navigate to the Ceph section in the menu tree. If Ceph is not already installed, you will see a prompt offering to do so.
The wizard is divided into multiple sections, where each needs to finish successfully, in order to use Ceph.
First you need to choose which Ceph version you want to install. Prefer the one from your other nodes, or the newest if this is the first node you install Ceph.
After starting the installation, the wizard will download and install all the required packages from Proxmox VE’s Ceph repository.
After finishing the installation step, you will need to create a configuration. This step is only needed once per cluster, as this configuration is distributed automatically to all remaining cluster members through Proxmox VE’s clustered configuration file system (pmxcfs).
The configuration step includes the following settings:
Public Network: This network will be used for public storage communication
(e.g., for virtual machines using a Ceph RBD backed disk, or a CephFS mount),
and communication between the different Ceph services. This setting is
required.
Separating your Ceph traffic from the Proxmox VE cluster communication (corosync),
and possibly the front-facing (public) networks of your virtual guests, is
highly recommended. Otherwise, Ceph’s high-bandwidth IO-traffic could cause
interference with other low-latency dependent services.
Cluster Network: Specify to separate the OSD replication
and heartbeat traffic as well. This setting is optional.
Using a physically separated network is recommended, as it will relieve the
Ceph public and the virtual guests network, while also providing a significant
Ceph performance improvements.
The Ceph cluster network can be configured and moved to another physically
separated network at a later time.
You have two more options which are considered advanced and therefore should only be changed if you know what you are doing.
Number of replicas: Defines how often an object is replicated.
Minimum replicas: Defines the minimum number of required replicas for I/O to be marked as complete.
Additionally, you need to choose your first monitor node. This step is required.
That’s it. You should now see a success page as the last step, with further instructions on how to proceed. Your system is now ready to start using Ceph. To get started, you will need to create some additional monitors, OSDs and at least one pool.
The rest of this chapter will guide you through getting the most out of your Proxmox VE based Ceph setup. This includes the aforementioned tips and more, such as CephFS, which is a helpful addition to your new Ceph cluster.
Alternatively to the recommended Proxmox VE Ceph installation wizard available in the web interface, you can use the following CLI command on each node:
pveceph install
This sets up an apt package repository in /etc/apt/sources.list.d/ceph.sources and installs the required software.
Use the Proxmox VE Ceph installation wizard (recommended) or run the following command on one node:
pveceph init --network 10.10.10.0/24
This creates an initial configuration at /etc/pve/ceph.conf with a dedicated network for Ceph. This file is automatically distributed to all Proxmox VE nodes, using pmxcfs. The command also creates a symbolic link at /etc/ceph/ceph.conf, which points to that file. Thus, you can simply run Ceph commands without the need to specify a configuration file.
The Ceph Monitor (MON)
[Ceph Monitor https://docs.ceph.com/en/tentacle/rados/configuration/mon-config-ref/]
maintains a master copy of the cluster map. For high availability, you need at
least 3 monitors. One monitor will already be installed if you
used the installation wizard. You won’t need more than 3 monitors, as long
as your cluster is small to medium-sized. Only really large clusters will
require more than this.
On each node where you want to place a monitor (three monitors are recommended), create one by using the Ceph → Monitor tab in the GUI or run:
pveceph mon create
To remove a Ceph Monitor via the GUI, first select a node in the tree view and go to the Ceph → Monitor panel. Select the MON and click the Destroy button.
To remove a Ceph Monitor via the CLI, first connect to the node on which the MON is running. Then execute the following command:
pveceph mon destroy
|
|
At least three Monitors are needed for quorum. |
The Manager daemon runs alongside the monitors. It provides an interface to
monitor the cluster. Since the release of Ceph luminous, at least one ceph-mgr
[Ceph Manager https://docs.ceph.com/en/tentacle/mgr/]
daemon is
required.
Multiple Managers can be installed, but only one Manager is active at any given time.
pveceph mgr create
|
|
It is recommended to install the Ceph Manager on the monitor nodes. For high availability install more then one manager. |
To remove a Ceph Manager via the GUI, first select a node in the tree view and go to the Ceph → Monitor panel. Select the Manager and click the Destroy button.
To remove a Ceph Monitor via the CLI, first connect to the node on which the Manager is running. Then execute the following command:
pveceph mgr destroy
|
|
While a manager is not a hard-dependency, it is crucial for a Ceph cluster, as it handles important features like PG-autoscaling, device health monitoring, telemetry and more. |
Ceph Object Storage Daemons store objects for Ceph over the network. It is recommended to use one OSD per physical disk.
You can create an OSD either via the Proxmox VE web interface or via the CLI using pveceph. For example:
pveceph osd create /dev/sd[X]
|
|
We recommend a Ceph cluster with at least three nodes and at least 12 OSDs, evenly distributed among the nodes. |
If the disk was in use before (for example, for ZFS or as an OSD) you first need to zap all traces of that usage. To remove the partition table, boot sector and any other OSD leftover, you can use the following command:
ceph-volume lvm zap /dev/sd[X] --destroy
|
|
The above command will destroy all data on the disk! |
Starting with the Ceph Kraken release, a new Ceph OSD storage type was
introduced called Bluestore
[Ceph Bluestore https://ceph.com/community/new-luminous-bluestore/]
.
This is the default when creating OSDs since Ceph Luminous.
pveceph osd create /dev/sd[X]
If you want to use a separate DB/WAL device for your OSDs, you can specify it through the -db_dev and -wal_dev options. The WAL is placed with the DB, if not specified separately.
pveceph osd create /dev/sd[X] -db_dev /dev/sd[Y] -wal_dev /dev/sd[Z]
You can directly choose the size of those with the -db_size and -wal_size parameters respectively. If they are not given, the following values (in order) will be used:
bluestore_block_{db,wal}_size from Ceph configuration…
… database, section osd
… database, section global
… file, section osd
… file, section global
10% (DB)/1% (WAL) of OSD size
|
|
The DB stores BlueStore’s internal metadata, and the WAL is BlueStore’s internal journal or write-ahead log. It is recommended to use a fast SSD or NVRAM for better performance. |
Before Ceph Luminous, Filestore was used as the default storage type for Ceph OSDs. Starting with Ceph Nautilus, Proxmox VE does not support creating such OSDs with pveceph anymore. If you still want to create filestore OSDs, use ceph-volume directly.
ceph-volume lvm create --filestore --data /dev/sd[X] --journal /dev/sd[Y]
If you experience problems with an OSD or its disk, try to troubleshoot them first to decide if a replacement is needed.
To destroy an OSD, navigate to the <Node> → Ceph → OSD panel or use the mentioned CLI commands on the node where the OSD is located.
Make sure the cluster has enough space to handle the removal of the OSD. In the Ceph → OSD panel,if the to-be destroyed OSD is still up and in (non-zero value at AVAIL), make sure that all OSDs have their Used (%) value well below the nearfull_ratio of default 85%.
This way you can reduce the risk from the upcoming rebalancing, which may cause OSDs to run full and thereby blocking I/O on Ceph pools.
Use the following command to get the same information on the CLI:
ceph osd df tree
If the to-be destroyed OSD is not out yet, select the OSD and click on Out. This will exclude it from data distribution and start a rebalance.
The following command does the same:
ceph osd out <id>
If you can, wait until Ceph has finished the rebalance to always have enough replicas. The OSD will be empty; once it is, it will show 0 PGs.
Click on Stop. If stopping is not safe yet, a warning will appear, and you should click on Cancel. Try it again in a few moments.
The following commands can be used to check if it is safe to stop and stop the OSD:
ceph osd ok-to-stop <id> pveceph stop --service osd.<id>
Finally:
To remove the OSD from Ceph and delete all disk data, first click on More → Destroy. Enable the cleanup option to clean up the partition table and other structures. This makes it possible to immediately reuse the disk in Proxmox VE. Then, click on Remove.
The CLI command to destroy the OSD is:
pveceph osd destroy <id> [--cleanup]
Ceph daemon and clients pull their configuration from one or more sources
[Ceph config sources https://docs.ceph.com/en/latest/rados/configuration/ceph-conf/#config-sources]
.
In Proxmox VE, a minimal ceph.conf file is used to hold bootstrap settings. Most of
the configuration is held in the central configuration database maintained by
the MON services.
To persistently change configuration values use the following commands
[Ceph MON DB commands https://docs.ceph.com/en/latest/rados/configuration/ceph-conf/#commands]
:
ceph config dump |
Show all configuration option(s) |
ceph config get <who> <name> |
Show configuration option(s) for an entity |
ceph config set <who> <name> <value> |
Set a configuration option for one or more entities |
ceph config rm <who> <name> |
Clear a configuration option for one or more entities |
ceph config set osd osd_memory_target 8G|
|
If an option exists in a local configuration file, the configuration in the MON DB will be ignored because it has a lower precedence. |
A pool is a logical group for storing objects. It holds a collection of objects, known as Placement Groups (PG, pg_num).
You can create and edit pools from the command line or the web interface of any Proxmox VE host under Ceph → Pools.
When no options are given, we set a default of 128 PGs, a size of 3 replicas and a min_size of 2 replicas, to ensure no data loss occurs if any OSD fails.
|
|
Do not set a min_size of 1. A replicated pool with min_size of 1 allows I/O on an object when it has only 1 replica, which could lead to data loss, incomplete PGs or unfound objects. |
It is advised that you either enable the PG-Autoscaler or calculate the PG
number based on your setup. You can find the formula and the PG calculator
[PG calculator https://web.archive.org/web/20210301111112/http://ceph.com/pgcalc/]
online. From Ceph Nautilus
onward, you can change the number of PGs
[Placement Groups https://docs.ceph.com/en/tentacle/rados/operations/placement-groups/]
after the setup.
The PG autoscaler
[Automated Scaling https://docs.ceph.com/en/tentacle/rados/operations/placement-groups/#automated-scaling]
can
automatically scale the PG count for a pool in the background. Setting the
Target Size or Target Ratio advanced parameters helps the PG-Autoscaler to
make better decisions.
pveceph pool create <pool-name> --add_storages
|
|
If you would also like to automatically define a storage for your pool, keep the ‘Add as Storage’ checkbox checked in the web interface, or use the command-line option --add_storages at pool creation. |
The name of the pool. This must be unique and can’t be changed afterwards.
The number of replicas per object. Ceph always tries to have this many copies of an object. Default: 3.
The automatic PG scaling mode
[autoscaler]
of
the pool. If set to warn, it produces a warning message when a pool
has a non-optimal PG count. Default: warn.
Configure a VM or container storage using the new pool. Default: true (only visible on creation).
The minimum number of replicas per object. Ceph will reject I/O on the pool if a PG has less than this many replicas. Default: 2.
The rule to use for mapping object placement in the cluster. These rules define how data is placed within the cluster. See Ceph CRUSH & device classes for information on device-based rules.
The number of placement groups
[placement_groups]
that
the pool should have at the beginning. Default: 128.
The ratio of data that is expected in the pool. The PG autoscaler uses the ratio relative to other ratio sets. It takes precedence over the target size if both are set.
The estimated amount of data expected in the pool. The PG autoscaler uses this size to estimate the optimal PG count.
The minimum number of placement groups. This setting is used to fine-tune the lower bound of the PG count for that pool. The PG autoscaler will not merge PGs below this threshold.
Further information on Ceph pool handling can be found in the Ceph pool
operation
[Ceph pool operation
https://docs.ceph.com/en/tentacle/rados/operations/pools/]
manual.
Erasure coding (EC) is a form of ‘forward error correction’ codes that allows to recover from a certain amount of data loss. Erasure coded pools can offer more usable space compared to replicated pools, but they do that for the price of performance.
For comparison: in classic, replicated pools, multiple replicas of the data are stored (size) while in erasure coded pool, data is split into k data chunks with additional m coding (checking) chunks. Those coding chunks can be used to recreate data should data chunks be missing.
The number of coding chunks, m, defines how many OSDs can be lost without losing any data. The total amount of objects stored is k + m.
Erasure coded (EC) pools can be created with the pveceph CLI tooling. Planning an EC pool needs to account for the fact, that they work differently than replicated pools.
The default min_size of an EC pool depends on the m parameter. If m = 1,
the min_size of the EC pool will be k. The min_size will be k + 1 if
m > 1. The Ceph documentation recommends a conservative min_size of k + 2
[Ceph Erasure Coded Pool Recovery
https://docs.ceph.com/en/tentacle/rados/operations/erasure-code/#erasure-coded-pool-recovery]
.
If there are less than min_size OSDs available, any IO to the pool will be blocked until there are enough OSDs available again.
|
|
When planning an erasure coded pool, keep an eye on the min_size as it defines how many OSDs need to be available. Otherwise, IO will be blocked. |
For example, an EC pool with k = 2 and m = 1 will have size = 3, min_size = 2 and will stay operational if one OSD fails. If the pool is configured with k = 2, m = 2, it will have a size = 4 and min_size = 3 and stay operational if one OSD is lost.
To create a new EC pool, run the following command:
pveceph pool create <pool-name> --erasure-coding k=2,m=1
Optional parameters are failure-domain and device-class. If you need to change any EC profile settings used by the pool, you will have to create a new pool with a new profile.
This will create a new EC pool plus the needed replicated pool to store the RBD omap and other metadata. In the end, there will be a <pool name>-data and <pool name>-metadata pool. The default behavior is to create a matching storage configuration as well. If that behavior is not wanted, you can disable it by providing the --add_storages 0 parameter. When configuring the storage configuration manually, keep in mind that the data-pool parameter needs to be set. Only then will the EC pool be used to store the data objects. For example:
|
|
The optional parameters --size, --min_size and --crush_rule will be used for the replicated metadata pool, but not for the erasure coded data pool. If you need to change the min_size on the data pool, you can do it later. The size and crush_rule parameters cannot be changed on erasure coded pools. |
If there is a need to further customize the EC profile, you can do so by
creating it with the Ceph tools directly
[Ceph Erasure Code Profile
https://docs.ceph.com/en/tentacle/rados/operations/erasure-code/#erasure-code-profiles]
, and
specify the profile to use with the profile parameter.
For example:
pveceph pool create <pool-name> --erasure-coding profile=<profile-name>
Ceph Tentacle introduces a new erasure coding I/O path called FastEC,
enabled per pool via the allow_ec_optimizations flag. FastEC adds partial
reads and partial writes on EC pools, substantially improving small random
I/O performance — the dominant access pattern of virtual machine disk I/O.
Upstream recommends it for RBD and CephFS backed storage
[Ceph Erasure Code
https://docs.ceph.com/en/tentacle/rados/operations/erasure-code/]
.
FastEC has four requirements that the Ceph monitor enforces:
the pool must be erasure coded;
the cluster must be at require_osd_release tentacle or later;
the erasure code profile must use a plugin and technique combination that supports the optimized EC path:
| Plugin | Technique | FastEC |
|---|---|---|
isa |
reed_sol_van |
yes |
isa |
cauchy |
no |
jerasure |
reed_sol_van |
yes |
jerasure |
all others |
no |
lrc |
(any) |
no |
shec |
(any) |
no |
clay |
(any) |
no |
the pool’s stripe unit must be a multiple of 4096 bytes. The default stripe unit satisfies this, so this is only relevant for pools created with a custom stripe_unit in their erasure code profile.
If any precondition is not met, ceph osd pool set <pool>-data allow_ec_optimizations 1 fails with a descriptive error — no silent degradation.
pveceph does not set the plugin or technique explicitly when creating an EC profile — both are seeded from the monitor’s osd_pool_default_erasure_code_profile option (reed_sol_van by default on both Squid and Tentacle). The technique requirement is therefore satisfied out of the box unless the operator has overridden this setting. Verify with:
ceph config get mon osd_pool_default_erasure_code_profile
If the output shows a technique other than reed_sol_van, either update the cluster-wide default or create a compatible profile explicitly and pass it via the profile property when creating the pool (see above).
Check the cluster release with:
ceph osd dump | grep require_osd_releaseIf this reports a release older than tentacle, run ceph osd require-osd-release tentacle after all OSDs have been upgraded.
|
|
allow_ec_optimizations is a one-way switch. Once enabled on a pool, the Ceph monitor refuses to clear the flag again, so rolling back requires draining and recreating the pool. Enable it only after validating that FastEC works for your workload on a test pool. |
FastEC is enabled per pool via the ceph CLI. It can be set on both new and existing (populated) pools. No data migration or re-encoding takes place; only pool metadata changes.
To enable FastEC on a pool, run the following command against the data pool (typically named <pool-name>-data):
ceph osd pool set <pool-name>-data allow_ec_optimizations 1
Verify the result with:
ceph osd pool get <pool-name>-data allow_ec_optimizations
The same command reports the current state for any EC pool, which is useful when auditing a cluster.
When the flag is set on a populated pool, be aware of the following:
Primary re-election. FastEC marks data shards 1 through k-1 as non-primary, so PGs whose primary was on one of those shards will re-peer. This is a normal peering event and causes a brief I/O pause per affected PG.
Scrub interaction. Re-peering cancels any in-flight scrub on affected PGs. Those PGs will need to be re-scrubbed after peering completes.
You can add an already existing EC pool as storage to Proxmox VE. It works the same way as adding an RBD pool but requires the extra data-pool option.
pvesm add rbd <storage-name> --pool <replicated-pool> --data-pool <ec-pool>
|
|
Do not forget to add the keyring and monhost option for any external Ceph clusters, not managed by the local Proxmox VE cluster. |
To destroy a pool via the GUI, select a node in the tree view and go to the Ceph → Pools panel. Select the pool to destroy and click the Destroy button. To confirm the destruction of the pool, you need to enter the pool name.
Run the following command to destroy a pool. Specify the -remove_storages to also remove the associated storage.
pveceph pool destroy <name>
|
|
Pool deletion runs in the background and can take some time. You will notice the data usage in the cluster decreasing throughout this process. |
The PG autoscaler allows the cluster to consider the amount of (expected) data stored in each pool and to choose the appropriate pg_num values automatically. It is available since Ceph Nautilus.
You may need to activate the PG autoscaler module before adjustments can take effect.
ceph mgr module enable pg_autoscalerThe autoscaler is configured on a per pool basis and has the following modes:
|
warn
|
A health warning is issued if the suggested pg_num value differs too much from the current value. |
|
on
|
The pg_num is adjusted automatically with no need for any manual interaction. |
|
off
|
No automatic pg_num adjustments are made, and no warning will be issued if the PG count is not optimal. |
The scaling factor can be adjusted to facilitate future data storage with the target_size, target_size_ratio and the pg_num_min options.
|
|
By default, the autoscaler considers tuning the PG count of a pool if it is off by a factor of 3. This will lead to a considerable shift in data placement and might introduce a high load on the cluster. |
You can find a more in-depth introduction to the PG autoscaler on Ceph’s Blog - New in Nautilus: PG merging and autotuning.
The
[https://ceph.com/assets/pdfs/weil-crush-sc06.pdf]
(Controlled
Replication Under Scalable Hashing) algorithm is at the
foundation of Ceph.
CRUSH calculates where to store and retrieve data from. This has the advantage that no central indexing service is needed. CRUSH works using a map of OSDs, buckets (device locations) and rulesets (data replication) for pools.
|
|
Further information can be found in the Ceph documentation, under the
section CRUSH map [CRUSH map https://docs.ceph.com/en/tentacle/rados/operations/crush-map/] . |
This map can be altered to reflect different replication hierarchies. The object replicas can be separated (e.g., failure domains), while maintaining the desired distribution.
A common configuration is to use different classes of disks for different Ceph pools. For this reason, Ceph introduced device classes with luminous, to accommodate the need for easy ruleset generation.
The device classes can be seen in the ceph osd tree output. These classes represent their own root bucket, which can be seen with the below command.
ceph osd crush tree --show-shadow
Example output form the above command:
ID CLASS WEIGHT TYPE NAME -16 nvme 2.18307 root default~nvme -13 nvme 0.72769 host sumi1~nvme 12 nvme 0.72769 osd.12 -14 nvme 0.72769 host sumi2~nvme 13 nvme 0.72769 osd.13 -15 nvme 0.72769 host sumi3~nvme 14 nvme 0.72769 osd.14 -1 7.70544 root default -3 2.56848 host sumi1 12 nvme 0.72769 osd.12 -5 2.56848 host sumi2 13 nvme 0.72769 osd.13 -7 2.56848 host sumi3 14 nvme 0.72769 osd.14
To instruct a pool to only distribute objects on a specific device class, you first need to create a ruleset for the device class:
ceph osd crush rule create-replicated <rule-name> <root> <failure-domain> <class>
<rule-name> |
name of the rule, to connect with a pool (seen in GUI & CLI) |
<root> |
which crush root it should belong to (default Ceph root "default") |
<failure-domain> |
at which failure-domain the objects should be distributed (usually host) |
<class> |
what type of OSD backing store to use (e.g., nvme, ssd, hdd) |
Once the rule is in the CRUSH map, you can tell a pool to use the ruleset.
ceph osd pool set <pool-name> crush_rule <rule-name>
|
|
If the pool already contains objects, these must be moved accordingly. Depending on your setup, this may introduce a big performance impact on your cluster. As an alternative, you can create a new pool and move disks separately. |
|
|
When using the PG autoscaler, all pools in the cluster are required to use CRUSH rules of the same kind, either all specifying a device class, or none. Otherwise the autoscaler will skip the affected pools and their pg_num will not be adjusted. |
Following the setup from the previous sections, you can configure Proxmox VE to use such pools to store VM and Container images. Simply use the GUI to add a new RBD storage (see section Ceph RADOS Block Devices (RBD)).
You also need to copy the keyring to a predefined location for an external Ceph cluster. If Ceph is installed on the Proxmox nodes itself, then this will be done automatically.
|
|
The filename needs to be <storage_id> + `.keyring, where <storage_id> is the expression after rbd: in /etc/pve/storage.cfg. In the following example, my-ceph-storage is the <storage_id>: |
mkdir /etc/pve/priv/ceph cp /etc/ceph/ceph.client.admin.keyring /etc/pve/priv/ceph/my-ceph-storage.keyring
Ceph also provides a filesystem, which runs on top of the same object storage as RADOS block devices do. A Metadata Server (MDS) is used to map the RADOS backed objects to files and directories, allowing Ceph to provide a POSIX-compliant, replicated filesystem. This allows you to easily configure a clustered, highly available, shared filesystem. Ceph’s Metadata Servers guarantee that files are evenly distributed over the entire Ceph cluster. As a result, even cases of high load will not overwhelm a single host, which can be an issue with traditional shared filesystem approaches, for example NFS.
Proxmox VE supports both creating a hyper-converged CephFS and using an existing CephFS as storage to save backups, ISO files, and container templates.
CephFS needs at least one Metadata Server to be configured and running, in order to function. You can create an MDS through the Proxmox VE web GUI’s Node -> CephFS panel or from the command line with:
pveceph mds create
Multiple metadata servers can be created in a cluster, but with the default settings, only one can be active at a time. If an MDS or its node becomes unresponsive (or crashes), another standby MDS will get promoted to active. You can speed up the handover between the active and standby MDS by using the hotstandby parameter option on creation, or if you have already created it you may set/add:
mds standby replay = true
in the respective MDS section of /etc/pve/ceph.conf. With this enabled, the specified MDS will remain in a warm state, polling the active one, so that it can take over faster in case of any issues.
|
|
This active polling will have an additional performance impact on your system and the active MDS. |
Since Luminous (12.2.x) you can have multiple active metadata servers
running at once, but this is normally only useful if you have a high amount of
clients running in parallel. Otherwise the MDS is rarely the bottleneck in a
system. If you want to set this up, please refer to the Ceph documentation.
[Configuring multiple active MDS daemons
https://docs.ceph.com/en/tentacle/cephfs/multimds/]
With Proxmox VE’s integration of CephFS, you can easily create a CephFS using the web interface, CLI or an external API interface. Some prerequisites are required for this to work:
Install Ceph packages - if this was already done some time ago, you may want to rerun it on an up-to-date system to ensure that all CephFS related packages get installed.
After this is complete, you can simply create a CephFS through either the Web GUI’s Node -> CephFS panel or the command-line tool pveceph, for example:
pveceph fs create --pg_num 128 --add-storageThis creates a CephFS named cephfs, using a pool for its data named
cephfs_data with 128 placement groups and a pool for its metadata named
cephfs_metadata with one quarter of the data pool’s placement groups (32).
Check the Proxmox VE managed Ceph pool chapter or visit the
Ceph documentation for more information regarding an appropriate placement group
number (pg_num) for your setup
[placement_groups]
.
Additionally, the --add-storage parameter will add the CephFS to the Proxmox VE
storage configuration after it has been created successfully.
|
|
Destroying a CephFS will render all of its data unusable. This cannot be undone! |
To completely and gracefully remove a CephFS, the following steps are necessary:
Disconnect every non-Proxmox VE client (e.g. unmount the CephFS in guests).
Disable all related CephFS Proxmox VE storage entries (to prevent it from being automatically mounted).
Remove all used resources from guests (e.g. ISOs) that are on the CephFS you want to destroy.
Unmount the CephFS storages on all cluster nodes manually with
umount /mnt/pve/<STORAGE-NAME>
Where <STORAGE-NAME> is the name of the CephFS storage in your Proxmox VE.
Now make sure that no metadata server (MDS) is running for that CephFS, either by stopping or destroying them. This can be done through the web interface or via the command-line interface, for the latter you would issue the following command:
pveceph stop --service mds.NAMEto stop them, or
pveceph mds destroy NAME
to destroy them.
Note that standby servers will automatically be promoted to active when an active MDS is stopped or removed, so it is best to first stop all standby servers.
Now you can destroy the CephFS with
pveceph fs destroy NAME --remove-storages --remove-pools
This will automatically destroy the underlying Ceph pools as well as remove the storages from pve config.
After these steps, the CephFS should be completely removed and if you have other CephFS instances, the stopped metadata servers can be started again to act as standbys.
With the following steps you can replace the disk of an OSD, which is one of the most common maintenance tasks in Ceph. If there is a problem with an OSD while its disk still seems to be healthy, read the troubleshooting section first.
If the disk failed, get a recommended replacement disk of the same type and size.
Destroy the OSD in question.
Detach the old disk from the server and attach the new one.
Create the OSD again.
After automatic rebalancing, the cluster status should switch back to HEALTH_OK. Any still listed crashes can be acknowledged by running the following command:
ceph crash archive-all
It is good practice to run fstrim (discard) regularly on VMs and containers. This releases data blocks that the filesystem isn’t using anymore. It reduces data usage and resource load. Most modern operating systems issue such discard commands to their disks regularly. You only need to ensure that the Virtual Machines enable the disk discard option.
Ceph ensures data integrity by scrubbing placement groups. Ceph checks every
object in a PG for its health. There are two forms of Scrubbing, daily
cheap metadata checks and weekly deep data checks. The weekly deep scrub reads
the objects and uses checksums to ensure data integrity. If a running scrub
interferes with business (performance) needs, you can adjust the time when
scrubs
[Ceph scrubbing https://docs.ceph.com/en/tentacle/rados/configuration/osd-config-ref/#scrubbing]
are executed.
A health check that stays keeps the cluster out of HEALTH_OK and buries the checks that you can still act on. That applies to a condition you cannot resolve at all, such as one waiting on clients outside the cluster, as much as to one you have scheduled for a later maintenance window. Ceph can mute such a check: it keeps evaluating it and keeps it visible, but stops it from counting towards the cluster status, so a new problem stands out again.
ceph health mute <CHECK> 2w ceph health mute <CHECK> --sticky
Give the mute a duration for anything you mean to come back to. It expires on its own and the check returns, which puts it in front of you again instead of leaving it silenced indefinitely.
The Proxmox VE web interface offers the same in the health panel of Datacenter → Ceph: expand the row of the check, and its detail offers to mute it, with an optional duration. A muted check stays in the list, marked as muted, and the same place offers to unmute it again.
Tick Keep Mute there, which corresponds to --sticky above. Without it, the mute clears itself as soon as more items become affected, which brings the check back to attention. That is useful for silencing something temporarily, but not for a condition that stays until something outside the cluster changes.
|
|
Muting a check means that you accept the risk it describes for as long as the mute lasts, so mute deliberately. |
Ceph authenticates its daemons and clients with cephx keys, which are stored in keyring files. Proxmox VE keeps the keyrings of a managed cluster in two places, and the difference matters whenever a key changes.
The authoritative client.admin keyring is /etc/pve/priv/ceph.client.admin.keyring, not the one in /etc/ceph. Proxmox VE stores it on the configuration file system (pmxcfs), which syncs to every node in real time. Write it once on any node, no copying is needed. Keyrings for external Ceph clusters are stored in /etc/pve/priv/ceph/<STORAGE_ID>.keyring.
The per-daemon keyrings below /var/lib/ceph are local to their node and are not synced. Update them on the node the daemon runs on.
|
|
The file /etc/pve/priv/ceph.mon.keyring holds the mon. key as well, and pveceph mon create passes that file to ceph-mon --mkfs. If you change the mon. key without updating that file, every monitor created later boots with a stale key and can never join the cluster. Always merge a new key into that file, never overwrite it, as it also holds the client.admin key. |
Ceph Squid 19.2.6 and Ceph Tentacle 20.2.4 added a key cipher called aes256k, which fixes CVE-2025-30156, an authentication bypass caused by a misuse of AES-CBC. Whether a key can use the new cipher depends on the client that reads it.
The userspace clients ship with Ceph itself, so librados, librbd, and libcephfs understand aes256k as soon as the packages are upgraded. Virtual machines normally use librbd.
The Linux kernel clients are separate. They support aes256k starting with kernel 7.0. A node must run a supported kernel, not merely have one installed. Proxmox VE 9 can use such a key while running kernel 7.0 or newer, but its 6.14 and 6.17 kernels cannot. Proxmox VE 8 does not provide a kernel that supports the new cipher.
Migrate a client key only if every client that uses it supports aes256k. Every node that can use the key through an in-kernel RBD or CephFS client must run kernel 7.0 or newer. Consider these Proxmox VE consumers:
Containers always use the RBD kernel client, regardless of the storage’s krbd setting.
Virtual machines use the RBD kernel client when the storage has krbd enabled.
CephFS uses the kernel client by default. Enabling the storage’s fuse option switches it to the userspace client.
Also check external hosts that map RBD images or mount CephFS with the same key.
After an upgrade to Ceph Squid 19.2.6 or Ceph Tentacle 20.2.4, the cluster reports every key that still uses the old cipher as insecure, through six health checks. Two of them are errors, AUTH_INSECURE_SERVICE_TICKETS and AUTH_INSECURE_SERVICE_KEY_TYPE, so the cluster status changes to HEALTH_ERR. Nothing breaks: all daemons keep running and the storage stays available. Migrate the keys to get the cluster back to a healthy state.
|
|
These health checks do not block the rolling restart of the Ceph daemons in the Proxmox VE web interface. Finish the upgrade first, then migrate the keys. |
To see where a cluster stands, run pveceph auth status. It reports which keys still use the old cipher, whether the service and client keys can be migrated yet, and the kernel of every node. The local node’s kernel comes from uname, the others from what their Ceph daemons reported when they started, which the report says per node. A node running no Ceph daemon is listed as unknown.
Ceph enforces the order of the migration. No key can use the new cipher before every monitor in the quorum runs the new binaries, so finish the rolling restart of all Ceph daemons first. Then migrate the keys in this order:
Rotate the service keys and switch the service tickets over, which clears both errors. Proxmox VE has a helper for this.
Rotate the client keys, client.admin included, if your clients can use the new cipher.
Drop the old cipher, which clears the last two warnings.
First decide which cipher the monitors should use for newly created keys. This choice applies to client and service keys, so the helper does not change the long-term setting. During a live key swap, the helper temporarily sets auth_preferred_cipher to aes256k, because Ceph cannot select a cipher explicitly when it creates a pending key. The helper restores the previous value when it finishes. If a run leaves the temporary value in place, the next run with --apply attempts to restore it before continuing.
ceph mon set auth_preferred_cipher aes256kSet it if every client of this cluster can already use the new cipher. A manager or metadata server created afterwards then gets the new cipher too, instead of raising the error again. Leave it at aes if you still have to create keys for kernel clients that do not support aes256k yet, and rotate any daemon that is added during the migration by hand. Either way you can pass --key-type on a single ceph auth command to override the default for that one key. OSDs are unaffected, as ceph-volume generates their keys locally and already uses the new cipher.
Then use the helper that Proxmox VE ships for the rotation itself. It checks that the monitors accept the new cipher, rotates the key of every MGR, MDS, and OSD one daemon at a time, writes the new key where that daemon reads it from, and switches the service tickets over at the end. It runs as a dry run and shows you the plan, unless you pass --apply:
/usr/share/pve-manager/migrations/pve-cephx-rotate-service-keys
Run the helper on one node only. It reaches the other nodes over SSH and drives the whole cluster from that node. For each daemon type it touches, the helper takes the same lock as the rolling restart in the web interface. This lock is advisory: Ceph’s configuration store has no compare-and-swap operation, so two jobs started at the same time can both acquire it. Do not start another helper or a rolling restart until the current run finishes.
A daemon that is stopped is migrated as well. Ceph does not list it, so the helper takes it from what each node reports about itself, writes the key where that daemon reads it, and leaves the daemon stopped. Otherwise a single stopped daemon would block the service ticket switch at the end of the migration.
It also repairs a stale mon. key in /etc/pve/priv/ceph.mon.keyring on its own, without --rotate-mon-key and without restarting anything, since that copy only matters for monitors created later.
Pass --help for the full list of options. Some are worth knowing about here:
Restrict the run to mon, to one daemon type, such as --only mgr, or to a single daemon, such as --only osd.3. Several can be given at once, either comma-separated or by repeating the option. Use this to try the migration on a few daemons first, or to repair a daemon that was left behind. A restricted run does not switch the service tickets over, as it cannot know that the keys it skipped are migrated. This only scopes the daemon keys and the mon. key. A client key is rotated whenever its own option asks for it.
Also rotate the shared mon. key. Ceph does not report that key as insecure, because it lives in the monitor keyrings rather than in the authentication database, so rotating it is not needed to clear either error. It is the most privileged key in the cluster though, so you may still want it on the new cipher. This restarts every monitor, one at a time. Note that rotating it moves the key into the authentication database, after which Ceph does report it like any other service key, and then this option becomes required rather than optional.
Stop, rotate and start each daemon instead of swapping its key while it runs. Normally the helper hands the new key to the running daemon, so nothing is stopped and clients stay connected. It falls back to this path on its own for a daemon that does not take the key that way, for a standby manager, which cannot take one while running, and for a daemon an earlier run already stopped. Because that can happen at any point, the noout flag is set for the run’s OSDs either way. Monitors always use this path, as they have no rotate-key command.
Also rotate the client.bootstrap-* keys and client.crash. Proxmox VE does not use these keys for storage I/O, so the kernel version does not restrict their rotation. Ceph deployment tools can use their standard keyrings. The helper updates each standard /var/lib/ceph/bootstrap-<type>/<cluster>.keyring that exists on a cluster node. It cannot find nonstandard or external copies, which remain on the old key.
Also rotate client.admin and rewrite every copy that Proxmox VE manages. This includes the authoritative keyring on the configuration file system, the keyring or secret of each managed Ceph storage that uses client.admin, the client.admin section of /etc/pve/priv/ceph.mon.keyring, and an existing copy in /etc/ceph on each node. The helper excludes storages that use monhost, because they refer to an external cluster. It also cannot update copies in scripts, on external hosts, or in other nonstandard locations.
Before using this option, verify that the independent mon. credential can read the current admin entry. This credential provides recovery if an interruption leaves the authoritative admin keyring stale:
ceph --name mon. --keyring /etc/pve/priv/ceph.mon.keyring \ auth get client.admin >/dev/null
To recover, export the current entry with the mon. credential, import it into both keyrings on the configuration file system, and verify a fresh client.admin connection. Remove the temporary keyring afterwards:
ceph --name mon. --keyring /etc/pve/priv/ceph.mon.keyring \ auth get client.admin -o /root/client.admin.recovery.keyring ceph-authtool /etc/pve/priv/ceph.client.admin.keyring \ --import-keyring /root/client.admin.recovery.keyring ceph-authtool /etc/pve/priv/ceph.mon.keyring \ --import-keyring /root/client.admin.recovery.keyring ceph -s rm /root/client.admin.recovery.keyring
Rotate the key of one Ceph storage that has its own user, and rewrite that storage’s keyring or secret. A storage that uses client.admin needs --rotate-admin-key instead, since that key is shared with the command line and with every other storage.
Do not ask for confirmation. Without it, --apply still asks once before it starts, and declines outright when standard input is not a terminal, which is what happens from a script or a pipe. -y is a synonym.
Continue when the cluster reports an unrelated health warning, such as a degraded placement group. Without this option, the helper refuses to start when it encounters a warning that it does not recognize. The helper never overrides a health error or a failed health query. It skips the health check when the run does not stop anything: no monitor needs a restart, the service cipher remains unchanged, and every daemon in the plan is already down. A daemon left down by an earlier run can itself cause the warning in that case. --force also overrides the kernel check for client keys. Rotating such a key can make every affected RBD image and CephFS mount unavailable on an unsupported node until it runs kernel 7.0 or newer.
Discard the rotating service keys at the end instead of waiting for them to expire, which clears AUTH_INSECURE_ROTATING_SERVICE_KEY_TYPE immediately. Every client then has to fetch a new ticket, and only clients running Ceph 19.2.6 or newer can, so use this only if all of them are upgraded.
How long to wait for a daemon to come back up, 600 by default.
After a successful unrestricted run, ceph -s no longer reports AUTH_INSECURE_SERVICE_KEY_TYPE or AUTH_INSECURE_SERVICE_TICKETS.
The helper records pre-rotation daemon keys and migration progress in /etc/pve/priv/cephx-key-migration.json. It uses this information to continue recorded work after an interruption. For example, it can recover a daemon that was left stopped after Ceph stopped listing it. It also clears only the noout flags that it set. If it finds a pending key that it cannot account for on an entity it would touch, it stops and explains how to commit or clear that key. A pending key on an unrelated client entity is only reported.
That file is the only copy of the pre-rotation keys, so keep it until you are satisfied that the cluster is healthy, then delete it, as it holds them in plain text. A file left over from a different cluster makes the helper refuse to start.
If you cannot use the helper, Ceph documents the whole procedure for a cluster
that is not managed by cephadm
[Upgrading and rotating cephx keys
https://docs.ceph.com/en/tentacle/rados/configuration/auth-config-ref/#cephx-upgrade]
.
Two of those steps need different handling on Proxmox VE, and both fail silently if
you miss them.
Upstream’s last steps cover the client keys as well. Read Rotate the Client Keys below before you follow them, in particular the warning about client.osd-lockbox keys, which must never be rotated.
The shared mon. key has to be merged into /etc/pve/priv/ceph.mon.keyring as well, because pveceph mon create feeds that file to ceph-mon --mkfs. Without it, every monitor created later cannot join the cluster:
ceph auth rotate --key-type=aes256k mon. -o /root/mon.keyring ceph-authtool /etc/pve/priv/ceph.mon.keyring --import-keyring /root/mon.keyring
An OSD keyring lives on a tmpfs that ceph-volume rebuilds on every boot, priming it from the osd_key entry in the bluestore label of the OSD’s block device. Writing only the keyring file therefore works until the next reboot, after which the OSD comes back with its old key and can no longer authenticate. The upstream procedure covers the label as an optional step and locates the device with ceph-volume lvm list. On Proxmox VE the block symlink in the OSD’s data directory already points at it, and priming the data directory from the label afterwards makes the new key effective without writing it twice.
Set the noout flag before you stop the first OSD, or the monitors start marking a stopped OSD out after at least ten minutes and the cluster begins to rebalance:
ceph osd set nooutThen, for the OSD with the ID 3, on its node:
systemctl stop ceph-osd@3 ceph osd down 3 ceph auth rotate --key-type=aes256k osd.3 -o /root/osd.3.keyring KEY=$(ceph-authtool /root/osd.3.keyring -n osd.3 --print-key) ceph-bluestore-tool set-label-key --dev /var/lib/ceph/osd/ceph-3/block \ --key osd_key --value "$KEY"
|
|
A stopped OSD keeps its block device open for a moment longer, so set-label-key can fail with a device busy error right after systemctl stop. Wait a few seconds and run it again. Do not start the OSD before the label is written, as its key in the authentication database has already changed. |
Check the label before you rebuild the data directory from it. whoami has to be the ID of this OSD and ceph_fsid the FSID of this cluster. If they are not, the device belongs to another OSD, and priming it would overwrite that OSD’s identity as well as its key:
ceph-bluestore-tool show-label --dev /var/lib/ceph/osd/ceph-3/blockThen rebuild the data directory and start the OSD again:
ceph-bluestore-tool prime-osd-dir --dev /var/lib/ceph/osd/ceph-3/block \ --path /var/lib/ceph/osd/ceph-3 --no-mon-config chown -R ceph:ceph /var/lib/ceph/osd/ceph-3 systemctl start ceph-osd@3
Once every OSD is done, unset the flag again:
ceph osd unset nooutRemove the keyring files that the rotations leave in /root afterwards, as they hold the keys of your cluster in plain text.
Migrate a client key only if every client that uses it supports aes256k. See Key Cipher Support for the userspace and kernel requirements. If a client does not meet them, leave its key on the old cipher. AUTH_INSECURE_CLIENT_KEY_TYPE then remains as a warning, but the cluster returns to HEALTH_WARN after the service keys are migrated.
Rotating client.admin makes the command-line interface unavailable until the new key is imported. To recover from an interrupted helper run, use the independent mon. credential described above. For a manual rotation, create and test a temporary admin identity instead:
ceph auth get-or-create client.admin-backup mon 'allow *' -o /root/backup.keyring ceph -n client.admin-backup --keyring /root/backup.keyring -s
Then rotate client.admin and import the new key into both keyrings on the configuration file system that hold it:
ceph auth rotate --key-type=aes256k client.admin -o /root/admin.keyring ceph-authtool /etc/pve/priv/ceph.client.admin.keyring --import-keyring /root/admin.keyring ceph-authtool /etc/pve/priv/ceph.mon.keyring --import-keyring /root/admin.keyring
Every node where pveceph init ran also has a copy in /etc/ceph/ceph.client.admin.keyring. Nothing reads it, as ceph.conf points at the one on the configuration file system, but it holds the most privileged key in the cluster, so replace it there too, on each node that has one.
Check that the cluster is still reachable, then remove the temporary key:
ceph auth rm client.admin-backupRotate the keys of all other clients the same way and import each new key into the keyring that the client uses. Do not forget client.crash, whose keyring is at /etc/pve/ceph/ceph.client.crash.keyring, as AUTH_INSECURE_CLIENT_KEY_TYPE does not clear while it is left out.
Storages need care of their own. Every RBD and CephFS storage keeps its own copy of the key it uses, whether it points at an external cluster or at the hyper-converged one on the node. A storage created without an explicit key holds a copy of client.admin, so rotating client.admin alone already cuts that storage off. The two storage types keep the key in a different format. An RBD storage holds a full keyring:
ceph auth get client.<ID> > /etc/pve/priv/ceph/<STORAGE_ID>.keyring
A CephFS storage holds only the bare key, so write that one with ceph auth get-key:
ceph auth get-key client.<ID> > /etc/pve/priv/ceph/<STORAGE_ID>.secret
|
|
Do not rotate a client.osd-lockbox.<UUID> key. Encrypted OSDs use it to fetch their LUKS passphrase, and its persistent copy lives in the ceph.cephx_lockbox_secret LVM tag on the OSD’s device rather than in a keyring, so a rotation leaves the two out of sync and the OSD cannot be unlocked at the next boot. Ceph lists such a key under AUTH_INSECURE_CLIENT_KEY_TYPE, so neither that warning can be cleared nor the old cipher dropped for as long as an encrypted OSD created before the upgrade exists. Recreating such an OSD moves it over, as ceph-volume generates its keys locally and already uses the new cipher. Otherwise, mute the warning as described below. |
Two warnings stay as long as the monitors still allow the old cipher, AUTH_INSECURE_KEYS_ALLOWED and AUTH_INSECURE_KEYS_CREATABLE. Once every service and client key is migrated, drop the old cipher to clear both:
ceph mon set auth_allowed_ciphers aes256k|
|
Only run this after ceph -s reports neither AUTH_INSECURE_SERVICE_KEY_TYPE nor AUTH_INSECURE_CLIENT_KEY_TYPE. Any key that still uses the old cipher can no longer authenticate afterwards, and that includes client.admin, which locks you out of the command line. To recover, add mon_auth_emergency_allowed_ciphers = aes,aes256k to the [mon] section of /etc/pve/ceph.conf and restart every monitor. The monitors read that setting only at startup, so ceph config set cannot help there. It raises the AUTH_EMERGENCY_CIPHERS_SET warning for as long as it is in place, so remove it again once the keys are sorted out. |
AUTH_INSECURE_ROTATING_SERVICE_KEY_TYPE needs no action. The monitors keep three rotating service keys and hand out fresh ones by themselves, so it clears about three hours after the service tickets were switched over, or three times auth_service_ticket_ttl if you raised it. To clear it at once instead, run ceph auth wipe-rotating-service-keys. Ceph does not recommend that, as every client then has to fetch a new ticket and only clients running 19.2.6 or newer can. Sessions that are already established are not affected.
Finally, remove the keyring files that the rotations left in /root, they hold the keys of your cluster in plain text.
If kernel clients keep you from migrating the client keys, you cannot drop the old cipher either, so AUTH_INSECURE_CLIENT_KEY_TYPE, AUTH_INSECURE_KEYS_ALLOWED, and AUTH_INSECURE_KEYS_CREATABLE all stay.
You can clear the last one outright, by telling the monitors to stop creating keys with the old cipher. Only do this once auth_preferred_cipher is aes256k, as every command that creates a key without an explicit --key-type fails otherwise:
ceph config set mon mon_auth_allow_insecure_key false
|
|
This rejects an explicit --key-type=aes as well, so you can no longer create a key for a kernel client that does not support the new cipher. If you still have to add such clients, leave mon_auth_allow_insecure_key unset and mute AUTH_INSECURE_KEYS_CREATABLE along with the other two. |
|
|
ceph config get mon mon_auth_allow_insecure_key reports false even while the monitors do still create such keys. As long as the option is unset, the monitors follow the authentication list instead, and stop creating keys with the old cipher by themselves once you drop it from that list. |
Mute the two that remain, as Mute a Health Check describes. Use a sticky mute for both: neither clears until the clients are upgraded.
ceph health mute AUTH_INSECURE_CLIENT_KEY_TYPE --sticky ceph health mute AUTH_INSECURE_KEYS_ALLOWED --sticky
To shut down the whole Proxmox VE + Ceph cluster, first stop all Ceph clients. These will mainly be VMs and containers. If you have additional clients that might access a Ceph FS or an installed RADOS GW, stop these as well. Highly available guests will switch their state to stopped when powered down via the Proxmox VE tooling.
Once all clients, VMs and containers are off or not accessing the Ceph cluster anymore, verify that the Ceph cluster is in a healthy state. Either via the Web UI or the CLI:
ceph -s
In order to not cause any recovery during the shut down and later power on phases, enable the noout OSD flag. Either in the Ceph → OSD panel behind the Manage Global Flags button or the CLI:
ceph osd set nooutStart powering down your nodes without a monitor (MON). After these nodes are down, continue by shutting down nodes with monitors on them.
When powering on the cluster, start the nodes with monitors (MONs) first. Once all nodes are up and running, confirm that all Ceph services are up and running. In the end, the only warning you should see for Ceph is that the noout flag is still set. You can disable it via the web UI or via the CLI:
ceph osd unset nooutYou can now start up the guests. Highly available guests will change their state to started when they power on.
It is possible to change the networks used by Ceph in a HCI setup without any downtime if both the old and new networks can be configured at the same time.
The procedure differs depending on which network you want to change.
|
|
A word of caution! It is critical that the change of the used networks by Ceph is being done carefully. Otherwise it could lead to a broken Ceph cluster with downtime to get it back into a working state! We recommend doing a trial run of the procedure in a (virtual) test cluster before changing the production infrastructure. |
After the new network has been configured on all hosts, make sure you test it before proceeding with the changes. One way is to ping all hosts on the new network. If you use a large MTU, make sure to also test that it works. For example by sending ping packets that will result in a final packet at the max MTU size.
To test an MTU of 9000, you will need the following packet sizes:
|
|
We assume a simple network configuration. In more complicated setups, you might need to configure a lower MTU to account for any headers that might be added once a packet leaves the host. |
|
IPv4
|
The overhead of IP and ICMP is 28 bytes; the resulting packet size for the ping then is 8972 bytes. |
|
IPv6
|
The overhead is 48 bytes and the resulting packet size is 8952 bytes. |
The resulting ping command will look like this for an IPv4:
ping -M do -s 8972 {target IP}
When you are switching between IPv4 and IPv6 networks, you need to make sure that the following options in the ceph.conf file are correctly set to true or false. These config options configure if Ceph services should bind to IPv4 or IPv6 addresses.
ms_bind_ipv4 = true ms_bind_ipv6 = false
The Ceph Public network is the main communication channel in a Ceph cluster between the different services and clients (for example, a VM). Changing it to a different network is not as simple as changing the Ceph Cluster network. The main reason is that besides the configuration in the ceph.conf file, the Ceph MONs (monitors) have an internal configuration where they keep track of all the other MONs that are part of the cluster, the monmap.
Therefore, the procedure to change the Ceph Public network is a bit more involved:
Change public_network in the /etc/pve/ceph.conf file (do not change any other value)
Restart non MON services: OSDs, MGRs and MDS on one host
Wait until Ceph is back to HEALTH_OK
Verify services are using the new network
Continue restarting services on the next host
Destroy one MON
Recreate MON
Wait until Ceph is back to HEALTH_OK
Continue destroying and recreating MONs
You first need to edit the /etc/pve/ceph.conf file. Change the public_network line to match the new subnet.
public_network = 10.9.9.30/24
|
|
Do not change the mon_host line or any [mon.HOSTNAME] sections. These will be updated automatically when the MONs are destroyed and recreated. |
|
|
Don’t worry if the host bits (for example, the last octet) are set by default, the netmask in CIDR notation defines the network part. |
After you have changed the network, you need to restart the non MON services in the cluster for the changes to take effect. Do so one node at a time! To restart all non MON services on one node, you can use the following commands on that node. Ceph has systemd targets for each type of service.
systemctl restart ceph-osd.target systemctl restart ceph-mgr.target systemctl restart ceph-mds.target
|
|
You will only have MDS daemons (Metadata Servers) if you use CephFS. |
|
|
After the first OSD service got restarted, the GUI will complain that the OSD is not reachable anymore. This is not an issue; VMs can still reach them. The reason for the message is that the MGR service cannot reach the OSD anymore. The error will vanish after the MGR services get restarted. |
|
|
Do not restart OSDs on multiple hosts at the same time. Chances are that for some PGs (placement groups), 2 out of the (default) 3 replicas will be down. This will result in I/O being halted until the minimum required number (min_size) of replicas is available again. |
To verify that the services are listening on the new network, you can run the following command on each node:
ss -tulpn | grep ceph|
|
Since OSDs will also listen on the Ceph Cluster network, expect to see that network too in the output of ss -tulpn. |
Once the Ceph cluster is back in a fully healthy state (HEALTH_OK), and the services are listening on the new network, continue to restart the services on the host.
The last services that need to be moved to the new network are the Ceph MONs themselves. The easiest way is to destroy and recreate each monitor one by one. This way, any mention of it in the ceph.conf and the monitor internal monmap is handled automatically.
Destroy the first MON and create it again. Wait a few moments before you continue on to the next MON in the cluster, and make sure the cluster reports HEALTH_OK before proceeding.
Once all MONs are recreated, you can verify that any mention of MONs in the ceph.conf file references the new network. That means mainly the mon_host line and the [mon.HOSTNAME] sections.
One final ss -tulpn | grep ceph should show that the old network is not used by any Ceph service anymore.
The Ceph Cluster network is used for the replication traffic between the OSDs. Therefore, it can be beneficial to place it on its own fast physical network.
The overall procedure is:
Change cluster_network in the /etc/pve/ceph.conf file
Restart OSDs on one host
Wait until Ceph is back to HEALTH_OK
Verify OSDs are using the new network
Continue restarting OSDs on the next host
You first need to edit the /etc/pve/ceph.conf file. Change the cluster_network line to match the new subnet.
cluster_network = 10.9.9.30/24
|
|
Don’t worry if the host bits (for example, the last octet) are set by default; the netmask in CIDR notation defines the network part. |
After you have changed the network, you need to restart the OSDs in the cluster for the changes to take effect. Do so one node at a time! To restart all OSDs on one node, you can use the following command on the CLI on that node:
systemctl restart ceph-osd.target|
|
Do not restart OSDs on multiple hosts at the same time. Chances are that for some PGs (placement groups), 2 out of the (default) 3 replicas will be down. This will result in I/O being halted until the minimum required number (min_size) of replicas is available again. |
To verify that the OSD services are listening on the new network, you can either check the OSD Details → Network tab in the Ceph → OSD panel or by running the following command on the host:
ss -tulpn | grep ceph-osd|
|
Since OSDs will also listen on the Ceph Public network, expect to see that network too in the output of ss -tulpn. |
Once the Ceph cluster is back in a fully healthy state (HEALTH_OK), and the OSDs are listening on the new network, continue to restart the OSDs on the next host.
It is important to continuously monitor the health of a Ceph deployment from the beginning, either by using the Ceph tools or by accessing the status through the Proxmox VE API.
The following Ceph commands can be used to see if the cluster is healthy (HEALTH_OK), if there are warnings (HEALTH_WARN), or even errors (HEALTH_ERR). If the cluster is in an unhealthy state, the status commands below will also give you an overview of the current events and actions to take. To stop their execution, press CTRL-C.
Continuously watch the cluster status:
watch ceph --status
Print the cluster status once (not being updated) and continuously append lines of status events:
ceph --watch
This section includes frequently used troubleshooting information.
More information can be found on the official Ceph website under
Troubleshooting
[Ceph troubleshooting https://docs.ceph.com/en/tentacle/rados/troubleshooting/]
.
System → System Log or via the CLI, for example of the last 2 days:
journalctl --since "2 days ago"IPMI and RAID controller logs
Ceph service crashes can be listed and viewed in detail by running the following commands:
ceph crash ls ceph crash info <crash_id>
Crashes marked as new can be acknowledged by running:
ceph crash archive-all
To get a more detailed view, every Ceph service has a log file under
/var/log/ceph/. If more detail is required, the log level can be
adjusted
[Ceph log and debugging https://docs.ceph.com/en/tentacle/rados/troubleshooting/log-and-debug/]
.
Network problems like congestion, a faulty switch, a shut down interface or a blocking firewall. Check whether all Proxmox VE nodes are reliably reachable on the corosync cluster network and on the Ceph public and cluster network.
Disk or connection parts which are:
defective
not firmly mounted
lacking I/O performance under higher load (e.g. when using HDDs, consumer hardware or inadvisable RAID controllers)
Not fulfilling the recommendations for a healthy Ceph cluster.
A faulty OSD will be reported as down and mostly (auto) out 10 minutes later. Depending on the cause, it can also automatically become up and in again. To try a manual activation via web interface, go to Any node → Ceph → OSD, select the OSD and click on Start, In and Reload. When using the shell, run following command on the affected node:
ceph-volume lvm activate --all
To activate a failed OSD, it may be necessary to safely reboot the respective node or, as a last resort, to recreate or replace the OSD.