云主机创建失败

在OpenStack创建云主机时报错。
OpenStack在创建云主机的时候,网络、租户、路由、镜像都创建没有问题,然后在创建云主机的时候,指定了云主机选择源是一个镜像cirros,主机类型选m1.tiny最小的,然后选择网络,但是创建中就报错,Block Device Mapping is Invalid。
在这里插入图片描述
在网上找了很多办法一一尝试。
openstack volume service list查看到cinder-volume 的状态一直为down。
在这里插入图片描述
原因是在于我没有创建卷。使用命令创建卷 cinder-volumes。
pvcreate /dev/sdb1
vgcreate cinder-volumes /dev/sdb1
systemctl restart openstack-cinder-volume 重启服务
openstack volume service list 再次查看
在这里插入图片描述
但是此时创建云主机还是原来的错误。继续排查。
再次查看日志

[root@test ~(keystone_admin)]# tail -l /var/log/cinder/volume.log 
2021-06-09 21:19:35.088 117234 ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/cinder/utils.py", line 123, in execute
2021-06-09 21:19:35.088 117234 ERROR oslo_messaging.rpc.server     return processutils.execute(*cmd, **kwargs)
2021-06-09 21:19:35.088 117234 ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py", line 389, in execute
2021-06-09 21:19:35.088 117234 ERROR oslo_messaging.rpc.server     cmd=sanitized_cmd)
2021-06-09 21:19:35.088 117234 ERROR oslo_messaging.rpc.server ProcessExecutionError: Unexpected error while running command.
2021-06-09 21:19:35.088 117234 ERROR oslo_messaging.rpc.server Command: sudo cinder-rootwrap /etc/cinder/rootwrap.conf env LC_ALL=C lvcreate -n volume-1b9a7e95-e0cd-4696-8407-f2750460e05d cinder-volumes -L 1g
2021-06-09 21:19:35.088 117234 ERROR oslo_messaging.rpc.server Exit code: 5
2021-06-09 21:19:35.088 117234 ERROR oslo_messaging.rpc.server Stdout: u''
2021-06-09 21:19:35.088 117234 ERROR oslo_messaging.rpc.server Stderr: u'File descriptor 10 (/dev/urandom) leaked on lvcreate invocation. Parent PID 117539: /usr/bin/python2\n  Volume group "cinder-volumes" has insufficient free space (255 extents): 256 required.\n'

重启系统,准备新增硬盘。重启完成后发现,卷重名了。

[root@test ~(keystone_admin)]# vgs
  VG             #PV #LV #SN Attr   VSize    VFree   
  cinder-volumes   1   0   0 wz--n-   20.60g   20.60g
  cinder-volumes   1   0   0 wz--n- 1020.00m 1020.00m
  [root@test ~(keystone_admin)]# vgdisplay 
  --- Volume group ---
  VG Name               cinder-volumes
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               20.60 GiB
  PE Size               4.00 MiB
  Total PE              5273
  Alloc PE / Size       0 / 0   
  Free  PE / Size       5273 / 20.60 GiB
  VG UUID               ckXeby-zj25-QBsz-TalV-iiat-9fdT-g7XB4r
   
  --- Volume group ---
  VG Name               cinder-volumes
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               1020.00 MiB
  PE Size               4.00 MiB
  Total PE              255
  Alloc PE / Size       0 / 0   
  Free  PE / Size       255 / 1020.00 MiB
  VG UUID               Id4N9J-7K4K-4OHO-0z1C-PBR3-9Cwa-V85QJL
  [root@test ~(keystone_admin)]# vgrename Id4N9J-7K4K-4OHO-0z1C-PBR3-9Cwa-V85QJL newone
  Processing VG cinder-volumes because of matching UUID Id4N9J-7K4K-4OHO-0z1C-PBR3-9Cwa-V85QJL
  Volume group "Id4N9J-7K4K-4OHO-0z1C-PBR3-9Cwa-V85QJL" successfully renamed to "newone"
[root@test ~(keystone_admin)]# vgs
  VG             #PV #LV #SN Attr   VSize    VFree   
  cinder-volumes   1   0   0 wz--n-   20.60g   20.60g
  newone           1   0   0 wz--n- 1020.00m 1020.00m
  [root@test ~(keystone_admin)]# systemctl restart openstack-cinder*
[root@test ~(keystone_admin)]# vgs
  VG             #PV #LV #SN Attr   VSize    VFree   
  cinder-volumes   1   0   0 wz--n-   20.60g   20.60g
  newone           1   0   0 wz--n- 1020.00m 1020.00m
[root@test ~(keystone_admin)]# openstack volume service list
+------------------+------------------+------+---------+-------+----------------------------+
| Binary           | Host             | Zone | Status  | State | Updated At                 |
+------------------+------------------+------+---------+-------+----------------------------+
| cinder-backup    | test.abc.com     | nova | enabled | up    | 2021-06-09T13:50:10.000000 |
| cinder-volume    | test.abc.com@lvm | nova | enabled | up    | 2021-06-09T13:50:10.000000 |
| cinder-scheduler | test.abc.com     | nova | enabled | up    | 2021-06-09T13:50:09.000000 |
+------------------+------------------+------+---------+-------+----------------------------+

重新启动服务,再次生成主机成功!!!!!

猜你喜欢

转载自blog.csdn.net/qq_26350199/article/details/117753758