openstack与ceph集成完成后功能测试

一. glance对接功能测试

上传镜像【success!】

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 上传镜像
root@localhost:~# openstack image create "cirros-0.4.0-x86_64" --file cirros-0.4.0-x86_64-disk.img --disk-format qcow2 --container-format bare --public
# 验证
root@localhost:~# glance image-list
+--------------------------------------+---------------------+
| ID | Name |
+--------------------------------------+---------------------+
| 73d31ccc-8eae-49e9-a0a7-2731e5a3806a | cirros-0.4.0-x86_64 |
+--------------------------------------+---------------------+
root@localhost:~# rbd -p images ls
73d31ccc-8eae-49e9-a0a7-2731e5a3806a
# 查看块设备(镜像)详情
root@localhost:~# rbd -p images info 73d31ccc-8eae-49e9-a0a7-2731e5a3806a
rbd image '73d31ccc-8eae-49e9-a0a7-2731e5a3806a':
size 12 MiB in 2 objects
order 23 (8 MiB objects)
snapshot_count: 1
id: 1c4b9299cdad7
block_name_prefix: rbd_data.1c4b9299cdad7
format: 2
features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
op_features:
flags:
create_timestamp: Tue Apr 2 05:43:02 2024
access_timestamp: Tue Apr 2 05:43:02 2024
modify_timestamp: Tue Apr 2 05:43:02 2024

查看是否存在快照【存在】

protected: True(此处–此标签表示被保护起来了 无法直接删除 后面集成nova后 使用此镜像创建虚拟机 他会针对此镜像快照 克隆一个出来)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
root@localhost:~# rbd snap ls images/73d31ccc-8eae-49e9-a0a7-2731e5a3806a
SNAPID NAME SIZE PROTECTED TIMESTAMP
13 snap 12 MiB yes Tue Apr 2 05:43:04 2024
# 查看快照详情
root@localhost:~# rbd info images/73d31ccc-8eae-49e9-a0a7-2731e5a3806a@snap
rbd image '73d31ccc-8eae-49e9-a0a7-2731e5a3806a':
size 12 MiB in 2 objects
order 23 (8 MiB objects)
snapshot_count: 1
id: 1c4b9299cdad7
block_name_prefix: rbd_data.1c4b9299cdad7
format: 2
features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
op_features:
flags:
create_timestamp: Tue Apr 2 05:43:02 2024
access_timestamp: Tue Apr 2 05:43:02 2024
modify_timestamp: Tue Apr 2 05:43:02 2024
protected: True (此处--此标签表示被保护起来了)

日志查看

kolla-ansible部署的集群glance出现问题可在/var/log/kolla/glance/glance-api.log中查看此时glance对接完成。

二. ciner对接功能测试

前端页面创建磁盘后端ceph查看是否成功【success!】

https://github.com/zznn-cloud/zznn-cloud-blog-images/raw/main/Qexo/24/4/image_c52afb0c1b17c459ac6dc022eff72bf8.png

1
2
3
oot@localhost:~# rbd -p volumes ls |grep cdfce732-c69f-4ea6-9f95-181c19b932dd
volume-cdfce732-c69f-4ea6-9f95-181c19b932dd

扩容云硬盘【success!】

1
2
3
4
5
6
7
8
9
10
11
12
13
14
root@localhost:~# rbd -p volumes info volume-cdfce732-c69f-4ea6-9f95-181c19b932dd
rbd image 'volume-cdfce732-c69f-4ea6-9f95-181c19b932dd':
size 5 GiB in 1280 objects 【成功扩容到了5G】
order 22 (4 MiB objects)
snapshot_count: 0
id: 1ce49280a276
block_name_prefix: rbd_data.1ce49280a276
format: 2
features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
op_features:
flags:
create_timestamp: Tue Apr 2 07:01:15 2024
access_timestamp: Tue Apr 2 07:01:15 2024
modify_timestamp: Tue Apr 2 07:01:15 2024

创建快照【前端/后端 success!】

查看后端快照及快照详情

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
root@localhost:~# rbd -p  volumes ls
volume-0069c8f9-4f25-4233-91a9-a2f27006f208
volume-0b204bfd-a83b-4d02-aa5c-b7894d710f07
volume-69c5a7f6-fdc8-4c81-9a24-9ffc3aa413ce
volume-ad6ee530-b73e-4605-b0aa-fc6813e10b8a
volume-cdfce732-c69f-4ea6-9f95-181c19b932dd
root@localhost:~# rbd -p volumes snap ls volume-cdfce732-c69f-4ea6-9f95-181c19b932dd
SNAPID NAME SIZE PROTECTED TIMESTAMP
10 snapshot-d8b94a76-c1b1-48c6-a5f7-d7a478b5cf8c 5 GiB yes Tue Apr 2 07:23:35 2024
root@localhost:~# rbd info volumes/volume-cdfce732-c69f-4ea6-9f95-181c19b932dd@snapshot-d8b94a76-c1b1-48c6-a5f7-d7a478b5cf8c
rbd image 'volume-cdfce732-c69f-4ea6-9f95-181c19b932dd':
size 5 GiB in 1280 objects
order 22 (4 MiB objects)
snapshot_count: 1
id: 1ce49280a276
block_name_prefix: rbd_data.1ce49280a276
format: 2
features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
op_features:
flags:
create_timestamp: Tue Apr 2 07:01:15 2024
access_timestamp: Tue Apr 2 07:01:15 2024
modify_timestamp: Tue Apr 2 07:01:15 2024
protected: True

