openstack系统卷恢复

2022-06-23 14:50:16 浏览数 (1)

步骤:

1、创建和gitlab相同实例类型的机器;

2、查看ceph pool的vms中,gitlab和新建实例的实例ID;

代码语言:javascript复制
#新建实例的ID
[root@ceph-hdd001 ~]# rbd -p vms ls  | grep c1282510-63c4-43bc-8854-5409b7149a1f
c1282510-63c4-43bc-8854-5409b7149a1f_disk
c1282510-63c4-43bc-8854-5409b7149a1f_disk.config
# gitlab实例ID
[root@ceph-hdd001 ~]# rbd -p vms ls  | grep 9484b40c-e15d-4421-870d-80040c916749
9484b40c-e15d-4421-870d-80040c916749_disk
9484b40c-e15d-4421-870d-80040c916749_disk.config

3、导出gitlab的系统磁盘卷;

代码语言:javascript复制
rbd -p vms export 9484b40c-e15d-4421-870d-80040c916749_disk   /tmp/gitlab.disk
rbd -p vms export 9484b40c-e15d-4421-870d-80040c916749_disk.config  /tmp/gitlab_disk.config

4、删除新建实例的磁盘卷信息;

代码语言:javascript复制
rbd -p vms rm c1282510-63c4-43bc-8854-5409b7149a1f_disk

5、导入gitlab的磁盘卷信息并替换新实例的ID,详情见如下:

代码语言:javascript复制
[root@ceph-hdd001 tmp]# rbd -p vms import gitlab.disk --image c1282510-63c4-43bc-8854-5409b7149a1f_disk
rbd: --pool is deprecated for import, use --dest-pool
rbd: --image is deprecated for import, use --dest
Importing image: 100% complete...done.

详情:

代码语言:javascript复制
#查看系统磁盘卷的信息
[root@ceph-hdd001 ~]# rbd ls --pool vms -l | grep ede352c1-cb44-4731-83fe-c1701ef1aa98
ede352c1-cb44-4731-83fe-c1701ef1aa98_disk        100 GiB                                                    2      excl 
ede352c1-cb44-4731-83fe-c1701ef1aa98_disk.config  64 MiB                                                    2       
​
#导出磁盘系统
rbd -p vms export 9484b40c-e15d-4421-870d-80040c916749_disk   /tmp/gitlab.disk
rbd -p vms export 9484b40c-e15d-4421-870d-80040c916749_disk.config  /tmp/gitlab_disk.config
#然后删除需要替换的实例磁盘卷
rbd -p vms rm c1282510-63c4-43bc-8854-5409b7149a1f_disk
​
#然后导入磁盘卷
​
[root@ceph-hdd001 tmp]# rbd -p vms import gitlab.disk --image c1282510-63c4-43bc-8854-5409b7149a1f_disk
rbd: --pool is deprecated for import, use --dest-pool
rbd: --image is deprecated for import, use --dest
Importing image: 100% complete...done.
​

注意:实例系统替换完成后,启动会出现问题:

0 人点赞