ceph_api package

Submodules

ceph_api.ceph_command module

class ceph_api.ceph_command.AuthCommand(rados_config_file)
auth_add(entity, caps=None)

add auth info for <entity> from input file, or random key if no ” “input is given, and/or any caps specified in the command

Parameters:
  • caps – six.string_types allowed repeats=many
  • entity – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
auth_caps(caps, entity)

update caps for <name> from caps specified in the command

Parameters:
  • caps – six.string_types allowed repeats=many
  • entity – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
auth_del(entity)

delete all caps for <name>

Parameters:

entity – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
auth_export(entity=None)

write keyring for requested entity, or master keyring if none given

Parameters:

entity – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
auth_get(entity)

write keyring file with requested key

Parameters:

entity – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
auth_get_key(entity)

display requested key

Parameters:

entity – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
auth_get_or_create(entity, caps=None)

add auth info for <entity> from input file, or random key if no input given, and/or any caps specified in the command

Parameters:
  • caps – six.string_types allowed repeats=many
  • entity – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
auth_get_or_create_key(entity, caps=None)

get, or add, key for <name> from system/caps pairs specified in the command. If key already exists, any given caps must match the existing caps for that key.

Parameters:
  • entity – six.string_types allowed repeats=one
  • caps – six.string_types allowed repeats=many
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
auth_import()

auth import: read keyring file from -i <file>

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
auth_list()

list authentication state

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
auth_print_key(entity)

display requested key

Parameters:

entity – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
auth_print_key_2(entity)

display requested key

Parameters:

entity – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
auth_rm(entity)

remove all caps for <name>

Parameters:

entity – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
exception ceph_api.ceph_command.CephError(cmd, msg)

Bases: exceptions.Exception

Exception raised for errors with running a Ceph command

Parameters:
  • cmd – cmd in which the error occurred
  • msg – explanation of the error
class ceph_api.ceph_command.ConfigKeyCommand(rados_config_file)
config_key_del(key)

delete <key>

Parameters:

key – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
config_key_exists(key)

check for <key>’s existence

Parameters:

key – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
config_key_get(key)

get <key>

Parameters:

key – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
config_key_list()

list keys

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
config_key_put(key, val=None)

put <key>, value <val>

Parameters:
  • key – six.string_types allowed repeats=one
  • val – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
config_key_rm(key)

rm <key>

Parameters:

key – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
class ceph_api.ceph_command.MdsCommand(rados_config_file)
fs_add_data_pool(fs_name, pool)

add data pool <pool>

Parameters:
  • fs_name – six.string_types allowed repeats=one
  • pool – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
fs_dump(epoch=None)

dump all CephFS status, optionally from epoch

Parameters:

epoch – int

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
fs_rm_data_pool(pool, fs_name)

remove data pool <pool>

Parameters:
  • pool – six.string_types allowed repeats=one
  • fs_name – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
fs_set(var, fs_name, val, confirm=None)

set mds parameter <var> to <val>

Parameters:
  • var – list valid_range=[“max_mds”,”max_file_size”,”allow_new_snaps”,”inline_data”,”cluster_down”,”allow_multimds”,”allow_dirfrags”] allowed repeats=one
  • fs_name – six.string_types allowed repeats=one
  • val – six.string_types allowed repeats=one
  • confirm – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_add_data_pool(pool)

add data pool <pool>

Parameters:

pool – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_cluster_down()

take MDS cluster down

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_cluster_up()

bring MDS cluster up

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_compat_rm_compat(feature)

remove compatible feature

Parameters:

feature – int min=0

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_compat_rm_incompat(feature)

remove incompatible feature

Parameters:

feature – int min=0

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_compat_show()

show mds compatibility settings

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_deactivate(who)

stop mds

Parameters:

who – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_dump(epoch=None)

dump legacy MDS cluster info, optionally from epoch

Parameters:

epoch – int

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_fail(who)

force mds to status failed

Parameters:

who – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_getmap(epoch=None)

get MDS map, optionally from epoch

Parameters:

epoch – int

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_metadata(who)

fetch metadata for mds <who>

Parameters:

who – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_newfs(data, metadata, sure=None)

make new filesystem using pools <metadata> and <data>

Parameters:
  • data – int min=0
  • metadata – int min=0
  • sure – list valid_range=[“–yes-i-really-mean-it”] allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_remove_data_pool(pool)

remove data pool <pool>

Parameters:

