salt.modules.ceph module

Module to provide ceph control with salt.

depends:
  • ceph_cfg Python module

New in version 2016.11.0.

salt.modules.ceph.ceph_version()

Get the version of ceph installed

salt.modules.ceph.cluster_quorum(**kwargs)

Get the cluster's quorum status

CLI Example:

salt '*' ceph.cluster_quorum \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes: Get the cluster quorum status.

Scope: Cluster wide

Arguments:

cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
cluster_name
Set the cluster name. Defaults to "ceph".
salt.modules.ceph.cluster_status(**kwargs)

Get the cluster status

CLI Example:

salt '*' ceph.cluster_status \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes: Get the cluster status including health if in quorum.

Scope: Cluster wide

Arguments:

cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
cluster_name
Set the cluster name. Defaults to "ceph".
salt.modules.ceph.keyring_auth_add(**kwargs)

Add keyring to authorised list

CLI Example:

salt '*' ceph.keyring_auth_add \
        'keyring_type'='admin' \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes:

keyring_type

Required paramter Can be set to:

admin, mon, osd, rgw, mds
cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
cluster_name
Set the cluster name. Defaults to "ceph".
salt.modules.ceph.keyring_auth_del(**kwargs)

Remove keyring from authorised list

CLI Example:

salt '*' ceph.keyring_osd_auth_del \
        'keyring_type'='admin' \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes:

keyring_type

Required paramter Can be set to:

admin, mon, osd, rgw, mds
cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
cluster_name
Set the cluster name. Defaults to "ceph".
salt.modules.ceph.keyring_auth_list(**kwargs)

List all cephx authorization keys

CLI Example:

salt '*' ceph.keyring_auth_list \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes:

cluster_name
Set the cluster name. Defaults to "ceph".
cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
salt.modules.ceph.keyring_create(**kwargs)

Create keyring for cluster

CLI Example:

salt '*' ceph.keyring_create \
        'keyring_type'='admin' \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes:

keyring_type

Required paramter Can be set to:

admin, mon, osd, rgw, mds
cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
cluster_name
Set the cluster name. Defaults to "ceph".
salt.modules.ceph.keyring_present(**kwargs)

Is keyring on disk

CLI Example:

salt '*' ceph.keyring_present \
        'keyring_type'='admin' \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes:

keyring_type

Required paramter Can be set to:

admin, mon, osd, rgw, mds
cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
cluster_name
Set the cluster name. Defaults to "ceph".
salt.modules.ceph.keyring_purge(**kwargs)

Delete keyring for cluster

CLI Example:

salt '*' ceph.keyring_purge \
        'keyring_type'='admin' \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes:

keyring_type

Required paramter Can be set to:

admin, mon, osd, rgw, mds
cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
cluster_name
Set the cluster name. Defaults to "ceph".

If no ceph config file is found, this command will fail.

salt.modules.ceph.keyring_save(**kwargs)

Create save keyring locally

CLI Example:

salt '*' ceph.keyring_save \
        'keyring_type'='admin' \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid' \
        ''

Notes:

keyring_type

Required paramter Can be set to:

admin, mon, osd, rgw, mds
cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
cluster_name
Set the cluster name. Defaults to "ceph".
salt.modules.ceph.mds_create(**kwargs)

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'

Notes:

name:
Required paramter Set the rgw client name. Must start with 'mds.'
port:
Required paramter Port for the mds to listen to.
addr:
Required paramter Address or IP address for the mds to listen to.
cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
cluster_name
Set the cluster name. Defaults to "ceph".
salt.modules.ceph.mds_destroy(**kwargs)

Remove a mds

CLI Example:

salt '*' ceph.mds_destroy \
        'name' = 'mds.name' \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes:

name:
Required paramter Set the rgw client name. Must start with 'mds.'
cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
cluster_name
Set the cluster name. Defaults to "ceph".
salt.modules.ceph.mon_active(**kwargs)

Is mon deamon running

CLI Example:

salt '*' ceph.mon_active \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes:

cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
cluster_name
Set the cluster name. Defaults to "ceph".
salt.modules.ceph.mon_create(**kwargs)

Create a mon node

CLI Example:

salt '*' ceph.mon_create \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes:

cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
cluster_name
Set the cluster name. Defaults to "ceph".
salt.modules.ceph.mon_is(**kwargs)

Is this a mon node

CLI Example:

salt '*' ceph.mon_is \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes:

cluster_name
Set the cluster name. Defaults to "ceph".
cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
salt.modules.ceph.mon_quorum(**kwargs)

Is mon deamon in quorum

