cinder.cmd.manage module

CLI interface for cinder management.

class BackupCommands

Bases: object

Methods for managing backups.

list()

List all backups.

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

update_backup_host(currenthost, newhost)

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: cinder.cmd.manage.BaseCommand

Methods for managing clusters.

list()

Show a list of all cinder services.

remove(recursive, binary, cluster_name)

Completely removes a cluster.

rename(partial, current, new)

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=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, newhost)

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=None)

Perform online data migrations for the release in batches.

online_migrations = (<function volume_use_quota_online_data_migration>, <function snapshot_use_quota_online_data_migration>)
purge(age_in_days)

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

reset_active_backend(enable_replication, active_backend_id, backend_host)

Reset the active backend for a host.

sync(version=None, bump_versions=False)

Sync the database up to the most recent version.

version()

Print the current database version.

class HostCommands

Bases: object

List hosts.

list(zone=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)

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)

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: cinder.cmd.manage.BaseCommand

Methods for managing services.

list()

Show a list of all cinder services.

remove(binary, host_name)

Completely removes a service.

class UtilCommands

Bases: object

Generic utils.

clean_locks(online)

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)

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

update_host(currenthost, newhost)

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.

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

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)