pool – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_repaired(rank)

mark a damaged MDS rank as no longer damaged

Parameters:

rank – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_rm(gid)

remove nonactive mds

Parameters:

gid – int min=0

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_rm_data_pool(pool)

remove data pool <pool>

Parameters:

pool – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_rmfailed(who, confirm=None)

remove failed mds

Parameters:
  • confirm – six.string_types allowed repeats=one
  • who – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_set_max_mds(maxmds)

set max MDS index

Parameters:

maxmds – int min=0

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_set_state(gid, state)

set mds state of <gid> to <numeric-state>

Parameters:
  • gid – int min=0
  • state – int min=0 max=20
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_stat()

show MDS status

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_stop(who)

stop mds

Parameters:

who – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mds_tell(args, who)

send command to particular mds

Parameters:
  • args – six.string_types allowed repeats=many
  • who – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
class ceph_api.ceph_command.MonitorCommand(rados_config_file)
compact()

cause compaction of monitor’s leveldb storage (DEPRECATED)

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
df(detail=None)

show cluster free space stats

Parameters:

detail – list valid_range=[“detail”] allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
fsid()

show cluster FSID/UUID

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
health(detail=None)

show cluster health

Parameters:

detail – list valid_range=[“detail”] allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
heap(heapcmd)

show heap usage info (available only if compiled with tcmalloc)

Parameters:

heapcmd – list valid_range=[“dump”,”start_profiler”,”stop_profiler”,”release”,”stats”] allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
injectargs(injected_args)

inject config arguments into monitor

Parameters:

injected_args – six.string_types allowed repeats=many

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
log(logtext)

log supplied text to the monitor log

Parameters:

logtext – six.string_types allowed repeats=many

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mon_add(name, addr)

add new monitor named <name> at <addr>

Parameters:
  • name – six.string_types allowed repeats=one
  • addr – v4 or v6 addr with optional port
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mon_compact()

cause compaction of monitor’s leveldb storage

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mon_dump(epoch=None)

dump formatted monmap (optionally from epoch)

Parameters:

epoch – int min=0

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mon_getmap(epoch=None)

get monmap

Parameters:

epoch – int min=0

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mon_metadata(id)

fetch metadata for mon <id>

Parameters:

id – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mon_remove(name)

remove monitor named <name>

Parameters:

name – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mon_rm(name)

remove monitor named <name>

Parameters:

name – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mon_scrub()

scrub the monitor stores

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mon_stat()

summarize monitor status

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mon_status()

report status of monitors

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
mon_sync_force(validate1=None, validate2=None)

force sync of and clear monitor store

Parameters:
  • validate1 – list valid_range=[“–yes-i-really-mean-it”] allowed repeats=one
  • validate2 – list valid_range=[“–i-know-what-i-am-doing”] allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
node_ls(type=None)

list all nodes in cluster [type]

Parameters:

type – list valid_range=[“all”,”osd”,”mon”,”mds”] allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
quorum(quorumcmd)

enter or exit quorum

Parameters:

quorumcmd – list valid_range=[“enter”,”exit”] allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
quorum_status()

report status of monitor quorum

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
report(tags=None)

report full status of cluster, optional title tag strings

Parameters:

tags – six.string_types allowed repeats=many

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
scrub()

scrub the monitor stores (DEPRECATED)

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
status()

show cluster status

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
sync_force(validate2=None, validate1=None)

force sync of and clear monitor store (DEPRECATED)

Parameters:
  • validate2 – list valid_range=[“–i-know-what-i-am-doing”] allowed repeats=one
  • validate1 – list valid_range=[“–yes-i-really-mean-it”] allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
tell(target, args)

send a command to a specific daemon

Parameters:
  • target – six.string_types
  • args – six.string_types allowed repeats=many
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
version()

show mon daemon version

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
class ceph_api.ceph_command.OsdCommand(rados_config_file)
osd_blacklist(blacklistop, addr, expire=None)

add (optionally until <expire> seconds from now) or remove <addr> from blacklist

Parameters:
  • blacklistop – list valid_range=[“add”,”rm”] allowed repeats=one
  • expire – float min=0
  • addr – CephIPAddr + optional ‘/nonce’
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_blacklist_clear()

clear all blacklisted clients

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_blacklist_ls()

show blacklisted clients

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_blocked_by()

print histogram of which OSDs are blocking their peers

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_cluster_snap()

