-
Notifications
You must be signed in to change notification settings - Fork 166
CephCluster() class for cluster related operations
The idea is to have all cluster related utilities and functionalities under one class which makes it easy to perform ceph cluster operations in a context sensitive way.
CephCluster class holds in context the CephCluster(OCS) object and CephFilesystem objects. https://github.com/red-hat-storage/ocs-ci/blob/master/ocs/cluster.py#L73 and all cluster operations revolve around this context.
As of now this class doesn't perform any create operations like create_cluster or create_cephfs etc.
https://github.com/red-hat-storage/ocs-ci/blob/master/ocs/cluster.py#L113-#L118 CephCluster holds the cluster entity objects(pod objects) for mons, mgrs, osds and mdss.
https://github.com/red-hat-storage/ocs-ci/blob/master/ocs/cluster.py#L93 scan_cluster() method is responsible for keeping the CephCluster object in sync with the cluster status. Any update operations user performs must use scan_cluster() method at the end so that everything is uptodate in CephCluster object.
https://github.com/red-hat-storage/ocs-ci/blob/master/ocs/cluster.py#L159 For cluster health checks please use cluster_health_check() method, also there is room for significant improvement in this function.
https://github.com/red-hat-storage/ocs-ci/blob/master/ocs/cluster.py#L214 For adding or removing monitors please use mon_change_count(), in which you have to provide absolute number of mons required in the cluster. users can write wrappers like add_mon() , remove_mon() on top of this. similary we have mds_change_count().
few ops we might need
- add/remove osds
- kill/restart osds,mons,mdss
- get_primary_osd for pgs
- Improve ceph_health_check parameters many more on need basis.