日志查看

报错查看ciner日志文件目录:/var/log/kolla/cinder/

cinder-api-access.log cinder-api-error.log cinder-api.log cinder-backup.log cinder-scheduler.log cinder-volume.log

ciner对接完成。

三. ciner-backup对接功能测试【前端/后端success!】

创建云硬盘备份

https://github.com/zznn-cloud/zznn-cloud-blog-images/raw/main/Qexo/24/4/image_baec65a01ef1848667e37913f18fb4a2.png

前端创建完成其实后端实现方式如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# 帮助
cinder -h |grep backup
cinder help backup-create

# 查看卷
root@localhost:/var/log/kolla/cinder# cinder list
+--------------------------------------+-----------+-------------+------+----------------+-------------+----------+-------------+
| ID | Status | Name | Size | Consumes Quota | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+-------------+------+----------------+-------------+----------+-------------+
| cdfce732-c69f-4ea6-9f95-181c19b932dd | available | cinder-test | 5 | True | __DEFAULT__ | false | |
+--------------------------------------+-----------+-------------+------+----------------+-------------+----------+-------------+

# 对其进行备份
root@localhost:/var/log/kolla/cinder# cinder backup-create cdfce732-c69f-4ea6-9f95-181c19b932dd --name backup-demo
+-----------+--------------------------------------+
| Property | Value |
+-----------+--------------------------------------+
| id | c9c3ef24-e310-4685-aa54-64cd6fa7d08b |
| name | backup-demo |
| volume_id | cdfce732-c69f-4ea6-9f95-181c19b932dd |
+-----------+--------------------------------------+

# 查看
root@localhost:/var/log/kolla/cinder# cinder backup-list
+--------------------------------------+--------------------------------------+-----------+-------------+------+--------------+-----------+----------------------------------+
| ID | Volume ID | Status | Name | Size | Object Count | Container | User ID |
+--------------------------------------+--------------------------------------+-----------+-------------+------+--------------+-----------+----------------------------------+
| 6774233c-007a-4d49-a8a7-38dc9993b440 | cdfce732-c69f-4ea6-9f95-181c19b932dd | available | test | 5 | 0 | backups | d9737a89a5754af99610d37225abd070 |
| c9c3ef24-e310-4685-aa54-64cd6fa7d08b | cdfce732-c69f-4ea6-9f95-181c19b932dd | available | backup-demo | 5 | 0 | backups | d9737a89a5754af99610d37225abd070 |
+--------------------------------------+--------------------------------------+-----------+-------------+------+--------------+-----------+----------------------------------+

# 查看卷详情
root@localhost:/var/log/kolla/cinder# cinder backup-show 6774233c-007a-4d49-a8a7-38dc9993b440
+-----------------------------------+--------------------------------------+
| Property | Value |
+-----------------------------------+--------------------------------------+
| availability_zone | None |
| container | backups |
| created_at | 2024-04-02T07:48:41.000000 |
| data_timestamp | 2024-04-02T07:48:41.000000 |
| description | None |
| fail_reason | None |
| has_dependent_backups | False |
| id | 6774233c-007a-4d49-a8a7-38dc9993b440 |
| is_incremental | False |
| metadata | {} |
| name | test |
| object_count | 0 |
| os-backup-project-attr:project_id | 2cb7b9ee85ab4d8a8257723a08c8a032 |
| size | 5 |
| snapshot_id | None |
| status | available |
| updated_at | 2024-04-02T07:49:01.000000 |
| user_id | d9737a89a5754af99610d37225abd070 |
| volume_id | cdfce732-c69f-4ea6-9f95-181c19b932dd |
+-----------------------------------+--------------------------------------+
# 查看卷实际上就是把卷拷贝过来一份
root@localhost:/var/log/kolla/cinder# rbd -p backups ls
volume-cdfce732-c69f-4ea6-9f95-181c19b932dd.backup.6774233c-007a-4d49-a8a7-38dc9993b440
volume-cdfce732-c69f-4ea6-9f95-181c19b932dd.backup.c9c3ef24-e310-4685-aa54-64cd6fa7d08b


ciner-backup对接完成。

四. nova(libvirt)与ceph对接功能测试【success!】

创建虚拟机测试 (前端创建后端验证)

查看系统盘

1
2
3
4
(venv3) root@localhost:~# rbd -p volumes ls |grep 39a0ae42-08b3-4885-850f-12536e3d2051
volume-39a0ae42-08b3-4885-850f-12536e3d2051
(venv3) root@localhost:~# rbd device list
(venv3) root@localhost:~#

https://github.com/zznn-cloud/zznn-cloud-blog-images/raw/main/Qexo/24/4/image_245c6b28748b4fb29da0f259cc4be37d.png