diff --git a/doc/source/usage.rst b/doc/source/usage.rst index c7e8ea3d..24284e1b 100644 --- a/doc/source/usage.rst +++ b/doc/source/usage.rst @@ -38,135 +38,481 @@ This example will show protecting volume. export OS_TENANT_NAME=admin export OS_AUTH_URL=http://10.229.47.230/identity/ +#. List the provider:: + + karbor provider-list + +--------------------------------------+-------------------+-------------------------------------------------------------------------------------+ + | Id | Name | Description | + +--------------------------------------+-------------------+-------------------------------------------------------------------------------------+ + | b766f37c-d011-4026-8228-28730d734a3f | No-Op Provider | This provider does nothing for each protect and restore operation. Used for testing | + | cf56bd3e-97a7-4078-b6d5-f36246333fd9 | OS Infra Provider | This provider uses OpenStack's own services (swift, cinder) as storage | + | e4008868-be97-492c-be41-44e50ef2e16f | EISOO Provider | This provider provides data protection for applications with EISOO AnyBackup | + +--------------------------------------+-------------------+-------------------------------------------------------------------------------------+ + #. Show the provider information:: karbor provider-show cf56bd3e-97a7-4078-b6d5-f36246333fd9 - +----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | Property | Value | - +----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | description | This provider uses OpenStack's own services (swift, cinder) as storage | - | extended_info_schema | {u'options_schema': {u'OS::Cinder::Volume': {u'required': [u'backup_name', u'backup_mode', u'container', u'force'], u'type': u'object', u'properties': {u'force': {u'default': False, u'type': u'boolean', u'description': u'Whether to backup, even if the volumeis attached', u'title': u'Force'}, u'backup_name': {u'type': u'string', u'description': u'The name of the backup.', u'title': u'Backup Name'}, u'container': {u'type': u'string', u'description': u'The container which been chosen.', u'title': u'Container'}, u'description': {u'type': u'string', u'description': u'The description of the volume.', u'title': u'Description'}, u'backup_mode': {u'default': u'auto', u'enum': [u'full', u'incremental', u'auto'], u'type': u'string', u'description': u'The backup mode.', u'title': u'Backup Mode'}}, u'title': u'Cinder Protection Options'}}, u'saved_info_schema': {u'OS::Cinder::Volume': {u'required': [u'name', u'status', u'progress', u'fail_reason', u'size', u'volume_id'], u'type': u'object', u'properties': {u'status': {u'enum': [u'creating', u'available', u'deleting', u'error', u'restoring', u'error_restoring'], u'type': u'string', u'description': u'The backup status, such as available.', u'title': u'Status'}, u'fail_reason': {u'type': u'string', u'description': u'The reason for the failure status of the backup.', u'title': u'Fail Reason'}, u'name': {u'type': u'string', u'description': u'The name for this backup.', u'title': u'Name'}, u'volume_id': {u'type': u'string', u'description': u'The ID of the volume from which the backup was created.', u'title': u'Volume ID'}, u'progress': {u'constraint': {u'max': 1, u'min': 0}, u'type': u'number', u'description': u'The current operation progress for this backup.', u'title': u'Progress'}, u'is_incremental': {u'type': u'boolean', u'description': u'The type of the backup, True is incremental and False is full.', u'title': u'Is Incremental'}, u'size': {u'type': u'integer', u'description': u'The size of the backup, in GB.', u'title': u'Size'}}, u'title': u'Cinder Protection Saved Info'}}, u'restore_schema': {u'OS::Cinder::Volume': {u'type': u'object', u'properties': {u'restore_name': {u'default': None, u'type': u'string', u'description': u'The name of the restored volume.', u'title': u'Restore Name'}, u'restore_description': {u'default': None, u'type': u'string', u'description': u'The description of the restored volume.', u'title': u'Restore Name'}, u'volume_id': {u'type': u'string', u'description': u'The target volume ID to restore to.', u'title': u'Volume ID'}}, u'title': u'Cinder Protection Restore'}}} | - | id | cf56bd3e-97a7-4078-b6d5-f36246333fd9 | - | name | OS Infra Provider | - +----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +----------------------+---------------------------------------------------------------------------------------------+ + | Property | Value | + +----------------------+---------------------------------------------------------------------------------------------+ + | description | This provider uses OpenStack's own services (swift, cinder) as storage | + | extended_info_schema | { | + | | "options_schema": { | + | | "OS::Cinder::Volume": { | + | | "properties": { | + | | "backup_mode": { | + | | "default": "auto", | + | | "description": "The backup mode.", | + | | "enum": [ | + | | "full", | + | | "incremental", | + | | "auto" | + | | ], | + | | "title": "Backup Mode", | + | | "type": "string" | + | | }, | + | | "backup_name": { | + | | "description": "The name of the backup.", | + | | "title": "Backup Name", | + | | "type": "string" | + | | }, | + | | "container": { | + | | "description": "The container which been chosen.", | + | | "title": "Container", | + | | "type": "string" | + | | }, | + | | "description": { | + | | "description": "The description of the volume.", | + | | "title": "Description", | + | | "type": "string" | + | | }, | + | | "force": { | + | | "default": false, | + | | "description": "Whether to backup, even if the volumeis attached", | + | | "title": "Force", | + | | "type": "boolean" | + | | } | + | | }, | + | | "required": [ | + | | "backup_name", | + | | "backup_mode", | + | | "container", | + | | "force" | + | | ], | + | | "title": "Cinder Protection Options", | + | | "type": "object" | + | | }, | + | | "OS::Glance::Image": { | + | | "properties": { | + | | "backup_name": { | + | | "default": null, | + | | "description": "The name of the backup.", | + | | "title": "Backup Name", | + | | "type": "string" | + | | } | + | | }, | + | | "required": [], | + | | "title": "Image Protection Options", | + | | "type": "object" | + | | }, | + | | "OS::Nova::Server": { | + | | "properties": {}, | + | | "required": [], | + | | "title": "Server Protection Options", | + | | "type": "object" | + | | } | + | | }, | + | | "restore_schema": { | + | | "OS::Cinder::Volume": { | + | | "properties": { | + | | "restore_description": { | + | | "default": null, | + | | "description": "The description of the restored volume.", | + | | "title": "Restore Description", | + | | "type": "string" | + | | }, | + | | "restore_name": { | + | | "default": null, | + | | "description": "The name of the restored volume.", | + | | "title": "Restore Name", | + | | "type": "string" | + | | }, | + | | "volume_id": { | + | | "description": "The target volume ID to restore to.", | + | | "title": "Volume ID", | + | | "type": "string" | + | | } | + | | }, | + | | "title": "Cinder Protection Restore", | + | | "type": "object" | + | | }, | + | | "OS::Glance::Image": { | + | | "properties": { | + | | "restore_name": { | + | | "description": "The name of the restore image", | + | | "title": "Restore Image Name", | + | | "type": "string" | + | | } | + | | }, | + | | "required": [ | + | | "backup_name" | + | | ], | + | | "title": "Image Protection Restore", | + | | "type": "object" | + | | }, | + | | "OS::Nova::Server": { | + | | "properties": { | + | | "restore_name": { | + | | "description": "The name of the restore server", | + | | "title": "Restore Server Name", | + | | "type": "string" | + | | } | + | | }, | + | | "required": [ | + | | "restore_name" | + | | ], | + | | "title": "Server Protection Restore", | + | | "type": "object" | + | | } | + | | }, | + | | "saved_info_schema": { | + | | "OS::Cinder::Volume": { | + | | "properties": { | + | | "fail_reason": { | + | | "description": "The reason for the failure status of the backup.", | + | | "title": "Fail Reason", | + | | "type": "string" | + | | }, | + | | "is_incremental": { | + | | "description": "The type of the backup, True is incremental and False is full.", | + | | "title": "Is Incremental", | + | | "type": "boolean" | + | | }, | + | | "name": { | + | | "description": "The name for this backup.", | + | | "title": "Name", | + | | "type": "string" | + | | }, | + | | "progress": { | + | | "constraint": { | + | | "max": 1, | + | | "min": 0 | + | | }, | + | | "description": "The current operation progress for this backup.", | + | | "title": "Progress", | + | | "type": "number" | + | | }, | + | | "size": { | + | | "description": "The size of the backup, in GB.", | + | | "title": "Size", | + | | "type": "integer" | + | | }, | + | | "status": { | + | | "description": "The backup status, such as available.", | + | | "enum": [ | + | | "creating", | + | | "available", | + | | "deleting", | + | | "error", | + | | "restoring", | + | | "error_restoring" | + | | ], | + | | "title": "Status", | + | | "type": "string" | + | | }, | + | | "volume_id": { | + | | "description": "The ID of the volume from which the backup was created.", | + | | "title": "Volume ID", | + | | "type": "string" | + | | } | + | | }, | + | | "required": [ | + | | "name", | + | | "status", | + | | "progress", | + | | "fail_reason", | + | | "size", | + | | "volume_id" | + | | ], | + | | "title": "Cinder Protection Saved Info", | + | | "type": "object" | + | | }, | + | | "OS::Glance::Image": { | + | | "properties": { | + | | "image_metadata": { | + | | "description": "To save disk_format and container_format", | + | | "title": "Image Metadata", | + | | "type": "image" | + | | } | + | | }, | + | | "required": [ | + | | "image_metadata" | + | | ], | + | | "title": "Image Protection Saved Info", | + | | "type": "object" | + | | }, | + | | "OS::Nova::Server": { | + | | "properties": { | + | | "attach_metadata": { | + | | "description": "The devices of attached volumes", | + | | "title": "Attached Volume Metadata", | + | | "type": "object" | + | | }, | + | | "snapshot_metadata": { | + | | "description": "The metadata of snapshot", | + | | "title": "Snapshot Metadata", | + | | "type": "object" | + | | } | + | | }, | + | | "required": [ | + | | "attached_metadata", | + | | "snapshot_metadata" | + | | ], | + | | "title": "Server Protection Saved Info", | + | | "type": "object" | + | | } | + | | } | + | | } | + | id | cf56bd3e-97a7-4078-b6d5-f36246333fd9 | + | name | OS Infra Provider | + +----------------------+---------------------------------------------------------------------------------------------+ #. Use cinder client to create volumes:: cinder create 1 --name volume1 cinder create 1 --name volume2 cinder list - +--------------------------------------+-----------+--------------+------+-------------+----------+-------------+ - | ID | Status | Name | Size | Volume Type | Bootable | Attached to | - +--------------------------------------+-----------+--------------+------+-------------+----------+-------------+ - | c468688b-dcb1-4bdf-b26b-62e989ac940e | available | volume1 | 1 | lvmdriver-1 | false | | - | d107b234-e16d-4e1e-800d-86523c693e5c | available | volume2 | 1 | lvmdriver-1 | false | | - +--------------------------------------+-----------+--------------+------+-------------+----------+-------------+ + +--------------------------------------+-----------+---------+------+-------------+----------+-------------+ + | ID | Status | Name | Size | Volume Type | Bootable | Attached to | + +--------------------------------------+-----------+---------+------+-------------+----------+-------------+ + | 12e2abc6-f20b-430d-9b36-1a6befd23b6c | available | volume2 | 1 | lvmdriver-1 | false | | + | 700495ee-38e6-41a0-963f-f3f9a24c0f75 | available | volume1 | 1 | lvmdriver-1 | false | | + +--------------------------------------+-----------+---------+------+-------------+----------+-------------+ #. List the protectable resources:: karbor protectable-list +-----------------------+ - | Protectable type | + | Protectable type | +-----------------------+ - | OS::Cinder::Volume | - | OS::Glance::Image | + | OS::Cinder::Volume | + | OS::Glance::Image | | OS::Keystone::Project | - | OS::Nova::Server | + | OS::Nova::Server | +-----------------------+ - + karbor protectable-show OS::Nova::Server + +-----------------+-----------------------------------------------+ + | Property | Value | + +-----------------+-----------------------------------------------+ + | dependent_types | [u'OS::Cinder::Volume', u'OS::Glance::Image'] | + | name | OS::Nova::Server | + +-----------------+-----------------------------------------------+ karbor protectable-list-instances OS::Cinder::Volume +--------------------------------------+--------------------+---------------------+ - | Id | Type | Dependent resources | + | Id | Type | Dependent resources | +--------------------------------------+--------------------+---------------------+ - | c468688b-dcb1-4bdf-b26b-62e989ac940e | OS::Cinder::Volume | [] | - | d107b234-e16d-4e1e-800d-86523c693e5c | OS::Cinder::Volume | [] | + | 12e2abc6-f20b-430d-9b36-1a6befd23b6c | OS::Cinder::Volume | [] | + | 700495ee-38e6-41a0-963f-f3f9a24c0f75 | OS::Cinder::Volume | [] | +--------------------------------------+--------------------+---------------------+ - + karbor protectable-show-instance OS::Cinder::Volume 12e2abc6-f20b-430d-9b36-1a6befd23b6c + +---------------------+--------------------------------------+ + | Property | Value | + +---------------------+--------------------------------------+ + | dependent_resources | [] | + | id | 12e2abc6-f20b-430d-9b36-1a6befd23b6c | + | name | volume2 | + | type | OS::Cinder::Volume | + +---------------------+--------------------------------------+ #. Create a protection plan with a provider and resources:: - karbor plan-create 'OS volumes protection plan.' 'cf56bd3e-97a7-4078-b6d5-f36246333fd9' 'd107b234-e16d-4e1e-800d-86523c693e5c'='OS::Cinder::Volume'='volume2','c468688b-dcb1-4bdf-b26b-62e989ac940e'='OS::Cinder::Volume'='volume1' - +-------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | Property | Value | - +-------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | id | b5969bb9-c571-4538-b827-3746d11aa7a2 | - | name | OS volumes protection plan. | - | parameters | {u'user': {u'value': u'password'}} | - | provider_id | cf56bd3e-97a7-4078-b6d5-f36246333fd9 | - | resources | [{u'type': u'OS::Cinder::Volume', u'id': u'd107b234-e16d-4e1e-800d-86523c693e5c', u'name': u'volume2'}, {u'type': u'OS::Cinder::Volume', u'id': u'c468688b-dcb1-4bdf-b26b-62e989ac940e', u'name': u'volume1'}] | - | status | suspended | - +-------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + karbor plan-create 'OS volumes protection plan.' 'cf56bd3e-97a7-4078-b6d5-f36246333fd9' '12e2abc6-f20b-430d-9b36-1a6befd23b6c'='OS::Cinder::Volume'='volume2','700495ee-38e6-41a0-963f-f3f9a24c0f75'='OS::Cinder::Volume'='volume1' + +-------------+----------------------------------------------------+ + | Property | Value | + +-------------+----------------------------------------------------+ + | description | None | + | id | ef8b83f3-d0c4-48ec-8949-5c72bbf14103 | + | name | OS volumes protection plan. | + | parameters | {} | + | provider_id | cf56bd3e-97a7-4078-b6d5-f36246333fd9 | + | resources | [ | + | | { | + | | "id": "12e2abc6-f20b-430d-9b36-1a6befd23b6c", | + | | "name": "volume2", | + | | "type": "OS::Cinder::Volume" | + | | }, | + | | { | + | | "id": "700495ee-38e6-41a0-963f-f3f9a24c0f75", | + | | "name": "volume1", | + | | "type": "OS::Cinder::Volume" | + | | } | + | | ] | + | status | suspended | + +-------------+----------------------------------------------------+ #. Execute a protect operation manually with a plan:: - karbor checkpoint-create cf56bd3e-97a7-4078-b6d5-f36246333fd9 b5969bb9-c571-4538-b827-3746d11aa7a2 - - +-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | Property | Value | - +-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | id | 503e12db-a815-4101-b526-6b687ba60080 | - | project_id | 8ea0fc3673794f1492b875d349400181 | - | protection_plan | {u'id': u'b5969bb9-c571-4538-b827-3746d11aa7a2', u'resources': [{u'type': u'OS::Cinder::Volume', u'id': u'd107b234-e16d-4e1e-800d-86523c693e5c', u'name': u'volume2'}, {u'type': u'OS::Cinder::Volume', u'id': u'c468688b-dcb1-4bdf-b26b-62e989ac940e', u'name': u'volume1'}], u'name': u'OS volumes protection plan.'} | - | provider_id | cf56bd3e-97a7-4078-b6d5-f36246333fd9 | - | resource_graph | None | - | status | protecting | - +-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + karbor checkpoint-create cf56bd3e-97a7-4078-b6d5-f36246333fd9 ef8b83f3-d0c4-48ec-8949-5c72bbf14103 + +-----------------+------------------------------------------------------+ + | Property | Value | + +-----------------+------------------------------------------------------+ + | created_at | None | + | id | 80f6154f-cc43-441f-8841-35ae23e17f4f | + | project_id | 31478a6f980d4e73a3bdac3ad04a3605 | + | protection_plan | { | + | | "id": "ef8b83f3-d0c4-48ec-8949-5c72bbf14103", | + | | "name": "OS volumes protection plan.", | + | | "resources": [ | + | | { | + | | "id": "12e2abc6-f20b-430d-9b36-1a6befd23b6c", | + | | "name": "volume2", | + | | "type": "OS::Cinder::Volume" | + | | }, | + | | { | + | | "id": "700495ee-38e6-41a0-963f-f3f9a24c0f75", | + | | "name": "volume1", | + | | "type": "OS::Cinder::Volume" | + | | } | + | | ] | + | | } | + | resource_graph | None | + | status | protecting | + +-----------------+------------------------------------------------------+ # check the protect result - cinder backup-list - +--------------------------------------+--------------------------------------+-----------+--------------+------+--------------+---------------+ - | ID | Volume ID | Status | Name | Size | Object Count | Container | - +--------------------------------------+--------------------------------------+-----------+--------------+------+--------------+---------------+ - | 58811e5a-d65f-4d1e-8e3d-2e7f1b688c32 | c468688b-dcb1-4bdf-b26b-62e989ac940e | available | test_protect | 1 | 22 | volumebackups | - | de4bbdab-315b-40f3-b89a-25a23c387e04 | d107b234-e16d-4e1e-800d-86523c693e5c | available | test_protect | 1 | 22 | volumebackups | - +--------------------------------------+--------------------------------------+-----------+--------------+------+--------------+---------------+ - karbor checkpoint-show cf56bd3e-97a7-4078-b6d5-f36246333fd9 503e12db-a815-4101-b526-6b687ba60080 - -#. Execute a protect operation automatically with a scheduler:: - - karbor trigger-create 'My Trigger' 'time' "pattern"="0 20 * * 2":"format"="crontab" - karbor scheduledoperation-create 'Protect with My Trigger' 'protect' "plan_id"="b5969bb9-c571-4538-b827-3746d11aa7a2":"provider_id"="cf56bd3e-97a7-4078-b6d5-f36246333fd9" - - + cinder backup-list + +--------------------------------------+--------------------------------------+-----------+------+------+--------------+---------------+ + | ID | Volume ID | Status | Name | Size | Object Count | Container | + +--------------------------------------+--------------------------------------+-----------+------+------+--------------+---------------+ + | becf53cd-12f8-424d-9b08-54fbffe9495a | 700495ee-38e6-41a0-963f-f3f9a24c0f75 | available | - | 1 | 22 | volumebackups | + | c35317f4-df2a-4c7d-9f36-6495c563a5bf | 12e2abc6-f20b-430d-9b36-1a6befd23b6c | available | - | 1 | 22 | volumebackups | + +--------------------------------------+--------------------------------------+-----------+------+------+--------------+---------------+ + karbor checkpoint-show cf56bd3e-97a7-4078-b6d5-f36246333fd9 80f6154f-cc43-441f-8841-35ae23e17f4f + +-----------------+-----------------------------------------------------------+ + | Property | Value | + +-----------------+-----------------------------------------------------------+ + | created_at | 2017-02-13 | + | id | 80f6154f-cc43-441f-8841-35ae23e17f4f | + | project_id | 31478a6f980d4e73a3bdac3ad04a3605 | + | protection_plan | { | + | | "id": "ef8b83f3-d0c4-48ec-8949-5c72bbf14103", | + | | "name": "OS volumes protection plan.", | + | | "provider_id": "cf56bd3e-97a7-4078-b6d5-f36246333fd9", | + | | "resources": [ | + | | { | + | | "id": "12e2abc6-f20b-430d-9b36-1a6befd23b6c", | + | | "name": "volume2", | + | | "type": "OS::Cinder::Volume" | + | | }, | + | | { | + | | "id": "700495ee-38e6-41a0-963f-f3f9a24c0f75", | + | | "name": "volume1", | + | | "type": "OS::Cinder::Volume" | + | | } | + | | ] | + | | } | + | resource_graph | [ | + | | { | + | | "0x0": [ | + | | "OS::Cinder::Volume", | + | | "700495ee-38e6-41a0-963f-f3f9a24c0f75", | + | | "volume1" | + | | ], | + | | "0x1": [ | + | | "OS::Cinder::Volume", | + | | "12e2abc6-f20b-430d-9b36-1a6befd23b6c", | + | | "volume2" | + | | ] | + | | }, | + | | [] | + | | ] | + | status | available | + +-----------------+-----------------------------------------------------------+ #. Execute a restore operation manually with a checkpoint id:: - karbor --debug restore-create cf56bd3e-97a7-4078-b6d5-f36246333fd9 2c14b9d6-529b-4308-bb17-7334eb351fd7 'http://10.229.47.230/identity/' --parameters 'username'='admin' 'password'='123456' - +----------------+-------------------------------------------------+ - | Property | Value | - +----------------+-------------------------------------------------+ - | checkpoint_id | 2c14b9d6-529b-4308-bb17-7334eb351fd7 | - | id | 34a3418d-444e-4271-922e-e2e2c3fe89ec | - | parameters | {u'username': u'admin', u'password': u'123456'} | - | project_id | 8ea0fc3673794f1492b875d349400181 | - | provider_id | cf56bd3e-97a7-4078-b6d5-f36246333fd9 | - | restore_target | http://10.229.47.230/identity/ | - | status | success | - +----------------+-------------------------------------------------+ - + karbor restore-create cf56bd3e-97a7-4078-b6d5-f36246333fd9 80f6154f-cc43-441f-8841-35ae23e17f4f + +------------------+--------------------------------------+ + | Property | Value | + +------------------+--------------------------------------+ + | checkpoint_id | 80f6154f-cc43-441f-8841-35ae23e17f4f | + | id | f30cb640-594a-487b-9569-c26fd5861c95 | + | parameters | {} | + | project_id | 31478a6f980d4e73a3bdac3ad04a3605 | + | provider_id | cf56bd3e-97a7-4078-b6d5-f36246333fd9 | + | resources_reason | {} | + | resources_status | {} | + | restore_target | None | + | status | in_progress | + +------------------+--------------------------------------+ + karbor restore-show f30cb640-594a-487b-9569-c26fd5861c95 + +------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Property | Value | + +------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ + | checkpoint_id | 80f6154f-cc43-441f-8841-35ae23e17f4f | + | id | f30cb640-594a-487b-9569-c26fd5861c95 | + | parameters | {} | + | project_id | 31478a6f980d4e73a3bdac3ad04a3605 | + | provider_id | cf56bd3e-97a7-4078-b6d5-f36246333fd9 | + | resources_reason | {} | + | resources_status | {u'OS::Cinder::Volume#2b6e0055-bec0-41f5-85fa-a830a3684fd9': u'available', u'OS::Cinder::Volume#6c77fd44-c76b-400e-8aa4-97bce241b690': u'available'} | + | restore_target | None | + | status | success | + +------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ cinder list - +--------------------------------------+-----------+--------------+------+-------------+----------+-------------+ - | ID | Status | Name | Size | Volume Type | Bootable | Attached to | - +--------------------------------------+-----------+--------------+------+-------------+----------+-------------+ - | c468688b-dcb1-4bdf-b26b-62e989ac940e | available | volume1 | 1 | lvmdriver-1 | false | | - | d107b234-e16d-4e1e-800d-86523c693e5c | available | volume2 | 1 | lvmdriver-1 | false | | - | e03c8369-0177-4b2f-87ba-8139dc1c5eaf | available | test_restore | 1 | lvmdriver-1 | false | | - | f208dacd-5a83-4b40-a22e-371c138bd97d | available | test_restore | 1 | lvmdriver-1 | false | | - +--------------------------------------+-----------+--------------+------+-------------+----------+-------------+ + +--------------------------------------+-----------+---------------------------------------------------------------------------+------+-------------+----------+-------------+ + | ID | Status | Name | Size | Volume Type | Bootable | Attached to | + +--------------------------------------+-----------+---------------------------------------------------------------------------+------+-------------+----------+-------------+ + | 12e2abc6-f20b-430d-9b36-1a6befd23b6c | available | volume2 | 1 | lvmdriver-1 | false | | + | 2b6e0055-bec0-41f5-85fa-a830a3684fd9 | available | 80f6154f-cc43-441f-8841-35ae23e17f4f@12e2abc6-f20b-430d-9b36-1a6befd23b6c | 1 | lvmdriver-1 | false | | + | 6c77fd44-c76b-400e-8aa4-97bce241b690 | available | 80f6154f-cc43-441f-8841-35ae23e17f4f@700495ee-38e6-41a0-963f-f3f9a24c0f75 | 1 | lvmdriver-1 | false | | + | 700495ee-38e6-41a0-963f-f3f9a24c0f75 | available | volume1 | 1 | lvmdriver-1 | false | | + +--------------------------------------+-----------+---------------------------------------------------------------------------+------+-------------+----------+-------------+ #. Execute a delete operation manually with a checkpoint id:: cinder backup-list - +--------------------------------------+--------------------------------------+-----------+--------------+------+--------------+---------------+ - | ID | Volume ID | Status | Name | Size | Object Count | Container | - +--------------------------------------+--------------------------------------+-----------+--------------+------+--------------+---------------+ - | 58811e5a-d65f-4d1e-8e3d-2e7f1b688c32 | c468688b-dcb1-4bdf-b26b-62e989ac940e | available | test_protect | 1 | 22 | volumebackups | - | de4bbdab-315b-40f3-b89a-25a23c387e04 | d107b234-e16d-4e1e-800d-86523c693e5c | available | test_protect | 1 | 22 | volumebackups | - +--------------------------------------+--------------------------------------+-----------+--------------+------+--------------+---------------+ + +--------------------------------------+--------------------------------------+-----------+------+------+--------------+---------------+ + | ID | Volume ID | Status | Name | Size | Object Count | Container | + +--------------------------------------+--------------------------------------+-----------+------+------+--------------+---------------+ + | becf53cd-12f8-424d-9b08-54fbffe9495a | 700495ee-38e6-41a0-963f-f3f9a24c0f75 | available | - | 1 | 22 | volumebackups | + | c35317f4-df2a-4c7d-9f36-6495c563a5bf | 12e2abc6-f20b-430d-9b36-1a6befd23b6c | available | - | 1 | 22 | volumebackups | + +--------------------------------------+--------------------------------------+-----------+------+------+--------------+---------------+ - karbor checkpoint-delete cf56bd3e-97a7-4078-b6d5-f36246333fd9 2c14b9d6-529b-4308-bb17-7334eb351fd7 + karbor checkpoint-delete cf56bd3e-97a7-4078-b6d5-f36246333fd9 80f6154f-cc43-441f-8841-35ae23e17f4f cinder backup-list +----+-----------+--------+------+------+--------------+-----------+ | ID | Volume ID | Status | Name | Size | Object Count | Container | +----+-----------+--------+------+------+--------------+-----------+ +----+-----------+--------+------+------+--------------+-----------+ + +#. Execute a protect operation automatically with a scheduler:: + + karbor trigger-create 'My Trigger' 'time' "pattern"="0 20 * * 2","format"="crontab" + +------------+---------------------------------------+ + | Property | Value | + +------------+---------------------------------------+ + | id | b25e2ac8-a7a0-4466-aafe-9363839cfa60 | + | name | My Trigger | + | properties | { | + | | "format": "crontab", | + | | "pattern": "0 20 * * 2", | + | | "start_time": "2017-02-13 02:04:31" | + | | } | + | type | time | + +------------+---------------------------------------+ + karbor scheduledoperation-create 'Protect with My Trigger' protect b25e2ac8-a7a0-4466-aafe-9363839cfa60 "plan_id"="ef8b83f3-d0c4-48ec-8949-5c72bbf14103","provider_id"="cf56bd3e-97a7-4078-b6d5-f36246333fd9" + +----------------------+---------------------------------------------------------+ + | Property | Value | + +----------------------+---------------------------------------------------------+ + | description | None | + | enabled | True | + | id | b3a1b864-31ef-4354-8b0a-1c7da2cf9a13 | + | name | Protect with My Trigger | + | operation_definition | { | + | | "plan_id": "ef8b83f3-d0c4-48ec-8949-5c72bbf14103", | + | | "provider_id": "cf56bd3e-97a7-4078-b6d5-f36246333fd9" | + | | } | + | operation_type | protect | + | trigger_id | b25e2ac8-a7a0-4466-aafe-9363839cfa60 | + +----------------------+---------------------------------------------------------+