Ceph storage create pool has a possibility of deleting exist pool

If someone try to create a ceph storage which has the same name as an exist one, the exist pool may be deleted

here checks whether ceph pool is exist
check pool

the osdPoolExists() checks pool exist by cmd return
osdPoolExists

This means if there’s a temp error (network jitter or any other reason) about ceph while osdPoolExists() querying, lxd will try to create pool.
And if the error fix at a short time, lxd will create fail beacuse of the name of pool is exist, and delete the exist pool by revert?

I try the following steps:

  1. create a pool named ‘remote3’: lxc storage create remote3 ceph --verbose
  2. change my ceph key to a wrong value
  3. create a pool named ‘remote3’ again: lxc storage create remote3 ceph --verbose
  4. set correct ceph key immediately, and ‘remote3’ will be delete by lxd.

Deleting will also happen even if I set ctrl+C to stop lxd commend after step 3. If I do this, there’s even no error log on my terminal

Please can you log an issue here Issues · canonical/lxd · GitHub

ok, I have created an issue: Ceph storage create pool has a possibility of deleting exist pool · Issue #12163 · canonical/lxd · GitHub

1 Like