1. 创建volume报错,volume处于error状态
cinder scheduler.log日志
2017-10-31 15:35:04.034 2774 WARNING cinder.scheduler.host_manager [req-a84d9ce8-1bea-42c4-824a-5b2a88fb216d 4893456c61aa4f579aa5b8d66559887e 3a282288926e448daf4ce6b1a0033202 - - -] volume service is down. (host: node-1.domain.tld)
2017-10-31 15:35:04.035 2774 WARNING cinder.scheduler.host_manager [req-a84d9ce8-1bea-42c4-824a-5b2a88fb216d 4893456c61aa4f579aa5b8d66559887e 3a282288926e448daf4ce6b1a0033202 - - -] volume service is down. (host: node-2.domain.tld)
2017-10-31 15:35:04.036 2774 WARNING cinder.scheduler.filter_scheduler [req-a84d9ce8-1bea-42c4-824a-5b2a88fb216d 4893456c61aa4f579aa5b8d66559887e 3a282288926e448daf4ce6b1a0033202 - - -] No weighed hosts found for volume with properties: {}
2017-10-31 15:35:04.040 2774 ERROR cinder.scheduler.flows.create_volume [req-a84d9ce8-1bea-42c4-824a-5b2a88fb216d 4893456c61aa4f579aa5b8d66559887e 3a282288926e448daf4ce6b1a0033202 - - -] Failed to run task cinder.scheduler.flows.create_volume.ScheduleCreateVolumeTask;volume:create: No valid host was found. No weighed hosts available
2. service cinder-volume restart 重启cinder-volume服务,但日志报错
cinder volume.log日志
2017-11-01 10:11:00.713 23101 INFO cinder.volume.manager [req-b3e39378-f66a-4147-9c5f-a6683270fc6b - - - - -] Starting volume driver LVMISCSIDriver (2.0.0)
2017-11-01 10:11:01.077 23101 ERROR cinder.volume.manager [req-b3e39378-f66a-4147-9c5f-a6683270fc6b - - - - -] Error encountered during initialization of driver: LVMISCSIDriver
2017-11-01 10:11:01.078 23101 ERROR cinder.volume.manager [req-b3e39378-f66a-4147-9c5f-a6683270fc6b - - - - -] Unexpected error while running command.
Command: sudo cinder-rootwrap /etc/cinder/rootwrap.conf env LC_ALL=C vgs --noheadings -o name cinder-volumes
Exit code: 5
Stdout: u''
Stderr: u' Volume group "cinder-volumes" not found\n Skipping volume group cinder-volumes\n'
2017-11-01 10:11:01.078 23101 TRACE cinder.volume.manager Traceback (most recent call last):
2017-11-01 10:11:01.078 23101 TRACE cinder.volume.manager File "/usr/lib/python2.6/site-packages/cinder/volume/manager.py", line 251, in init_host
2017-11-01 10:11:01.078 23101 TRACE cinder.volume.manager self.driver.check_for_setup_error()
2017-11-01 10:11:01.078 23101 TRACE cinder.volume.manager File "/usr/lib/python2.6/site-packages/osprofiler/profiler.py", line 105, in wrapper
2017-11-01 10:11:01.078 23101 TRACE cinder.volume.manager return f(*args, **kwargs)
2017-11-01 10:11:01.078 23101 TRACE cinder.volume.manager File "/usr/lib/python2.6/site-packages/cinder/volume/drivers/lvm.py", line 84, in check_for_setup_error
2017-11-01 10:11:01.078 23101 TRACE cinder.volume.manager executor=self._execute)
2017-11-01 10:11:01.078 23101 TRACE cinder.volume.manager File "/usr/lib/python2.6/site-packages/cinder/brick/local_dev/lvm.py", line 80, in __init__
2017-11-01 10:11:01.078 23101 TRACE cinder.volume.manager if self._vg_exists() is False:
2017-11-01 10:11:01.078 23101 TRACE cinder.volume.manager File "/usr/lib/python2.6/site-packages/cinder/brick/local_dev/lvm.py", line 105, in _vg_exists
2017-11-01 10:11:01.078 23101 TRACE cinder.volume.manager self.vg_name, root_helper=self._root_helper, run_as_root=True)
2017-11-01 10:11:01.078 23101 TRACE cinder.volume.manager File "/usr/lib/python2.6/site-packages/cinder/utils.py", line 142, in execute
2017-11-01 10:11:01.078 23101 TRACE cinder.volume.manager return processutils.execute(*cmd, **kwargs)
2017-11-01 10:11:01.078 23101 TRACE cinder.volume.manager File "/usr/lib/python2.6/site-packages/cinder/openstack/common/processutils.py", line 200, in execute
2017-11-01 10:11:01.078 23101 TRACE cinder.volume.manager cmd=sanitized_cmd)
2017-11-01 10:11:01.078 23101 TRACE cinder.volume.manager ProcessExecutionError: Unexpected error while running command.
2017-11-01 10:11:01.078 23101 TRACE cinder.volume.manager Command: sudo cinder-rootwrap /etc/cinder/rootwrap.conf env LC_ALL=C vgs --noheadings -o name cinder-volumes
2017-11-01 10:11:01.078 23101 TRACE cinder.volume.manager Exit code: 5
2017-11-01 10:11:01.078 23101 TRACE cinder.volume.manager Stdout: u''
2017-11-01 10:11:01.078 23101 TRACE cinder.volume.manager Stderr: u' Volume group "cinder-volumes" not found\n Skipping volume group cinder-volumes\n'
3. 解决办法
在每个存储节点执行如下操作
dd if=/dev/zero of=/cinder-volumes bs=1 count=0 seek=5G
losetup -fv /cinder-volumes
losetup -l
vgcreate cinder-volumes /dev/loop0
vgdisplay cinder-volumes
重启每个存储节点cinder-volume服务