在CSM大云系统中,共享存储等其他的基础工作已经完成,在CSM页面上申请云硬盘,给虚拟机扩展硬盘。在申请云硬盘时,提示“服务器错误,请联系云管理员。”的错误。具体如图1所示。
图-1
登陆openstack的界面尝试申请云硬盘,能正确申请。如图2所示。
图-2
问题初步分析在CSM与openstack的交互上出问题,openstack与CVK之间能正常通信,下发硬盘创建的相关命令。
问题涉及的相关日志有/var/log/cinder/cinder-compute.log,该文件位于计算节点。查看日志具体内容如下:
2015-06-11 15:34:46.009 7687 INFO cinder.volume.manager [-] Updating volume status
2015-06-11 15:34:46.010 7687 INFO cinder.volume.drivers.cas.driver [-] [cas::] begin to get volume stats
2015-06-11 15:34:46.585 7687 INFO cinder.volume.drivers.cas.driver [-] [cas::] success to get volume pool state: {'volume_backend_name': 'cas-driver', 'free_capacity_gb': 5087.9658203125, 'driver_version': '2.0', 'total_capacity_gb': 5120.0, 'reserved_percentage': 0, 'vendor_name': 'cas', 'storage_protocol': 'LSI Logic SCSI'}
2015-06-11 15:34:46.586 7687 INFO cinder.volume.manager [-] Updating volume replication status.
2015-06-11 15:35:46.015 7687 INFO cinder.volume.manager [-] Updating volume status
2015-06-11 15:35:46.015 7687 INFO cinder.volume.drivers.cas.driver [-] [cas::] begin to get volume stats
2015-06-11 15:35:46.582 7687 INFO cinder.volume.drivers.cas.driver [-] [cas::] success to get volume pool state: {'volume_backend_name': 'cas-driver', 'free_capacity_gb': 5087.9658203125, 'driver_version': '2.0', 'total_capacity_gb': 5120.0, 'reserved_percentage': 0, 'vendor_name': 'cas', 'storage_protocol': 'LSI Logic SCSI'}
2015-06-11 15:35:46.583 7687 INFO cinder.volume.manager [-] Updating volume replication status.
结合iMC的前台日志,该日志位于“iMC安装目录\clientl\log\ imcforeground.log”。
需要关注日志的核心报错内容如下:
2015-06-11 11:39:02 [ERROR] [http-nio-8080-exec-5] [com.imc.cloudss.resource.compute.func.CloudComputeResourceMgrOpenStackImpl::createVolume] 400,/v2/97f59f437dc049358e014d5dd758afc5/volumes,{
"volume" : {
"size" : 100,
"display_name" : "2222",
"display_description" : "",
"availability_zone" : "zone1"
}
}
2015-06-11 11:39:02 [ERROR] [http-nio-8080-exec-5] [com.imc.cloudss.harddisk.view.CloudHardDiskBean::onAddHardDisk] create hard disk error.
com.imc.cloudss.CloudAppException[121000] 服务器错误,请联系云管理员。
前台日志报错分析:"volume"显示具体的云硬盘申请信息,包含四点:"size" : 100为硬盘大小,单位为G,即用户申请100G的云硬盘;"display_name" : "2222"为用户申请云硬盘显示的名字,这个字段很重要,查看前台报错日志就是依据该字段来搜索;"display_description" : ""为硬盘描述;"availability_zone" : "zone1"为计算节点对应的可用域。
com.imc.cloudss.CloudAppException[121000] 服务器错误,请联系云管理员。为CSM页面提示的错误信息。
从iMC的前台日志分析问题,主要原因为计算节点compute和compute的cinder服务对应的可用域不一致。
计算节点compute1和计算节点compute的cinder的默认可用域为nova, 但是在增加可用域配置的时候,用“nova aggregate-add-host agg1 compute”命令时将compute放到了zone1可用域中。而此时compute计算节点的cinder服务可用域仍在nova上,可以用"cinder availability-zone-list"命令查看;
用“cinder availability-zone-list”命,令查看cinder对应的可用域为nova;具体如图3。
图-3
用“nova availability-zone-list ”命令,查看计算节点和nova服务对应的可用域为zone1。本次试验中计算节点的机器名为compute1,具体如图4所示。
图-4
将cinder的可用域由默认的nova修改为zone1(本例中是zone1,读者需要依据具体的情况修改为具体的可用域),具体的修改方法是在openstack的控制器(controller)和计算节点(compute)的”/etc/cinder/cinder.conf”配置文件中添加可用域的配置字段“storage_availability_zone = zone1”,要注意的是该字段添加的位置是[DEFAULT]。不添加该配置时,cinder的可用域默认为nova。
修改完配置文件后,需要在计算节点上运行“service cinder-volume restart”的命令来重启cinder服务。
Cinder.conf配置文件主要分为[DEFAULT],[database]和[keystone_authtoken]三个配置域。
为直观,此处给出cinder.conf的完整配置如下:
[DEFAULT]
rootwrap_config = /etc/cinder/rootwrap.conf
api_paste_confg = /etc/cinder/api-paste.ini
iscsi_helper = tgtadm
volume_name_template = volume-%s
volume_group = cinder-volumes
verbose = True
auth_strategy = keystone
state_path = /var/lib/cinder
lock_path = /var/lock/cinder
volumes_dir = /var/lib/cinder/volumes
volume_driver = cinder.volume.drivers.cas.driver.CasDriver
cas_host_ip = 100.64.10.131
cas_host_username = admin
cas_host_password = admin
cas_hpName = app
cas_glance_host = 100.64.10.145
cas_volume_format = qcow2
rpc_backend = rabbit
rabbit_host = controller
rabbit_password = h3c.com!
my_ip=100.64.10.147
glance_host = controller
storage_availability_zone = zone1
[database]
connection = mysql://cinder:h3c.com!@controller/cinder
[keystone_authtoken]
auth_uri = http://controller:5000/v2.0
identity_uri = http://controller:35357
admin_tenant_name = service
admin_user = cinder
admin_password = h3c.com!
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作