take cluster snapshot (disabled)

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_create(id=None, uuid=None)

create new osd (with optional UUID and ID)

Parameters:
  • id – int min=0
  • uuid – uuid.UUID
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_add(weight, id, args)

add or update crushmap position and weight for <name> with <weight> and location <args>

Parameters:
  • weight – float min=0
  • id – six.string_types
  • args – six.string_types valid_characters=[A-Za-z0-9-_.=] allowed repeats=many
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_add_bucket(name, type)

add no-parent (probably root) crush bucket <name> of type <type>

Parameters:
  • name – six.string_types valid_characters=[A-Za-z0-9-_.] allowed repeats=one
  • type – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_create_or_move(id, args, weight)

create entry or move existing entry for <name> <weight> at/to location <args>

Parameters:
  • id – six.string_types
  • args – six.string_types valid_characters=[A-Za-z0-9-_.=] allowed repeats=many
  • weight – float min=0
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_dump()

dump crush map

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_get_tunable(tunable)

get crush tunable <tunable>

Parameters:

tunable – list valid_range=[“straw_calc_version”] allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors

link existing entry for <name> under location <args>

Parameters:
  • args – six.string_types valid_characters=[A-Za-z0-9-_.=] allowed repeats=many
  • name – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_move(name, args)

move existing entry for <name> to location <args>

Parameters:
  • name – six.string_types valid_characters=[A-Za-z0-9-_.] allowed repeats=one
  • args – six.string_types valid_characters=[A-Za-z0-9-_.=] allowed repeats=many
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_remove(name, ancestor=None)

remove <name> from crush map (everywhere, or just at <ancestor>)

Parameters:
  • name – six.string_types valid_characters=[A-Za-z0-9-_.] allowed repeats=one
  • ancestor – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_rename_bucket(dstname, srcname)

rename bucket <srcname> to <dstname>

Parameters:
  • dstname – six.string_types valid_characters=[A-Za-z0-9-_.] allowed repeats=one
  • srcname – six.string_types valid_characters=[A-Za-z0-9-_.] allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_reweight(name, weight)

change <name>’s weight to <weight> in crush map

Parameters:
  • name – six.string_types valid_characters=[A-Za-z0-9-_.] allowed repeats=one
  • weight – float min=0
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_reweight_all()

recalculate the weights for the tree to ensure they sum correctly

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_reweight_subtree(name, weight)

change all leaf items beneath <name> to <weight> in crush map

Parameters:
  • name – six.string_types valid_characters=[A-Za-z0-9-_.] allowed repeats=one
  • weight – float min=0
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_rm(name, ancestor=None)

remove <name> from crush map (everywhere, or just at <ancestor>)

Parameters:
  • ancestor – six.string_types allowed repeats=one
  • name – six.string_types valid_characters=[A-Za-z0-9-_.] allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_rule_create_erasure(name, profile=None)

create crush rule <name> for erasure coded pool created with <profile> (default default)

Parameters:
  • profile – six.string_types allowed repeats=one
  • name – six.string_types valid_characters=[A-Za-z0-9-_.] allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_rule_create_simple(type, root, name, mode=None)

create crush rule <name> to start from <root>, replicate across buckets of type <type>, using a choose mode of <firstn|indep> (default firstn; indep best for erasure pools)

Parameters:
  • mode – list valid_range=[“firstn”,”indep”] allowed repeats=one
  • type – six.string_types valid_characters=[A-Za-z0-9-_.] allowed repeats=one
  • root – six.string_types valid_characters=[A-Za-z0-9-_.] allowed repeats=one
  • name – six.string_types valid_characters=[A-Za-z0-9-_.] allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_rule_dump(name=None)

dump crush rule <name> (default all)

Parameters:

name – six.string_types valid_characters=[A-Za-z0-9-_.] allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_rule_list()

list crush rules

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_rule_ls()

list crush rules

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_rule_rm(name)

remove crush rule <name>

Parameters:

name – six.string_types valid_characters=[A-Za-z0-9-_.] allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_set()

set crush map from input file

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_set_2(weight, args, id)

update crushmap position and weight for <name> to <weight> with location <args>

Parameters:
  • weight – float min=0
  • args – six.string_types valid_characters=[A-Za-z0-9-_.=] allowed repeats=many
  • id – six.string_types
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_set_tunable(tunable, value)

set crush tunable <tunable> to <value>

