@Alex-Zhao
2018-04-17T15:21:30.000000Z
字数 1559
阅读 146
OpenStack
在OpenStack命令行中无法从镜像创建虚拟卷,报错如下:
[root@control1 ~]# openstack volume create --image zhaoliang5318 --size 10 zhaoliang
Invalid image identifier or unable to access requested image. (HTTP 400)
在dashboard中创建虚拟机时,同样无法从镜像创建虚拟卷,报错信息大概一致。命令执行过程中,监控log信息能清楚看见在cinder-api中出现如上报错信息。
环境概括:2个负载均衡节点,3个控制节点,控制节点和存储节点复用。
后端存储使用ceph存储。对于glance使用image-pool,cinder使用volume-pool用于虚拟卷,vms-pool用于存放虚拟机文件。
[root@control1 ~]# cinder service-list
+------------------+---------------+------+---------+-------+----------------------------+-----------------+
| Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+------------------+---------------+------+---------+-------+----------------------------+-----------------+
| cinder-scheduler | control1 | nova | enabled | up | 2018-03-31T02:03:22.000000 | - |
| cinder-scheduler | control2 | nova | enabled | up | 2018-03-31T02:03:20.000000 | - |
| cinder-scheduler | control3 | nova | enabled | up | 2018-03-31T02:03:25.000000 | - |
| cinder-volume | control1@ceph | nova | enabled | up | 2018-03-31T02:03:24.000000 | - |
| cinder-volume | control2@ceph | nova | enabled | up | 2018-03-31T02:03:26.000000 | - |
| cinder-volume | control3@ceph | nova | enabled | up | 2018-03-31T02:03:22.000000 | - |
+------------------+---------------+------+---------+-------+----------------------------+-----------------+
解决方法:
Ceph Documentation -> Ceph Block Device -> Block Devices And OpenStack
在以上文档中有重要一句话:
Note that if you are configuring multiple cinder back ends, glance_api_version = 2 must be in the [DEFAULT] section.
在所有存储节点cinder.conf中的DEFAULT中加入glance_api_version = 2
命令行配置cinder.conf文件如下:
openstack-config --set /etc/cinder/cinder.conf DEFAULT glance_api_version 2