ceph.ceph_admin.maintenance module

Represents the ceph orch CLI action ‘host maintenance’.

This module enables the user to place a host in maintenance mode and exit maintenance on a host already in maintenance mode.

Example

Any host can be placed in maintenance using the following command::

ceph orch host maintenance enter <hostname> –force

Any host can be exited from maintenance mode using the following command::

ceph orch host maintenance exit <hostname>

This module is inherited where hosts are placed or exited from maintenance using orchestrator.

exception ceph.ceph_admin.maintenance.HostMaintenanceFailure

Bases: Exception

class ceph.ceph_admin.maintenance.MaintenanceMixin

Bases: object

Add Orch maintenance support to the base class.

check_maintenance_status(op, node) bool

Check ceph orchestrator status to verify pause and resume orch operations using ceph orch status command

Parameters
  • op – operation after which host status is checked. ex: enter|exit

  • node – CephNode for which status needs to be checked.

Returns

true if the maintenance operation has been performed successfully on the given node, else false.

enter(config: Dict) None

Place a host under maintenance using orchestrator

Parameters

config (Dict) –

Key/value pairs passed from the test suite. pos_args(Dict) - List to be added as positional params, in this case

we add name of the node on which host maintenance is to be performed as a positional parameter. (Refer example below)

Example:

config:
    service: host
    command: enter
    verify: true
    args:
        node: name of the node to be placed under maintenance
exit(config: Dict) None

Exit maintenance mode on a host under maintenance using orchestrator

Parameters

config (Dict) –

Key/value pairs passed from the test suite. pos_args(Dict) - List to be added as positional params, in this case

we add name of the node on which host maintenance is to be performed as a positional parameter. (Refer example below)

Example:

config:
    service: host
    command: exit
    verify: true
    args:
        node: name of the node to be exited from maintenance