Parameters:
  • tunable – list valid_range=[“straw_calc_version”] allowed repeats=one
  • value – int
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_show_tunables()

show current crush tunables

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_tree()

dump crush buckets and items in a tree view

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_crush_tunables(profile)

set crush tunables values to <profile>

Parameters:

profile – list valid_range=[“legacy”,”argonaut”,”bobtail”,”firefly”,”hammer”,”jewel”,”optimal”,”default”] allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors

unlink <name> from crush map (everywhere, or just at <ancestor>)

Parameters:
  • ancestor – six.string_types allowed repeats=one
  • name – six.string_types valid_characters=[A-Za-z0-9-_.] allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_deep_scrub(who)

initiate deep scrub on osd <who>

Parameters:

who – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_df(output_method=None)

show OSD utilization

Parameters:

output_method – list valid_range=[“plain”,”tree”] allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_down(ids)

set osd(s) <id> [<id>...] down

Parameters:

ids – six.string_types allowed repeats=many

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_dump(epoch=None)

print summary of OSD map

Parameters:

epoch – int min=0

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_erasure_code_profile_get(name)

get erasure code profile <name>

Parameters:

name – six.string_types valid_characters=[A-Za-z0-9-_.] allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_erasure_code_profile_ls()

list all erasure code profiles

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_erasure_code_profile_rm(name)

remove erasure code profile <name>

Parameters:

name – six.string_types valid_characters=[A-Za-z0-9-_.] allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_erasure_code_profile_set(name, profile=None)

create erasure code profile <name> with [<key[=value]> ...] pairs. Add a –force at the end to override an existing profile (VERY DANGEROUS)

Parameters:
  • name – six.string_types valid_characters=[A-Za-z0-9-_.] allowed repeats=one
  • profile – six.string_types allowed repeats=many
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_find(id)

find osd <id> in the CRUSH map and show its location

Parameters:

id – int min=0

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_getcrushmap(epoch=None)

get CRUSH map

Parameters:

epoch – int min=0

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_getmap(epoch=None)

get OSD map

Parameters:

epoch – int min=0

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_getmaxosd()

show largest OSD id

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_in(ids)

set osd(s) <id> [<id>...] in

Parameters:

ids – six.string_types allowed repeats=many

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_lost(id, sure=None)

mark osd as permanently lost. THIS DESTROYS DATA IF NO MORE REPLICAS EXIST, BE CAREFUL

Parameters:
  • sure – list valid_range=[“–yes-i-really-mean-it”] allowed repeats=one
  • id – int min=0
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_ls(epoch=None)

show all OSD ids

Parameters:

epoch – int min=0

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_lspools(auid=None)

list pools

Parameters:

auid – int

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_map(object, pool, nspace=None)

find pg for <object> in <pool> with [namespace]

Parameters:
  • object – six.string_types
  • nspace – six.string_types allowed repeats=one
  • pool – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_metadata(id=None)

fetch metadata for osd {id} (default all)

Parameters:

id – int min=0

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_out(ids)

set osd(s) <id> [<id>...] out

Parameters:

ids – six.string_types allowed repeats=many

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_pause()

pause osd

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_perf()

print dump of OSD perf summary stats

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_pg_temp(pgid, id=None)

set pg_temp mapping pgid:[<id> [<id>...]] (developers only)

Parameters:
  • id – six.string_types allowed repeats=many
  • pgid – six.string_types
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_pool_create(pool, pg_num, erasure_code_profile=None, expected_num_objects=None, pool_type=None, ruleset=None, pgp_num=None)

create pool

Parameters:
  • erasure_code_profile – six.string_types allowed repeats=one
  • expected_num_objects – int
  • pool_type – list valid_range=[“replicated”,”erasure”] allowed repeats=one
  • ruleset – six.string_types allowed repeats=one
  • pool – six.string_types allowed repeats=one
  • pg_num – int min=0
  • pgp_num – int min=0
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_pool_delete(pool, sure=None, pool2=None)

delete pool

Parameters:
  • sure – list valid_range=[“–yes-i-really-really-mean-it”] allowed repeats=one
  • pool – six.string_types allowed repeats=one
  • pool2 – six.string_types
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_pool_get(pool, var)

get pool parameter <var>

