码迷,mamicode.com
首页 > 其他好文 > 详细

Cinder Backup备份

时间:2017-11-06 20:08:35      阅读:290      评论:0      收藏:0      [点我收藏+]

标签:完整   and   rip   vol   family   swift的   zlib   rest   ofo   

cinder 备份提供了三种驱动服务: Ceph,TSM,Swift 其中默认备份驱动服务为swift

cinder 驱动服务的配置在cinder.conf文件中

backup_driver=cinder.backup.drivers.swift

 

Ceph的配置

backup_driver = cinder.backup.drivers.ceph

backup_ceph_conf=/etc/ceph/ceph.conf
backup_ceph_user = cinder
backup_ceph_chunk_size = 134217728
backup_ceph_pool = backups
backup_ceph_stripe_unit = 0
backup_ceph_stripe_count = 0

配置 Nova 来挂载 Ceph RBD 块设备

为了挂载 Cinder 块设备(块设备或者启动卷),必须告诉 Nova 挂载设备时使用的用户和 uuid 。libvirt会使用该用户来和 Ceph 集群进行连接和认证。

rbd_user = cinder
rbd_secret_uuid = 457eb676-33da-42ec-9a8c-9293d545c337

完整版Ceph的配置:
backup_driver = cinder.backup.drivers.ceph
backup_ceph_conf=/etc/ceph/ceph.conf
backup_ceph_user = cinder
backup_ceph_chunk_size = 134217728
backup_ceph_pool = backups
backup_ceph_stripe_unit = 0
backup_ceph_stripe_count = 0

rbd_user = cinder
rbd_secret_uuid = 457eb676-33da-42ec-9a8c-9293d545c337
TSM的配置
backup_driver = cinder.backup.drivers.tsm

backup_tsm_compression = True     (BoolOpt) 启用或禁用压缩备份
backup_tsm_password = password     (StrOpt)  运行TSM用户的密码(节点密码)
backup_tsm_volume_prefix = backup     (StrOpt) 当备份到TSM时备份标识id的卷前缀

Swift的配置
backup_driver = cinder.backup.drivers.swift

backup_swift_url = http://localhost:8080/v1/AUTH
backup_swift_auth = per_user
backup_swift_user = <None>
backup_swift_key = <None>
backup_swift_container = volumebackups
backup_swift_object_size = 52428800
backup_swift_retry_attempts = 3
backup_swift_retry_backoff = 2
backup_compression_algorithm = zlib

 

代码分析

backup(/cinder/backup/)
  /cinder/backup/__init__.py:指定并导入cinder-backup的API类;
  /cinder/backup/api.py:处理所有与卷备份服务相关的请求;

class API(base.Base):卷备份管理的接口API,主要定义了卷的备份相关的三个操作的API:
    create:实现卷的备份的建立;
    delete:实现删除卷的备份;
    restore:实现恢复备份;
这三个操作都需要通过backup_rpcapi定义的RPC框架类的远程调用来实现;

/cinder/backup/driver.py:所有备份驱动类的基类;

class BackupDriver(base.Base):所有备份驱动类的基类;

/cinder/backup/manager.py:卷备份的管理操作的实现;

class BackupManager(manager.SchedulerDependentManager):块存储设备的备份管理;继承自类 SchedulerDependentManager;
主要实现的是三个远程调用的方法:
   create_backup:实现卷的备份的建立(对应api.py中的creat方法);
   restore_backup:实现恢复备份(对应api.py中的restore方法);
   delete_backup:实现删除卷的备份(对应api.py中的delete方法);

/cinder/backup/drivers/ceph.py:ceph备份服务实现;
   class CephBackupDriver(BackupDriver):Ceph对象存储的Cinder卷备份类;这个类确认备份Cinder卷到Ceph对象存储系统;

/cinder/backup/drivers/swift.py:用swift作为后端的备份服务的实现;
   class SwiftBackupDriver(BackupDriver):用swift作为后端的备份服务的各种管理操作实现类;

/cinder/backup/drivers/tsm.py:IBM Tivoli存储管理(TSM)的备份驱动类;
   class TSMBackupDriver(BackupDriver):实现了针对TSM驱动的卷备份的备份、恢复和删除等操作;

 

具体操作

创建卷
cinder create --display-name volume1 1
备份卷
cinder backup-create --container volumes_backup --display-name backuptoswift volume1
恢复卷
cinder backup-restore --volume-id cb0fe233-f9b6-4303-8a61-c31c863ef7ce volume1
删除卷
cinder backup-delete 1b9237a4-b384-4c8e-ad05-2e2dfd0c698c

 

具体可参见:
Ceph BLOCK DEVICES AND OPENSTACK

Cinder Backup备份

标签:完整   and   rip   vol   family   swift的   zlib   rest   ofo   

原文地址:http://www.cnblogs.com/gzxbkk/p/7794648.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!