cinder.cmd.manage module

CLI interface for cinder management.

class BackupCommands

Bases: object

Methods for managing backups.

list() None

List all backups.

List all backups (including ones in progress) and the host on which the backup operation is running.

update_backup_host(currenthost: str, newhost: str) None

Modify the host name associated with a backup.

Particularly to recover from cases where one has moved their Cinder Backup node, and not set backup_use_same_backend.

class BaseCommand

Bases: object

class ClusterCommands

Bases: BaseCommand

Methods for managing clusters.

list() None

Show a list of all cinder services.

remove(recursive: bool, binary: str, cluster_name: str) int | None

Completely removes a cluster.

rename(partial: bool, current: str | None, new: str | None) int | None

Rename cluster name for Volumes and Consistency Groups.

Useful when you want to rename a cluster, particularly when the backend_name has been modified in a multi-backend config or we have moved from a single backend to multi-backend.

class ConfigCommands

Bases: object

Class for exposing the flags defined by flag_file(s).

list(param: str | None = None) None

List parameters configured for cinder.

Lists all parameters configured for cinder unless an optional argument is specified. If the parameter is specified we only print the requested parameter. If the parameter is not found an appropriate error is produced by .get*().

class ConsistencyGroupCommands

Bases: object

Methods for managing consistency groups.

update_cg_host(currenthost: str, newhost: str) None

Modify the host name associated with a Consistency Group.

Particularly to recover from cases where one has moved a host from single backend to multi-backend, or changed the host configuration option, or modified the backend_name in a multi-backend config.

class DbCommands

Bases: object

Class for managing the database.

online_data_migrations(max_count: int | None = None) None

Perform online data migrations for the release in batches.

online_migrations: Tuple[Callable[[RequestContext, int], Tuple[int, int]], ...] = (<function remove_temporary_admin_metadata_data_migration>,)
purge(age_in_days: int) None

Purge deleted rows older than a given age from cinder tables.

reset_active_backend(enable_replication: bool, active_backend_id: str | None, backend_host: str) None

Reset the active backend for a host.

sync(version: int | None = None, bump_versions: bool = False) None

Sync the database up to the most recent version.

version() None

Print the current database version.

class HostCommands

Bases: object

List hosts.

list(zone: str | None = None) None

Show a list of all physical hosts.

Can be filtered by zone. args: [zone]

class QuotaCommands

Bases: object

Class for managing quota issues.

check(project_id: str | None) None

Check if quotas and reservations are correct

This action checks quotas and reservations, for a specific project or for all projects, to see if they are out of sync.

The check will also look for duplicated entries.

One way to use this check in combination with the sync action is to run the check for all projects, take note of those that are out of sync, and then sync them one by one at intervals to reduce stress on the DB.

sync(project_id: str | None) None

Fix quotas and reservations

This action refreshes existing quota usage and reservation count for a specific project or for all projects.

The refresh will also remove duplicated entries.

This operation is best executed when Cinder is not running, but it can be run with cinder services running as well.

A different transaction is used for each project’s quota sync, so an action failure will only rollback the current project’s changes.

class ServiceCommands

Bases: BaseCommand

Methods for managing services.

list()

Show a list of all cinder services.

remove(binary: str, host_name: str) int | None

Completely removes a service.

class UtilCommands

Bases: object

Generic utils.

clean_locks(online: bool) None

Clean file locks for vols, snaps, and backups on the current host.

Should be run on any host where we are running a Cinder service (API, Scheduler, Volume, Backup) and can be run with the Cinder services running or stopped.

If the services are running it will check existing resources in the Cinder database in order to know which resources are still available (it’s not safe to remove their file locks) and will only remove the file locks for the resources that are no longer present. Deleting locks while the services are offline is faster as there’s no need to check the database.

For backups, the way to know if we can remove the startup lock is by checking if the PGRP in the file name is currently running cinder-backup.

Default assumes that services are online, must pass --services-offline to specify that they are offline.

Doesn’t clean DLM locks (except when using file locks), as those don’t leave lock leftovers.

class VersionCommands

Bases: object

Class for exposing the codebase version.

list()
class VolumeCommands

Bases: object

Methods for dealing with a cloud in an odd state.

delete(volume_id: str) None

Delete a volume, bypassing the check that it must be available.

update_host(currenthost: str, newhost: str) None

Modify the host name associated with a volume.

Particularly to recover from cases where one has moved their Cinder Volume node, or modified their backend_name in a multi-backend config.

update_service()

Modify the service uuid associated with a volume.

In certain upgrade cases, we create new cinder services and delete the records of old ones, however, the volumes created with old service still contain the service uuid of the old services.

add_command_parsers(subparsers)
args(*args, **kwargs)
fetch_func_args(func)
get_arg_string(args)
main()
methods_of(obj) list

Return non-private methods from an object.

Get all callable methods of an object that don’t start with underscore :return: a list of tuples of the form (method_name, method)

missing_action(help_func: Callable) Callable