Parameters:
  • pool – six.string_types allowed repeats=one
  • var – list valid_range=[“size”,”min_size”,”crash_replay_interval”,”pg_num”,”pgp_num”,”crush_ruleset”,”hashpspool”,”nodelete”,”nopgchange”,”nosizechange”,”write_fadvise_dontneed”,”noscrub”,”nodeep-scrub”,”hit_set_type”,”hit_set_period”,”hit_set_count”,”hit_set_fpp”,”auid”,”target_max_objects”,”target_max_bytes”,”cache_target_dirty_ratio”,”cache_target_dirty_high_ratio”,”cache_target_full_ratio”,”cache_min_flush_age”,”cache_min_evict_age”,”erasure_code_profile”,”min_read_recency_for_promote”,”all”,”min_write_recency_for_promote”,”fast_read”,”hit_set_grade_decay_rate”,”hit_set_search_last_n”,”scrub_min_interval”,”scrub_max_interval”,”deep_scrub_interval”,”recovery_priority”,”recovery_op_priority”,”scrub_priority”] allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_pool_get_quota(pool)

obtain object or byte limits for pool

Parameters:

pool – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_pool_ls(detail=None)

list pools

Parameters:

detail – list valid_range=[“detail”] allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_pool_mksnap(snap, pool)

make snapshot <snap> in <pool>

Parameters:
  • snap – six.string_types allowed repeats=one
  • pool – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_pool_rename(srcpool, destpool)

rename <srcpool> to <destpool>

Parameters:
  • srcpool – six.string_types allowed repeats=one
  • destpool – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_pool_rm(pool, sure=None, pool2=None)

remove pool

Parameters:
  • sure – list valid_range=[“–yes-i-really-really-mean-it”] allowed repeats=one
  • pool – six.string_types allowed repeats=one
  • pool2 – six.string_types
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_pool_rmsnap(pool, snap)

remove snapshot <snap> from <pool>

Parameters:
  • pool – six.string_types allowed repeats=one
  • snap – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_pool_set(val, pool, var, force=None)

set pool parameter <var> to <val>

Parameters:
  • val – six.string_types allowed repeats=one
  • force – list valid_range=[“–yes-i-really-mean-it”] allowed repeats=one
  • pool – six.string_types allowed repeats=one
  • var – list valid_range=[“size”,”min_size”,”crash_replay_interval”,”pg_num”,”pgp_num”,”crush_ruleset”,”hashpspool”,”nodelete”,”nopgchange”,”nosizechange”,”write_fadvise_dontneed”,”noscrub”,”nodeep-scrub”,”hit_set_type”,”hit_set_period”,”hit_set_count”,”hit_set_fpp”,”use_gmt_hitset”,”debug_fake_ec_pool”,”target_max_bytes”,”target_max_objects”,”cache_target_dirty_ratio”,”cache_target_dirty_high_ratio”,”cache_target_full_ratio”,”cache_min_flush_age”,”cache_min_evict_age”,”auid”,”min_read_recency_for_promote”,”min_write_recency_for_promote”,”fast_read”,”hit_set_grade_decay_rate”,”hit_set_search_last_n”,”scrub_min_interval”,”scrub_max_interval”,”deep_scrub_interval”,”recovery_priority”,”recovery_op_priority”,”scrub_priority”] allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_pool_set_quota(pool, val, field)

set object or byte limit on pool

Parameters:
  • pool – six.string_types allowed repeats=one
  • val – six.string_types allowed repeats=one
  • field – list valid_range=[“max_objects”,”max_bytes”] allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_pool_stats(name=None)

obtain stats from all pools, or from specified pool

Parameters:

name – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_primary_affinity(id, weight)

adjust osd primary-affinity from 0.0 <= <weight> <= 1.0

Parameters:
  • id – six.string_types
  • weight – float min=0 max=1
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_primary_temp(pgid, id)

set primary_temp mapping pgid:<id>|-1 (developers only)

Parameters:
  • pgid – six.string_types
  • id – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_repair(who)

initiate repair on osd <who>

Parameters:

who – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_reweight(id, weight)

reweight osd to 0.0 < <weight> < 1.0

Parameters:
  • id – int min=0
  • weight – float min=0 max=1
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_reweight_by_pg(oload=None, pools=None, max_change=None, max_osds=None)

reweight OSDs by PG distribution [overload-percentage-for-consideration, default 120]

Parameters:
  • oload – int
  • pools – six.string_types allowed repeats=many
  • max_change – float
  • max_osds – int
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_reweight_by_utilization(max_osds=None, oload=None, no_increasing=None, max_change=None)

