ceph.rados.pool_workflows module

Module to change pool attributes 1. Autoscaler tunables 2. Snapshots

class ceph.rados.pool_workflows.PoolFunctions(node: CephAdmin)

Bases: object

Contains various functions that help in altering the behaviour, working of pools and verify the changes

check_snap_exists(snap_name: str, pool_name: str) bool

checks the existence of the snapshot name given on the pool :param snap_name: Name of the snapshot :param pool_name: Name of the pool

Returns: True -> Snapshot exists, False -> snapshot does not exist

create_pool_snap(pool_name: str)

Creates snapshots of the given pool :param pool_name: name of the pool

Returns: Pass -> name of the snapshot created, Fail -> False

delete_pool_snap(pool_name: str, snap_name: Optional[str] = None) bool

deletes snapshots of the given pool. If no snap name is provided, deletes all the snapshots on the pool :param pool_name: name of the pool :param snap_name: name of the snapshot

Returns: Pass -> snapshot Deleted, Fail -> snapshot not Deleted

do_rados_delete(pool_name: str, pg_id: Optional[str] = None)

deletes all the objects from the given pool / PG ID :param 1. pool_name: name of the pool :param 2. [ pg_id ]: Pg ID (Optional, but when provided, should be passed along with pool name )

Returns: True -> pass, False -> fail

fill_omap_entries(pool_name, **kwargs)

creates key-value entries for objects on ceph pools and increase the omap entries on the pool eg : if obj_start, obj_end: 0, 3000 objects, with num_keys 1000, the method would create 3000 objects with 1k KW pairs each. so total 3000*1000 KW entries :param pool_name: name of the pool where the KW pairs needed to be added to objects :param **kwargs: other args that can be passed

Valid args: 1. obj_start: start count for object creation 2. obj_end : end count for object creation 3. num_keys_obj: Number of KW paris to be added to each object

Returns: True -> pass, False -> fail

get_bulk_details(pool_name: str) bool

Checks the status of bulk flag on the pool given :param pool_name: Name of the pool

Returns: True -> pass, False -> fail

get_pg_autoscaler_value(pool_name, item)

Fetches the target ratio set on the pool given :param pool_name: name of the pool :param item: Value of the item to be fetched.

Allowed values: actual_capacity_ratio|actual_raw_used|bias|capacity_ratio|crush_root_id|target_bytes| effective_target_ratio|logical_used|pg_autoscale_mode|pg_num_target|pool_id|raw_used|target_ratio|

Returns: Requested value

get_snap_names(pool_name: str) list

Fetches the list of snapshots created on the given pool :param pool_name: name of the pool

Returns: list of the snaps created

get_target_pg_num_bulk_flag(pool_name: str) int

Fetches the target PG counts for the given pool from the autoscaler status :param pool_name: Name of the pool

Returns: PG Count

rm_bulk_flag(pool_name: str) bool

Removes the bulk flag on existing pools :param pool_name: Name of the pool

Returns: True -> pass, False -> fail

set_bulk_flag(pool_name: str) bool

Sets the bulk flag to true on existing pools :param pool_name: Name of the pool

Returns: True -> pass, False -> fail

verify_target_ratio_set(pool_name, ratio)

Sets the “target_size_ratio” on the given pool and verifies it from the auto-scale status :param pool_name: name of the pool :param ratio: ratio to be set

Returns: True -> pass, False -> fail