canonical / microcloud

Automated private cloud based on LXD, Ceph and OVN
https://microcloud.is
GNU Affero General Public License v3.0
280 stars 44 forks source link

OSD replication factor applies to all pools #385

Open masnax opened 2 months ago

masnax commented 2 months ago

We adjust the replication factor for OSDs up to 3 when adding systems to a MicroCloud.

We do this by specifying Pools: []string{"*"} which applies the replication factor to all pools. However, if these pools' sizes were manually modified, MicroCloud will not have this context and will overwrite the user configuration on each run of microcloud add, microcloud service add, and even microcloud init with an existing MicroCeph.

We will need to add a GET /1.0/pools-op to MicroCeph to fetch current pool sizes from ceph.

With this endpoint, we can inspect the current pool configuration and make inferences about whether we should change it:

A "managed" pool is one that MicroCloud sets up. So that means lxd_remote, lxd_cephfs, lxd_cephfs_meta, lxd_cephfs_data, and .mgr.

roosterfish commented 2 months ago

Can we use the LXD client to query for both the remote and remote-fs pools? This way we don't have to query Ceph directly.

masnax commented 2 months ago

Even that isn't quite enough because we also need to make sure the replication size isn't already customized to a higher value. Otherwise we would reset them all back to 3 each time a node is added.