reweight OSDs by utilization [overload-percentage-for-consideration, default 120]

Parameters:
  • max_osds – int
  • oload – int
  • no_increasing – list valid_range=[“–no-increasing”] allowed repeats=one
  • max_change – float
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_rm(ids)

remove osd(s) <id> [<id>...] in

Parameters:

ids – six.string_types allowed repeats=many

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_scrub(who)

initiate scrub on osd <who>

Parameters:

who – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_set(key)

set <key>

Parameters:

key – list valid_range=[“full”,”pause”,”noup”,”nodown”,”noout”,”noin”,”nobackfill”,”norebalance”,”norecover”,”noscrub”,”nodeep-scrub”,”notieragent”,”sortbitwise”] allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_setcrushmap()

set crush map from input file

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_setmaxosd(newmax)

set new maximum osd value

Parameters:

newmax – int min=0

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_stat()

print summary of OSD map

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_test_reweight_by_pg(pools=None, max_change=None, oload=None, max_osds=None)

dry run of reweight OSDs by PG distribution [overload-percentage-for-consideration, default 120]

Parameters:
  • pools – six.string_types allowed repeats=many
  • max_change – float
  • oload – int
  • max_osds – int
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_test_reweight_by_utilization(max_change=None, oload=None, max_osds=None, no_increasing=None)

dry run of reweight OSDs by utilization [overload-percentage-for-consideration, default 120]

Parameters:
  • max_change – float
  • oload – int
  • max_osds – int
  • no_increasing – list valid_range=[“–no-increasing”] allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_thrash(num_epochs)

thrash OSDs for <num_epochs>

Parameters:

num_epochs – int min=0

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_tier_add(pool, tierpool, force_nonempty=None)

add the tier <tierpool> (the second one) to base pool <pool> (the first one)

Parameters:
  • pool – six.string_types allowed repeats=one
  • tierpool – six.string_types allowed repeats=one
  • force_nonempty – list valid_range=[“–force-nonempty”] allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_tier_add_cache(tierpool, pool, size)

add a cache <tierpool> (the second one) of size <size> to existing pool <pool> (the first one)

Parameters:
  • tierpool – six.string_types allowed repeats=one
  • pool – six.string_types allowed repeats=one
  • size – int min=0
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_tier_cache_mode(mode, pool, sure=None)

specify the caching mode for cache tier <pool>

Parameters:
  • mode – list valid_range=[“none”,”writeback”,”forward”,”readonly”,”readforward”,”proxy”,”readproxy”] allowed repeats=one
  • sure – list valid_range=[“–yes-i-really-mean-it”] allowed repeats=one
  • pool – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_tier_remove(pool, tierpool)

remove the tier <tierpool> (the second one) from base pool <pool> (the first one)

Parameters:
  • pool – six.string_types allowed repeats=one
  • tierpool – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_tier_remove_overlay(pool)

remove the overlay pool for base pool <pool>

Parameters:

pool – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_tier_rm(tierpool, pool)

remove the tier <tierpool> (the second one) from base pool <pool> (the first one)

Parameters:
  • tierpool – six.string_types allowed repeats=one
  • pool – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_tier_rm_overlay(pool)

remove the overlay pool for base pool <pool>

Parameters:

pool – six.string_types allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_tier_set_overlay(pool, overlaypool)

set the overlay pool for base pool <pool> to be <overlaypool>

Parameters:
  • pool – six.string_types allowed repeats=one
  • overlaypool – six.string_types allowed repeats=one
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_tree(epoch=None)

print OSD tree

Parameters:

epoch – int min=0

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_unpause()

unpause osd

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_unset(key)

unset <key>

Parameters:

key – list valid_range=[“full”,”pause”,”noup”,”nodown”,”noout”,”noin”,”nobackfill”,”norebalance”,”norecover”,”noscrub”,”nodeep-scrub”,”notieragent”,”sortbitwise”] allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
osd_utilization()

get basic pg distribution stats

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
class ceph_api.ceph_command.PlacementGroupCommand(rados_config_file)
pg_debug(debugop)

show debug info about pgs

Parameters:

debugop – list valid_range=[“unfound_objects_exist”,”degraded_pgs_exist”] allowed repeats=one

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
pg_deep_scrub(pgid)

start deep-scrub on <pgid>

Parameters:

pgid – six.string_types

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
pg_dump(dumpcontents=None)

show human-readable versions of pg map (only ‘all’ valid with plain)

