OpenStack cannot connect to Neutron problem solving
We encountered an error when creating a virtual machine in the Icehouse version: the error of unable to connect to Neutron., but the virtual machine can still be created successfully, this is a known bug, which can be solved by modifying the source code.
Note: There is also a situation where your Neutron is really unable to connect. Check whether the service and listening port are normal!
The files installed by Yum are here:
[root@test-node1 ~]# vim /usr/share/openstack-dashboard/openstack_dashboard/api/neutron.py
The source code is installed here:
vim /usr/lib/python2.6/site -packages/openstack_dashboard/api/neutron.py
lacks the is_supported method in the class FloatingIpManager. This is a bug and can be solved by manual modification.
def is_simple_associate_supported(self):
# NOTE: There are two reasons that simple association support
# needs more considerations. (1) Neutron does not support the
# default floating IP pool at the moment. It can be avoided
# in case where only one floating IP pool exists.
# (2) Neutron floating IP is associated with each VIF and
# we need to check whether such VIF is only one for an instance
# to enable simple association support.
return False #At
the bottom of this class, add the following method, pay attention indentation.
def is_supported(self):
network_config = getattr(settings, 'OPENSTACK_NEUTRON_NETWORK', {})
return network_config.get('enable_router', True)
After modification, you need to restart apache to take effect:
[root@test-node1 ~]# /etc/init.d/httpd restart
Note: There is also a situation where your Neutron is really unable to connect. Check whether the service and listening port are normal!
The files installed by Yum are here:
[root@test-node1 ~]# vim /usr/share/openstack-dashboard/openstack_dashboard/api/neutron.py
The source code is installed here:
vim /usr/lib/python2.6/site -packages/openstack_dashboard/api/neutron.py
lacks the is_supported method in the class FloatingIpManager. This is a bug and can be solved by manual modification.
def is_simple_associate_supported(self):
# NOTE: There are two reasons that simple association support
# needs more considerations. (1) Neutron does not support the
# default floating IP pool at the moment. It can be avoided
# in case where only one floating IP pool exists.
# (2) Neutron floating IP is associated with each VIF and
# we need to check whether such VIF is only one for an instance
# to enable simple association support.
return False #At
the bottom of this class, add the following method, pay attention indentation.
def is_supported(self):
network_config = getattr(settings, 'OPENSTACK_NEUTRON_NETWORK', {})
return network_config.get('enable_router', True)
After modification, you need to restart apache to take effect:
[root@test-node1 ~]# /etc/init.d/httpd restart