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

CLI Example:

salt '*' ceph.ceph_version
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'
cluster_uuid

The cluster UUID. Defaults to value found in ceph config file.

cluster_name

The cluster name. Defaults to ceph.

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

Get the cluster status, including health if in quorum

CLI Example:

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

The cluster UUID. Defaults to value found in ceph config file.

cluster_name

The cluster name. Defaults to ceph.

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

Add keyring to authorized list

CLI Example:

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

One of admin, mon, osd, rgw, mds

cluster_uuid

The cluster UUID. Defaults to value found in ceph config file.

cluster_name

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'
keyring_type (required)

One of admin, mon, osd, rgw, mds

cluster_uuid

The cluster UUID. Defaults to value found in ceph config file.

cluster_name

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'
cluster_name

The cluster name. Defaults to ceph.

cluster_uuid

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'
keyring_type (required)

One of admin, mon, osd, rgw, mds

cluster_uuid

The cluster UUID. Defaults to value found in ceph config file.

cluster_name

The cluster name. Defaults to ceph.

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

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'
keyring_type (required)

One of admin, mon, osd, rgw, mds

cluster_uuid

The cluster UUID. Defaults to value found in ceph config file.

cluster_name

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'
keyring_type (required)

One of admin, mon, osd, rgw, mds

cluster_uuid

The cluster UUID. Defaults to value found in ceph config file.

cluster_name

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'
keyring_type (required)

One of admin, mon, osd, rgw, mds

cluster_uuid

The cluster UUID. Defaults to value found in ceph config file.

cluster_name

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'
name (required)

The MDS name (must start with mds.)

port (required)

Port to which the MDS will listen

addr (required)

Address or IP address for the MDS to listen

cluster_uuid

The cluster UUID. Defaults to value found in ceph config file.

cluster_name

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'
name (required)

The MDS name (must start with mds.)

cluster_uuid

The cluster UUID. Defaults to value found in ceph config file.

cluster_name

The cluster name. Defaults to ceph.

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

Returns True if the mon daemon is running, otherwise False

CLI Example:

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

The cluster UUID. Defaults to value found in ceph config file.

cluster_name

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'
cluster_uuid

The cluster UUID. Defaults to value found in ceph config file.

cluster_name

The cluster name. Defaults to ceph.

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

Returns True if the target is a mon node, otherwise False

CLI Example:

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

The cluster name. Defaults to ceph.

cluster_uuid

The cluster UUID. Defaults to value found in ceph config file.

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

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'
cluster_uuid

The cluster UUID. Defaults to value found in ceph config file.

cluster_name

The cluster name. Defaults to ceph.

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

Get status from mon daemon

CLI Example:

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

The cluster UUID. Defaults to value found in ceph config file.

cluster_name

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'
cluster_uuid

The device to store the osd data on.

journal_dev

The journal device. defaults to osd_dev.

cluster_name

The cluster name. Defaults to ceph.

cluster_uuid

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'
cluster_name

The cluster name. Defaults to ceph.

cluster_uuid

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

The "erasure_code_profile"

crush_ruleset

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'
cluster_name

The cluster name. Defaults to ceph.

cluster_uuid

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'
cluster_name

The cluster name. Defaults to ceph.

cluster_uuid

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'
cluster_name

The cluster name. Defaults to ceph.

cluster_uuid

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'
name (required)

The RGW client name. Must start with rgw.

cluster_uuid

The cluster UUID. Defaults to value found in ceph config file.

cluster_name

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'
name (required)

The RGW client name (must start with rgw.)

cluster_uuid

The cluster UUID. Defaults to value found in ceph config file.

cluster_name

The cluster name. Defaults to ceph.

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

Create pools for rgw

CLI Example:

salt '*' ceph.rgw_pools_create
cluster_uuid

The cluster UUID. Defaults to value found in ceph config file.

cluster_name

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
cluster_uuid

The cluster UUID. Defaults to value found in ceph config file.

cluster_name

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'
dev

The block device to format.

cluster_name

The cluster name. Defaults to ceph.

cluster_uuid

The cluster UUID. Defaults to value found in ceph config file.