Openstack Stein 部署遇到的問題
- 2019 年 10 月 7 日
- 筆記
OpenStack 的第 19 個版本 Stein,支援 5G 和邊緣計算。 OpenStack Stein 強化裸機和網路管理性能,同時更快速的啟動 Kubernetes 集群,還為邊緣計算和 NFV 用例提供網路升級功能,增強了資源管理和跟蹤性能。
OS版本:CentOS 7.7 ( CentOS Linux release 7.7.1908 ) Openstack版本:Stein
compute節點部署完nova-compute,啟動時卡住
查看nova-compute.log日誌,報消息隊列錯誤
2019-09-20 13:38:32.411 68483 INFO os_vif [-] Loaded VIF plugins: ovs, linux_bridge, noop 2019-09-20 13:38:32.878 68483 ERROR oslo.messaging._drivers.impl_rabbit [req-b955a570-83bc-4a14-966f-2eefe5a82579 - - - - -] Connection failed: [Errno 113] EHOSTUNREACH (retrying in 2.0 seconds): error: [Errno 113] EHOSTUNREACH 2019-09-20 13:38:34.888 68483 ERROR oslo.messaging._drivers.impl_rabbit [req-b955a570-83bc-4a14-966f-2eefe5a82579 - - - - -] Connection failed: [Errno 113] EHOSTUNREACH (retrying in 4.0 seconds): error: [Errno 113] EHOSTUNREACH 2019-09-20 13:38:38.899 68483 ERROR oslo.messaging._drivers.impl_rabbit [req-b955a570-83bc-4a14-966f-2eefe5a82579 - - - - -] Connection failed: [Errno 113] EHOSTUNREACH (retrying in 6.0 seconds): error: [Errno 113] EHOSTUNREACH 2019-09-20 13:38:44.912 68483 ERROR oslo.messaging._drivers.impl_rabbit [req-b955a570-83bc-4a14-966f-2eefe5a82579 - - - - -] Connection failed: [Errno 113] EHOSTUNREACH (retrying in 8.0 seconds): error: [Errno 113] EHOSTUNREACH 2019-09-20 13:38:52.931 68483 ERROR oslo.messaging._drivers.impl_rabbit [req-b955a570-83bc-4a14-966f-2eefe5a82579 - - - - -] Connection failed: [Errno 113] EHOSTUNREACH (retrying in 10.0 seconds): error: [Errno 113] EHOSTUNREACH
查看nova配置文件,rabbitmq配置正確的,登陸controller節點,查看nova服務的日誌,並沒有報消息隊列的錯誤 對比controller節點和compute節點rabbitmq的配置,一樣的,controller節點不報錯,compute節點報錯。而controller節點上部署了消息隊列服務,想到可能是防火牆導致compute節點的nova服務不能訪問controller節點的mq服務 查看,果然沒有將防火牆關閉,關閉後問題解決。
compute節點部署完nova-compute,執行nova service-list,計算節點服務正常,但是計算節點的nova日誌報錯,和資源有關,感覺是和placement服務有關
2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager [req-128f79a5-8b18-471b-9967-aae3cfde3043 - - - - -] Error updating resources for node compute.: ResourceProviderRetrievalFailed: Failed to get resource provider with UUID 092506db-b8fe-49d3-a962-9182e0025dea 2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager Traceback (most recent call last):2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 8148, in _update_available_resource_for_node2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager startup=startup)2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/compute/resource_tracker.py", line 744, in update_available_resource2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager self._update_available_resource(context, resources, startup=startup)2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/oslo_concurrency/lockutils.py", line 328, in inner2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager return f(*args, **kwargs)2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/compute/resource_tracker.py", line 825, in _update_available_resource2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager self._update(context, cn, startup=startup)2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/compute/resource_tracker.py", line 1032, in _update2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager self._update_to_placement(context, compute_node, startup)2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/retrying.py", line 68, in wrapped_f2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager return Retrying(*dargs, **dkw).call(f, *args, **kw)2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/retrying.py", line 223, in call2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager return attempt.get(self._wrap_exception)2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/retrying.py", line 261, in get2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager six.reraise(self.value[0], self.value[1], self.value[2])2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/retrying.py", line 217, in call2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager attempt = Attempt(fn(*args, **kwargs), attempt_number, False)2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/compute/resource_tracker.py", line 958, in _update_to_placement2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager context, compute_node.uuid, name=compute_node.hypervisor_hostname)2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/scheduler/client/report.py", line 873, in get_provider_tree_and_ensure_root2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager parent_provider_uuid=parent_provider_uuid)2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/scheduler/client/report.py", line 655, in _ensure_resource_provider2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager rps_to_refresh = self._get_providers_in_tree(context, uuid)2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/scheduler/client/report.py", line 71, in wrapper2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager return f(self, *a, **k)2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager File "/usr/lib/python2.7/site-packages/nova/scheduler/client/report.py", line 522, in _get_providers_in_tree2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager raise exception.ResourceProviderRetrievalFailed(uuid=uuid)2019-09-20 14:20:24.477 69378 ERROR nova.compute.manager ResourceProviderRetrievalFailed: Failed to get resource provider with UUID 092506db-b8fe-49d3-a962-9182e0025dea
網上搜下該問題,和許可權有關
# vim /etc/httpd/conf.d/00-placement-api.conf # add <Directory /usr/bin> <IfVersion >= 2.4> Require all granted </IfVersion> <IfVersion < 2.4> Order allow,deny Allow from all </IfVersion> </Directory> # su -s /bin/sh -c "placement-manage db sync" placement # systemctl restart httpd
修改後,問題解決
sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-iptables: No such file or directory
在/etc/sysctl.conf中添加:
net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 執行sysctl -p 時出現: [root@localhost ~]# sysctl -p sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-ip6tables: No such file or directory sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-iptables: No such file or directory 解決方法:
[root@localhost ~]# modprobe br_netfilter [root@localhost ~]# sysctl -p net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1
重啟後模組失效,下面是開機自動載入模組的腳本
在/etc/新建rc.sysinit 文件
cat /etc/rc.sysinit
#!/bin/bash for file in /etc/sysconfig/modules/*.modules ; do [ -x $file ] && $file done 在/etc/sysconfig/modules/目錄下新建文件如下
cat /etc/sysconfig/modules/br_netfilter.modules modprobe br_netfilter 增加許可權
chmod 755 br_netfilter.modules 重啟後 模組自動載入
[root@localhost ~]# lsmod |grep br_netfilter br_netfilter 22209 0 bridge 136173 1 br_netfilter
openstack虛擬機實例卡在系統引導,不能啟動作業系統
顯示 booting from hard disk… GRUB
無論是網上下載的cirros鏡像,還是自己安裝再上載創建的linux,windows鏡像,都不能啟動,卡了一段時間,轉戰實體機,直接在裸機上安裝linux,再安裝openstack,一切正常,虛擬機實例都正常啟動,(windows 都需安裝virtio驅動)。
回過頭來解決這個vmware上的虛擬機上安裝的openstack不能啟動實例作業系統的問題,確認了解決方向,就是虛擬磁碟格式和驅動程式的問題,通過 virsh edit XXXX 的方法,可見不能啟動的虛擬機是採用virtio驅動程式
把它改為 再 virsh start XXX 啟動虛擬機,可以正常啟動,但很快,不到1分鐘內實例被自動關閉,如且無論virsh edit XXX修改,還是修改 /etc/libvirt/qemu/instan-00000002.xml 這個虛擬機定義文件,在openstack介面啟動實例後都自動恢復為原來的配置文件。
最後找到一個辦法,直接修改鏡像文件的參數屬性,指定硬碟和網卡的屬性:
# openstack image set --property hw_disk_bus=ide --property hw_vif_model=e1000 <image-id>
這個命令修改硬碟屬性為ide,網卡屬性為e1000
再用這個修改屬性後的鏡像生成虛擬機實例,ok,能正常引導系統,能識別虛擬硬碟了。