
How to Safely Remove a Ceph Datastore from Proxmox VE
Managing storage in Proxmox VE is typically straightforward, but when working with a distributed storage system like Ceph, certain tasks require more than a simple click in the web interface. A common challenge is attempting to remove a Ceph storage pool, only to be met with a persistent error message in your system logs, such as TASK ERROR: rbd status failed: rbd: listing images failed: (2) No such file or directory
.
This error occurs because simply removing the storage entry from the Proxmox GUI doesn’t fully decouple the underlying Ceph components. Proxmox services, like pvestatd
, continue to try and query the pool, leading to a failed state.
This guide provides the complete, correct procedure to cleanly and safely remove a Ceph datastore from your Proxmox environment, ensuring system stability and eliminating frustrating errors.
Before You Begin: Critical Prerequisites
Before proceeding with any removal steps, it is essential to take precautions. Incorrectly executing these commands can lead to data loss.
- Full Backups: Ensure you have complete, verified backups of all VMs and containers residing on the Ceph pool you intend to remove.
- Data Migration: You must first move or delete all virtual disks and container images from the Ceph pool. The pool must be completely empty before you can destroy it.
- Root Access: You will need root or
sudo
access to your Proxmox nodes via the command line (SSH).
Step-by-Step Guide to Removing a Ceph Pool
Follow these steps in order to ensure a clean removal process.
Step 1: Empty the Ceph Pool
The first and most important step is to migrate all data off the target Ceph pool.
- Identify all VMs and containers using the Ceph pool you wish to remove.
- Use Proxmox’s built-in tools to migrate the virtual disks to another available storage. For VMs, this is done via the “Move Disk” function. For containers, use “Move Volume.”
- If you no longer need the data, you can delete the VMs and containers directly.
- Verify the pool is empty. You must be absolutely certain no data remains before proceeding.
Step 2: Remove the Storage from the Proxmox GUI
Once the pool is empty, you can remove its entry from the Proxmox storage configuration.
- Navigate to Datacenter -> Storage in your Proxmox web interface.
- Select the Ceph storage pool you want to remove.
- Click the “Remove” button and confirm the action.
This action removes the configuration from /etc/pve/storage.cfg
but does not affect the Ceph cluster itself. At this point, you will likely start seeing the rbd status failed
error in your logs.
Step 3: Destroy the Ceph Pool via Command Line
This is the crucial step that the GUI doesn’t perform. You must manually destroy the now-empty pool from the Ceph cluster.
- Log in to a Proxmox node via SSH.
- First, list your Ceph pools to confirm the exact name of the one you want to delete:
bash
ceph osd pool ls
- Once you have the correct name, use the following command to permanently destroy the pool. This command has multiple safeguards to prevent accidental deletion, so type it carefully.
bash
ceph osd pool delete <pool_name> <pool_name> --yes-i-really-really-mean-it
You must enter the pool name twice, followed by the--yes-i-really-really-mean-it
flag. This is a final confirmation that you understand the action is irreversible.
Step 4: Restart Proxmox Services to Clear Errors
After the pool has been properly destroyed, the errors from pvestatd
should cease. To expedite this, you can restart the service manually.
- On any Proxmox node, run the following command to restart the Proxmox status daemon:
bash
systemctl restart pvestatd.service
- Monitor your system logs to confirm that the
rbd status failed
errors have stopped. You can watch the logs in real-time with:
bash
journalctl -f
At this point, you have successfully removed a single Ceph storage pool from your Proxmox setup.
Advanced: Completely Decommissioning Ceph from Proxmox
If your goal is not just to remove a single pool but to completely remove the entire Ceph cluster and all its services from your Proxmox nodes, you must perform additional cleanup steps.
Warning: This procedure is highly destructive and will remove all Ceph services and configurations from your Proxmox cluster. Only proceed if you are decommissioning Ceph entirely.
- Follow all the steps above to remove every Ceph storage pool.
- On each Proxmox node, use the
pveceph
tool to purge the local Ceph configuration:
bash
pveceph purge
- Manually remove the main Ceph configuration file that might be left behind:
bash
rm /etc/pve/ceph.conf
- Stop and disable any remaining Ceph services on each node to prevent them from starting on boot.
- Finally, reboot each Proxmox node to ensure a clean state without any lingering Ceph processes.
By following this comprehensive guide, you can confidently manage your Proxmox and Ceph storage environment, whether you’re removing a single pool or decommissioning the entire system. Always prioritize backing up your data before performing significant storage operations to ensure a safe and recoverable process.
Source: https://nolabnoparty.com/come-rimuovere-ceph-datastore-da-proxmox/