CLI Example:

salt '*' ceph.mon_quorum \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes:

cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
cluster_name
Set the cluster name. Defaults to "ceph".
salt.modules.ceph.mon_status(**kwargs)

Get status from mon deamon

CLI Example:

salt '*' ceph.mon_status \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes:

cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
cluster_name
Set the cluster name. Defaults to "ceph".
salt.modules.ceph.osd_activate(**kwargs)

Activate an OSD

CLI Example:

salt '*' ceph.osd_activate 'osd_dev'='/dev/vdc'
salt.modules.ceph.osd_discover()

List all OSD by cluster

CLI Example:

salt '*' ceph.osd_discover
salt.modules.ceph.osd_prepare(**kwargs)

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'

Notes:

cluster_uuid
Set the deivce to store the osd data on.
journal_dev
Set the journal device. defaults to osd_dev.
cluster_name
Set the cluster name. Defaults to "ceph".
cluster_uuid
Set the cluster date will be added too. Defaults to the value found in local config.
osd_fs_type
set the file system to store OSD data with. Defaults to "xfs".
osd_uuid
set the OSD data UUID. If set will return if OSD with data UUID already exists.
journal_uuid
set the OSD journal UUID. If set will return if OSD with journal UUID already exists.
salt.modules.ceph.partition_is(dev)

Check whether a given device path is a partition or a full disk.

CLI Example:


salt '*' ceph.partition_is /dev/sdc1

salt.modules.ceph.partition_list()

List partitions by disk

CLI Example:

salt '*' ceph.partition_list
salt.modules.ceph.partition_list_journal()

List all OSD journal partitions by partition

CLI Example:

salt '*' ceph.partition_list_journal
salt.modules.ceph.partition_list_osd()

List all OSD data partitions by partition

CLI Example:

salt '*' ceph.partition_list_osd
salt.modules.ceph.pool_add(pool_name, **kwargs)

Create a pool

CLI Example:

salt '*' ceph.pool_add pool_name \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes:

cluster_name
Set the cluster name. Defaults to "ceph".
cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
pg_num
Default to 8
pgp_num
Default to pg_num
pool_type
can take values "replicated" or "erasure"
erasure_code_profile
Set the "erasure_code_profile"
crush_ruleset
Set the crush map rule set
salt.modules.ceph.pool_del(pool_name, **kwargs)

Delete a pool

CLI Example:

salt '*' ceph.pool_del pool_name \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes:

cluster_name
Set the cluster name. Defaults to "ceph".
cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
salt.modules.ceph.pool_list(**kwargs)

List all pools

CLI Example:

salt '*' ceph.pool_list \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes:

cluster_name
Set the cluster name. Defaults to "ceph".
cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
salt.modules.ceph.purge(**kwargs)

purge ceph configuration on the node

CLI Example:

salt '*' ceph.purge \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes:

cluster_name
Set the cluster name. Defaults to "ceph".
cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
salt.modules.ceph.rgw_create(**kwargs)

Create a rgw

CLI Example:

salt '*' ceph.rgw_create \
        'name' = 'rgw.name' \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes:

name:
Required paramter Set the rgw client name. Must start with 'rgw.'
cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
cluster_name
Set the cluster name. Defaults to "ceph".
salt.modules.ceph.rgw_destroy(**kwargs)

Remove a rgw

CLI Example:

salt '*' ceph.rgw_destroy \
        'name' = 'rgw.name' \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes:

name:
Required paramter Set the rgw client name. Must start with 'rgw.'
cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
cluster_name
Set the cluster name. Defaults to "ceph".
salt.modules.ceph.rgw_pools_create(**kwargs)

Create pools for rgw

CLI Example:

salt '*' ceph.rgw_pools_create

Notes:

cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
cluster_name
Set the cluster name. Defaults to "ceph".
salt.modules.ceph.rgw_pools_missing(**kwargs)

Show pools missing for rgw

CLI Example:

salt '*' ceph.rgw_pools_missing

Notes:

cluster_uuid
Set the cluster UUID. Defaults to value found in ceph config file.
cluster_name
Set the cluster name. Defaults to "ceph".
salt.modules.ceph.zap(target=None, **kwargs)

Destroy the partition table and content of a given disk.

salt '*' ceph.osd_prepare 'dev'='/dev/vdc' \
        'cluster_name'='ceph' \
        'cluster_uuid'='cluster_uuid'

Notes:

dev
The block device to format.
cluster_name
Set the cluster name. Defaults to "ceph".
cluster_uuid
Set the cluster date will be added too. Defaults to the value found in local config.