大数据中创建云硬盘失败的解决过程是怎样的
本篇文章为大家展示了大数据中创建云硬盘失败的解决过程是怎样的,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。
一、背景
登录dashboard,点击创建云硬盘失败,而且是点击完就直接报error错误。
二、解决经过
思路一:新上传的image镜像,是不是image的版本有问题
检查完发现新的image镜像是新版本的qcow2格式 QEMU QCOW Image (v3),
# qemu-img info cloudera-quickstart-vm-5.7.0-0-kvm.qcow2 image: cloudera-quickstart-vm-5.7.0-0-kvm.qcow2file format: qcow2virtual size: 64G (68719476736 bytes)disk size: 8.3Gcluster_size: 65536Format specific information: compat: 1.1 lazy refcounts: false
而旧版本的镜像的compat是0.10
怀疑版本问题导致无法创建,尝试版本转换
# qemu-img amend -f qcow2 -o compat=0.10 test.qcow2
结果转换也失败!
同时想到尝试直接从镜像 启动云主机,发现云主机启动正常,于是否认思路一。
思路二:从镜像创建云硬盘失败,检查cinder的日志
一开始从日志中查找云硬盘的id,未发现有用信息。最后在scheduler.log 日志中发现了端倪。
# cd /var/log/cinder# view scheduler.log 2016-07-16 15:09:02.307 12684 WARNING cinder.scheduler.host_manager [req-42961a34-f2ae-4595-bb01-f4b862edfa49 3d8b93c202a94046be24e4eee5d16fb8 c05f2d7996144cb69921e64391db4512 - - -] volume service is down. (host: bdc212)2016-07-16 15:09:02.308 12684 WARNING cinder.scheduler.filter_scheduler [req-42961a34-f2ae-4595-bb01-f4b862edfa49 3d8b93c202a94046be24e4eee5d16fb8 c05f2d7996144cb69921e64391db4512 - - -] No weighed hosts found for volume with properties: {}2016-07-16 15:09:02.310 12684 ERROR cinder.scheduler.flows.create_volume [req-42961a34-f2ae-4595-bb01-f4b862edfa49 3d8b93c202a94046be24e4eee5d16fb8 c05f2d7996144cb69921e64391db4512 - - -] Failed to run task cinder.scheduler.flows.create_volume.ScheduleCreateVolumeTask;volume:create: No valid host was found. No weighed hosts available2016-07-16 15:09:30.887 12684 WARNING cinder.scheduler.host_manager [req-230ee887-c621-457d-979b-c0a7f2e477f9 3d8b93c202a94046be24e4eee5d16fb8 c05f2d7996144cb69921e64391db4512 - - -] volume service is down. (host: bdc212)2016-07-16 15:09:30.888 12684 WARNING cinder.scheduler.filter_scheduler [req-230ee887-c621-457d-979b-c0a7f2e477f9 3d8b93c202a94046be24e4eee5d16fb8 c05f2d7996144cb69921e64391db4512 - - -] No weighed hosts found for volume with properties: {}2016-07-16 15:09:30.890 12684 ERROR cinder.scheduler.flows.create_volume [req-230ee887-c621-457d-979b-c0a7f2e477f9 3d8b93c202a94046be24e4eee5d16fb8 c05f2d7996144cb69921e64391db4512 - - -] Failed to run task cinder.scheduler.flows.create_volume.ScheduleCreateVolumeTask;volume:create: No valid host was found. No weighed hosts available
日志中的 volume service is down. (host: bdc212)说明了问题,检查bdc212主机上的volume服务
bdc212
Warning keystonerc not sourced
== Nova services ==
openstack-nova-api: active
openstack-nova-cert: active
openstack-nova-compute: active
openstack-nova-scheduler: active
openstack-nova-conductor: active
== Glance services ==
openstack-glance-api: active
openstack-glance-registry: active
== Keystone service ==
== Horizon service ==
openstack-dashboard: active
== neutron services ==
neutron-server: active
neutron-openvswitch-agent: active
== Cinder services ==
openstack-cinder-api: active
openstack-cinder-scheduler: active
openstack-cinder-volume: failed
== Support services ==
openvswitch: active
dbus: active
target: active
rabbitmq-server: active
memcached: active
== Keystone users ==
发现 openstack-cinder-volume 服务状态为失败,于是重启 openstack-cinder-volume 服务
# systemctl status openstack-cinder-volume● openstack-cinder-volume.service - OpenStack Cinder Volume Server Loaded: loaded (/usr/lib/systemd/system/openstack-cinder-volume.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Wed 2016-07-13 08:18:36 CST; 3 days ago Main PID: 1775 (code=exited, status=1/FAILURE)Jul 13 08:18:36 bdc212 cinder-volume[1775]: 2016-07-13 08:18:36.002 1775 TRACE cinder File "/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/session.py", line 413, in create_engineJul 13 08:18:36 bdc212 cinder-volume[1775]: 2016-07-13 08:18:36.002 1775 TRACE cinder _test_connection(engine, max_retries, retry_interval)Jul 13 08:18:36 bdc212 cinder-volume[1775]: 2016-07-13 08:18:36.002 1775 TRACE cinder File "/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/session.py", line 591, in _test_connectionJul 13 08:18:36 bdc212 cinder-volume[1775]: 2016-07-13 08:18:36.002 1775 TRACE cinder six.reraise(type(de_ref), de_ref)Jul 13 08:18:36 bdc212 cinder-volume[1775]: 2016-07-13 08:18:36.002 1775 TRACE cinder File "", line 2, in reraiseJul 13 08:18:36 bdc212 cinder-volume[1775]: 2016-07-13 08:18:36.002 1775 TRACE cinder DBConnectionError: (_mysql_exceptions.OperationalError) (2003, "Can't connect to MySQL server on '192.168.8.212' (111)")Jul 13 08:18:36 bdc212 cinder-volume[1775]: 2016-07-13 08:18:36.002 1775 TRACE cinderJul 13 08:18:36 bdc212 systemd[1]: openstack-cinder-volume.service: main process exited, code=exited, status=1/FAILUREJul 13 08:18:36 bdc212 systemd[1]: Unit openstack-cinder-volume.service entered failed state.Jul 13 08:18:36 bdc212 systemd[1]: openstack-cinder-volume.service failed.[root@bdc212 scripts]# systemctl restart openstack-cinder-volume[root@bdc212 scripts]# systemctl status openstack-cinder-volume ● openstack-cinder-volume.service - OpenStack Cinder Volume Server Loaded: loaded (/usr/lib/systemd/system/openstack-cinder-volume.service; enabled; vendor preset: disabled) Active: active (running) since Sat 2016-07-16 15:13:25 CST; 1s ago Main PID: 552481 (cinder-volume) CGroup: /system.slice/openstack-cinder-volume.service ├─552481 /usr/bin/python2 /usr/bin/cinder-volume --config-file /usr/share/cinder/cinder-dist.conf --config-file /etc/cinder/cinder.conf --logfile /var/log/cinder/volume.log └─552488 /usr/bin/python2 /usr/bin/cinder-volume --config-file /usr/share/cinder/cinder-dist.conf --config-file /etc/cinder/cinder.conf --logfile /var/log/cinder/volume.logJul 16 15:13:25 bdc212 systemd[1]: Started OpenStack Cinder Volume Server.Jul 16 15:13:25 bdc212 systemd[1]: Starting OpenStack Cinder Volume Server...Jul 16 15:13:25 bdc212 cinder-volume[552481]: /usr/lib/python2.7/site-packages/cinder/openstack/common/service.py:38: DeprecationWarning: The oslo namespace package is deprecated. Please use oslo_config instead.Jul 16 15:13:25 bdc212 cinder-volume[552481]: from oslo.config import cfgJul 16 15:13:25 bdc212 cinder-volume[552481]: No handlers could be found for logger "oslo_config.cfg"Jul 16 15:13:26 bdc212 cinder-volume[552481]: 2016-07-16 15:13:26.162 552481 INFO cinder.volume.manager [req-8fa3b983-e73d-4ec8-9186-6cb0a9ca7c95 - - - - -] Determined volume DB was not empty at startup.Jul 16 15:13:26 bdc212 cinder-volume[552481]: 2016-07-16 15:13:26.223 552481 INFO cinder.openstack.common.service [req-8fa3b983-e73d-4ec8-9186-6cb0a9ca7c95 - - - - -] Starting 1 workersJul 16 15:13:26 bdc212 cinder-volume[552481]: 2016-07-16 15:13:26.228 552481 INFO cinder.openstack.common.service [req-8fa3b983-e73d-4ec8-9186-6cb0a9ca7c95 - - - - -] Started child 552488Jul 16 15:13:26 bdc212 cinder-volume[552481]: 2016-07-16 15:13:26.229 552488 INFO cinder.service [-] Starting cinder-volume node (version 2015.1.2)Jul 16 15:13:26 bdc212 cinder-volume[552481]: 2016-07-16 15:13:26.232 552488 INFO cinder.volume.manager [req-ee43f1f7-7c1b-4cda-9583-b8f40b188a5f - - - - -] Starting volume driver RBDDriver (1.1.0)
再次创建云硬盘,发现可以成功创建!
上述内容就是大数据中创建云硬盘失败的解决过程是怎样的,你们学到知识或技能了吗?如果还想学到更多技能或者丰富自己的知识储备,欢迎关注行业资讯频道。