diff --git a/anvil/components/neutron.py b/anvil/components/neutron.py index 81a4771a..50eecf00 100644 --- a/anvil/components/neutron.py +++ b/anvil/components/neutron.py @@ -15,6 +15,7 @@ # under the License. from anvil import colorizer +from anvil import exceptions from anvil import log as logging from anvil import shell as sh @@ -45,6 +46,23 @@ class NeutronInstaller(binstall.PythonInstallComponent, NeutronPluginMixin): super(NeutronInstaller, self).__init__(*args, **kargs) self.configurator = qconf.NeutronConfigurator(self) + def pre_install(self): + # Check if network namespaces are supported. + if self.get_option("use_namespaces", default_value=True): + try: + # "ip netns" command is used for network namespace management. + # We are trying to execute this command and if it was executed + # successfully then network namespaces support is enabled. + sh.execute(["ip", "netns"]) + except exceptions.ProcessExecutionError: + raise exceptions.InstallException( + "Network namespaces are not supported in your system. " + "Please, install kernel and iproute with network " + "namespaces support. To install them from RDO you can " + "use the following script: " + "./tools/install-neutron-ns-packages.sh") + super(NeutronInstaller, self).pre_install() + def post_install(self): super(NeutronInstaller, self).post_install() if self.get_bool_option("db-sync"): diff --git a/tools/configure-openvswitch.sh b/tools/configure-openvswitch.sh old mode 100644 new mode 100755 diff --git a/tools/install-neutron-ns-packages.sh b/tools/install-neutron-ns-packages.sh new file mode 100755 index 00000000..9bc7dabf --- /dev/null +++ b/tools/install-neutron-ns-packages.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# This script is used to install 'kernel' and 'iproute' +# with network namespaces support for openstack-neutron +# from RDO havana repository. + +set -e + +echo "Adding RDO havana repo..." +sudo rpm -i --force http://rdo.fedorapeople.org/openstack-havana/rdo-release-havana.rpm +sudo yum clean all + +echo "Installing 'kernel' and 'iproute' from RDO..." +sudo yum install -y kernel iproute + +echo "Kernel updated. Please, reboot into it!"