Parameters:

dumpcontents – list valid_range=[“all”,”summary”,”sum”,”delta”,”pools”,”osds”,”pgs”,”pgs_brief”] allowed repeats=many

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
pg_dump_json(dumpcontents=None)

show human-readable version of pg map in json only

Parameters:

dumpcontents – list valid_range=[“all”,”summary”,”sum”,”pools”,”osds”,”pgs”] allowed repeats=many

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
pg_dump_pools_json()

show pg pools info in json only

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
pg_dump_stuck(stuckops=None, threshold=None)

show information about stuck pgs

Parameters:
  • stuckops – list valid_range=[“inactive”,”unclean”,”stale”,”undersized”,”degraded”] allowed repeats=many
  • threshold – int
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
pg_force_create_pg(pgid)

force creation of pg <pgid>

Parameters:

pgid – six.string_types

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
pg_getmap()

get binary pg map to -o/stdout

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
pg_ls(states=None, pool=None)

list pg with specific pool, osd, state

Parameters:
  • states – list valid_range=[“active”,”clean”,”down”,”replay”,”splitting”,”scrubbing”,”scrubq”,”degraded”,”inconsistent”,”peering”,”repair”,”recovering”,”backfill_wait”,”incomplete”,”stale”,”remapped”,”deep_scrub”,”backfill”,”backfill_toofull”,”recovery_wait”,”undersized”,”activating”,”peered”] allowed repeats=many
  • pool – int
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
pg_ls_by_osd(osd, pool=None, states=None)

list pg on osd [osd]

Parameters:
  • pool – int
  • states – list valid_range=[“active”,”clean”,”down”,”replay”,”splitting”,”scrubbing”,”scrubq”,”degraded”,”inconsistent”,”peering”,”repair”,”recovering”,”backfill_wait”,”incomplete”,”stale”,”remapped”,”deep_scrub”,”backfill”,”backfill_toofull”,”recovery_wait”,”undersized”,”activating”,”peered”] allowed repeats=many
  • osd – six.string_types
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
pg_ls_by_pool(poolstr, states=None)

list pg with pool = [poolname | poolid]

Parameters:
  • poolstr – six.string_types allowed repeats=one
  • states – list valid_range=[“active”,”clean”,”down”,”replay”,”splitting”,”scrubbing”,”scrubq”,”degraded”,”inconsistent”,”peering”,”repair”,”recovering”,”backfill_wait”,”incomplete”,”stale”,”remapped”,”deep_scrub”,”backfill”,”backfill_toofull”,”recovery_wait”,”undersized”,”activating”,”peered”] allowed repeats=many
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
pg_ls_by_primary(osd, states=None, pool=None)

list pg with primary = [osd]

Parameters:
  • states – list valid_range=[“active”,”clean”,”down”,”replay”,”splitting”,”scrubbing”,”scrubq”,”degraded”,”inconsistent”,”peering”,”repair”,”recovering”,”backfill_wait”,”incomplete”,”stale”,”remapped”,”deep_scrub”,”backfill”,”backfill_toofull”,”recovery_wait”,”undersized”,”activating”,”peered”] allowed repeats=many
  • osd – six.string_types
  • pool – int
Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
pg_map(pgid)

show mapping of pg to osds

Parameters:

pgid – six.string_types

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
pg_repair(pgid)

start repair on <pgid>

Parameters:

pgid – six.string_types

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
pg_scrub(pgid)

start scrub on <pgid>

Parameters:

pgid – six.string_types

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
pg_send_pg_creates()

trigger pg creates to be issued

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
pg_set_full_ratio(ratio)

set ratio at which pgs are considered full

Parameters:

ratio – float min=0 max=1

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
pg_set_nearfull_ratio(ratio)

set ratio at which pgs are considered nearly full

Parameters:

ratio – float min=0 max=1

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
pg_stat()

show placement group status.

Returns:

(string outbuf, string outs)

Raises:
  • CephError – Raises CephError on command execution errors
  • rados.Error – Raises on rados errors
ceph_api.ceph_command.run_ceph_command(conffile, cmd, inbuf)

Run a ceph command and return the results

Parameters:
  • conffile – The ceph.conf configuration location
  • cmd – The json command to run
  • inbuf
Returns:

(string outbuf, string outs)

Raises rados.Error:
 

Raises on rados errors

Module contents

Table Of Contents

Previous topic

ceph_api’s Documentation

This Page