openstack创建实例的时候出现报错:实例 “test-1” 执行所请求操作失败,实例处于错误状态。: 请稍后再试 [错误: Build of instance 6ec6e8b1-9300-4be4-95fe-20434ea041f5 aborted: Volume e3dcad3d-dd22-4947-99d8-b8d0ad4b1025 did not finish being created even after we waited 3 seconds or 2 attempts. And its status is error.].
第一反应以为是nova的创建实例超时时间过短导致,但是报错的时间并没有超过默认的配置。以防万一,先更改nova的配置:
[root@cinder ~]#vi /etc/nova/nova.conf
block_device_allocate_retries=300
block_device_allocate_retries_interval=5
block_device_creation_timeout=600
重启nova服务。果然还是有报错。查看nova-compute的日志:
[root@cinder ~]#tail -100f /var/log/nova/nova-compute.log
2019-08-02 10:44:46.592 21266 INFO nova.virt.block_device [req-fbf4e8e9-776b-4d41-8010-a71fbeb242d9 107aa93638c04ab5b76f70ac8f5ac0bf 9cf598aaadf543389ab3
488b0510eb56 - default default] [instance: 7c469771-57e3-4ea7-a27e-5ddb1f48fd6a] Booting with volume-backed-image a4f43e2a-bc8f-40dd-bf32-a8ec504061fa at
/dev/vda
2019-08-02 10:44:50.983 21266 WARNING nova.compute.manager [req-fbf4e8e9-776b-4d41-8010-a71fbeb242d9 107aa93638c04ab5b76f70ac8f5ac0bf 9cf598aaadf543389ab
3488b0510eb56 - default default] Volume id: c61e0f6a-8327-4ec2-adcc-c8ccc90abfc2 finished being created but its status is error.
2019-08-02 10:44:50.984 21266 ERROR nova.compute.manager [req-fbf4e8e9-776b-4d41-8010-a71fbeb242d9 107aa93638c04ab5b76f70ac8f5ac0bf 9cf598aaadf543389ab34
88b0510eb56 - default default] [instance: 7c469771-57e3-4ea7-a27e-5ddb1f48fd6a] Instance failed block device setup: VolumeNotCreated: Volume c61e0f6a-832
7-4ec2-adcc-c8ccc90abfc2 did not finish being created even after we waited 3 seconds or 2 attempts. And its status is error.
发现实例状态错误,没有完成创建。这一报错实际在页面已经显示出来了。我们继续查看cinder节点的日志:
tail -100f /var/log/cinder/volume.log
2019-08-02 09:54:11.957 11959 ERROR cinder.volume.manager [req-31aad7e7-406e-4b5e-a82b-c49be4c19e84 - - - - -] Failed to initialize driver.: ProcessExecu
tionError: 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’File descriptor 20 (/dev/urandom) leaked on vgs invocation. Parent PID 11967: /usr/bin/python2\n WARNING: Device for PV 2i8zCF-bKBd-IMYO-