Module to provide ceph control with salt.
ceph_cfg Python module
New in version 2016.11.0.
Get the version of ceph installed
CLI Example:
salt '*' ceph.ceph_version
Get the cluster's quorum status
CLI Example:
salt '*' ceph.cluster_quorum \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
The cluster UUID. Defaults to value found in ceph config file.
The cluster name. Defaults to ceph
.
Get the cluster status, including health if in quorum
CLI Example:
salt '*' ceph.cluster_status \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
The cluster UUID. Defaults to value found in ceph config file.
The cluster name. Defaults to ceph
.
Add keyring to authorized list
CLI Example:
salt '*' ceph.keyring_auth_add \
'keyring_type'='admin' \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
One of admin
, mon
, osd
, rgw
, mds
The cluster UUID. Defaults to value found in ceph config file.
The cluster name. Defaults to ceph
.
Remove keyring from authorised list
CLI Example:
salt '*' ceph.keyring_osd_auth_del \
'keyring_type'='admin' \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
One of admin
, mon
, osd
, rgw
, mds
The cluster UUID. Defaults to value found in ceph config file.
The cluster name. Defaults to ceph
.
List all cephx authorization keys
CLI Example:
salt '*' ceph.keyring_auth_list \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
The cluster name. Defaults to ceph
.
The cluster UUID. Defaults to value found in ceph config file.
Create keyring for cluster
CLI Example:
salt '*' ceph.keyring_create \
'keyring_type'='admin' \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
One of admin
, mon
, osd
, rgw
, mds
The cluster UUID. Defaults to value found in ceph config file.
The cluster name. Defaults to ceph
.
Returns True
if the keyring is present on disk, otherwise False
CLI Example:
salt '*' ceph.keyring_present \
'keyring_type'='admin' \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
One of admin
, mon
, osd
, rgw
, mds
The cluster UUID. Defaults to value found in ceph config file.
The cluster name. Defaults to ceph
.
Delete keyring for cluster
CLI Example:
salt '*' ceph.keyring_purge \
'keyring_type'='admin' \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
One of admin
, mon
, osd
, rgw
, mds
The cluster UUID. Defaults to value found in ceph config file.
The cluster name. Defaults to ceph
.
If no ceph config file is found, this command will fail.
Create save keyring locally
CLI Example:
salt '*' ceph.keyring_save \
'keyring_type'='admin' \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
One of admin
, mon
, osd
, rgw
, mds
The cluster UUID. Defaults to value found in ceph config file.
The cluster name. Defaults to ceph
.
Create a mds
CLI Example:
salt '*' ceph.mds_create \
'name' = 'mds.name' \
'port' = 1000, \
'addr' = 'fqdn.example.org' \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
The MDS name (must start with mds.
)
Port to which the MDS will listen
Address or IP address for the MDS to listen
The cluster UUID. Defaults to value found in ceph config file.
The cluster name. Defaults to ceph
.
Remove a mds
CLI Example:
salt '*' ceph.mds_destroy \
'name' = 'mds.name' \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
The MDS name (must start with mds.
)
The cluster UUID. Defaults to value found in ceph config file.
The cluster name. Defaults to ceph
.
Returns True
if the mon daemon is running, otherwise False
CLI Example:
salt '*' ceph.mon_active \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
The cluster UUID. Defaults to value found in ceph config file.
The cluster name. Defaults to ceph
.
Create a mon node
CLI Example:
salt '*' ceph.mon_create \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
The cluster UUID. Defaults to value found in ceph config file.
The cluster name. Defaults to ceph
.
Returns True
if the target is a mon node, otherwise False
CLI Example:
salt '*' ceph.mon_is \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
The cluster name. Defaults to ceph
.
The cluster UUID. Defaults to value found in ceph config file.
Returns True
if the mon daemon is in the quorum, otherwise False
CLI Example:
salt '*' ceph.mon_quorum \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
The cluster UUID. Defaults to value found in ceph config file.
The cluster name. Defaults to ceph
.
Get status from mon daemon
CLI Example:
salt '*' ceph.mon_status \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
The cluster UUID. Defaults to value found in ceph config file.
The cluster name. Defaults to ceph
.
Activate an OSD
CLI Example:
salt '*' ceph.osd_activate 'osd_dev'='/dev/vdc'
List all OSD by cluster
CLI Example:
salt '*' ceph.osd_discover
Prepare an OSD
CLI Example:
salt '*' ceph.osd_prepare 'osd_dev'='/dev/vdc' \
'journal_dev'='device' \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid' \
'osd_fs_type'='xfs' \
'osd_uuid'='2a143b73-6d85-4389-a9e9-b8a78d9e1e07' \
'journal_uuid'='4562a5db-ff6f-4268-811d-12fd4a09ae98'
The device to store the osd data on.
The journal device. defaults to osd_dev.
The cluster name. Defaults to ceph
.
The cluster date will be added too. Defaults to the value found in local config.
set the file system to store OSD data with. Defaults to "xfs".
set the OSD data UUID. If set will return if OSD with data UUID already exists.
set the OSD journal UUID. If set will return if OSD with journal UUID already exists.
Check whether a given device path is a partition or a full disk.
CLI Example:
salt '*' ceph.partition_is /dev/sdc1
List partitions by disk
CLI Example:
salt '*' ceph.partition_list
List all OSD journal partitions by partition
CLI Example:
salt '*' ceph.partition_list_journal
List all OSD data partitions by partition
CLI Example:
salt '*' ceph.partition_list_osd
Create a pool
CLI Example:
salt '*' ceph.pool_add pool_name \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
The cluster name. Defaults to ceph
.
The cluster UUID. Defaults to value found in ceph config file.
Default to 8
Default to pg_num
can take values "replicated" or "erasure"
The "erasure_code_profile"
The crush map rule set
Delete a pool
CLI Example:
salt '*' ceph.pool_del pool_name \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
The cluster name. Defaults to ceph
.
The cluster UUID. Defaults to value found in ceph config file.
List all pools
CLI Example:
salt '*' ceph.pool_list \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
The cluster name. Defaults to ceph
.
The cluster UUID. Defaults to value found in ceph config file.
purge ceph configuration on the node
CLI Example:
salt '*' ceph.purge \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
The cluster name. Defaults to ceph
.
The cluster UUID. Defaults to value found in ceph config file.
Create a rgw
CLI Example:
salt '*' ceph.rgw_create \
'name' = 'rgw.name' \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
The RGW client name. Must start with rgw.
The cluster UUID. Defaults to value found in ceph config file.
The cluster name. Defaults to ceph
.
Remove a rgw
CLI Example:
salt '*' ceph.rgw_destroy \
'name' = 'rgw.name' \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
The RGW client name (must start with rgw.
)
The cluster UUID. Defaults to value found in ceph config file.
The cluster name. Defaults to ceph
.
Create pools for rgw
CLI Example:
salt '*' ceph.rgw_pools_create
The cluster UUID. Defaults to value found in ceph config file.
The cluster name. Defaults to ceph
.
Show pools missing for rgw
CLI Example:
salt '*' ceph.rgw_pools_missing
The cluster UUID. Defaults to value found in ceph config file.
The cluster name. Defaults to ceph
.
Destroy the partition table and content of a given disk.
salt '*' ceph.osd_prepare 'dev'='/dev/vdc' \
'cluster_name'='ceph' \
'cluster_uuid'='cluster_uuid'
The block device to format.
The cluster name. Defaults to ceph
.
The cluster UUID. Defaults to value found in ceph config file.