Cinder组件详解
作者:互联网
一、Cinder组件介绍
1、概念
2、核心架构
3、核心组件
4、工作流程
二、常用操作
1、Volume管理
# 卷列表查看
cinder list
# 卷详情查看
cinder show <volume>
# 卷创建
cinder create [--name <name>, --volume-type <type>] <size(GB)>
# 卷删除
cinder delete <volume>
# 卷更新
# 1.重命名
cinder rename <volume> <name>
# 2.修改状态
cinder reset-state --state <state> <volume>
# 3.修改类型
cinder retype <volume> <volume_type>
# 4.扩容
cinder extend <volume> <new size>
# 5.迁移
cinder migrate <volume> <host>
2、Type管理
# 查看类型
cinder type-list
# 创建类型
cinder type-create <name>
# 删除类型
cinder type-delete <type_id>
# 修改类型
cinder type-update [--name <name>,...] <type_id>
3、Snapshot管理
# 查看快照列表
cinder snapshot-list
# 查看快照详情
cinder snapshot-show <snapshot>
# 创建快照
cinder snapshot-create [--name <name>] <volume>
# 删除快照
cinder snapshot-delete <snapshot>
4、Backup管理
# 开启卷备份服务
systemctl restart openstack-cinder-backup
# 查看备份列表
cinder backup-list
# 查看备份详情
cinder backup-show <backup>
# 创建备份
cinder backup-create --name <name> [--container <container>] <volume>
# 删除备份
cinder backup-delete <backup>
# 恢复备份
cinder backup-restore [--volume <volume>] <backup>
# 备份导出
cinder backup-export <backup>
# 备份导入
cinder backup-import <backup_service> <backup_url>
三、高级操作
1、Qos管理
2、Transfer管理
3、Service管理
4、Consisgroup管理
5、Encryption管理
四、故障处理
1、cinder创建云硬盘状态错误
错误情况:创建一个云硬盘后,查询硬盘时显示error
[root@controller ~]# cinder create 1 --name test2
+--------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2021-11-14T02:01:12.000000 |
| description | None |
| encrypted | False |
| id | dfad6645-73d3-4d0f-bd83-f8e50c48cb7b |
| metadata | {} |
| migration_status | None |
| multiattach | False |
| name | test2 |
| os-vol-host-attr:host | None |
| os-vol-mig-status-attr:migstat | None |
| os-vol-mig-status-attr:name_id | None |
| os-vol-tenant-attr:tenant_id | 386dbfcf77e444c7872e4e23d5829fcc |
| replication_status | disabled |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| updated_at | None |
| user_id | 0f217182b5af448c988f5464c706a337 |
| volume_type | None |
+--------------------------------+--------------------------------------+
[root@controller ~]# cinder list
+--------------------------------------+--------+-------+------+-------------+----------+-------------+
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+--------+-------+------+-------------+----------+-------------+
| dfad6645-73d3-4d0f-bd83-f8e50c48cb7b | error | test2 | 1 | - | false | |
+--------------------------------------+--------+-------+------+-------------+----------+-------------+
查询块存储服务日志,找到报错信息:
[root@controller cinder]# vi /var/log/cinder/scheduler.log
2021-11-13 20:54:38.708 1268 ERROR cinder.scheduler.flows.create_volume [req-afe87e8b-cc3a-4275-8e58-fb0034da8be7 0f217182b5af448c988f5464c706a337 386dbfcf77e444c7872e4e23d5829fcc - - -]
Failed to run task cinder.scheduler.flows.create_volume.ScheduleCreateVolumeTask;
volume:create: No valid host was found. No weighed hosts available
计算节点上查看openstack的组件服务状态:
[root@compute ~]# openstack-status
== Cinder services ==
openstack-cinder-api: inactive (disabled on boot)
openstack-cinder-scheduler: inactive (disabled on boot)
openstack-cinder-volume: active
openstack-cinder-backup: inactive (disabled on boot)
确保cinder显示active,正常启动。
本次错误原因:两个节点的系统时间不同,导致计算节点的openstack-cinder-volume服务down掉了。需要在计算节点做如下操作:
[root@compute ~]# ntpdate 192.168.16.10
13 Nov 21:00:18 ntpdate[3689]: step time server 192.168.16.10 offset -324038.658500 sec
[root@compute ~]# date
Sat Nov 13 21:00:21 EST 2021
[root@compute ~]# systemctl restart openstack-cinder-volume
执行如上操作后问题解决,可查看dashboard上的系统信息cinder-volume服务从down改为up,如下图所示:
再创建云硬盘时状态改为availability:
[root@controller ~]# cinder create 1 --name test2
+--------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2021-11-14T02:16:13.000000 |
| description | None |
| encrypted | False |
| id | 9f9022f5-1b11-447e-bc0c-d3889712120a |
| metadata | {} |
| migration_status | None |
| multiattach | False |
| name | test2 |
| os-vol-host-attr:host | None |
| os-vol-mig-status-attr:migstat | None |
| os-vol-mig-status-attr:name_id | None |
| os-vol-tenant-attr:tenant_id | 386dbfcf77e444c7872e4e23d5829fcc |
| replication_status | disabled |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| updated_at | None |
| user_id | 0f217182b5af448c988f5464c706a337 |
| volume_type | None |
+--------------------------------+--------------------------------------+
[root@controller ~]# cinder list
+--------------------------------------+-----------+-------+------+-------------+----------+-------------+
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+-------+------+-------------+----------+-------------+
| 9f9022f5-1b11-447e-bc0c-d3889712120a | available | test2 | 1 | - | false | |
+--------------------------------------+-----------+-------+------+-------------+----------+-------------+
标签:status,None,name,volume,详解,cinder,组件,Cinder,id 来源: https://www.cnblogs.com/xiugeng/p/15569187.html