BeyondTheClouds / enos

Experimental eNvironment for OpenStack :monkey:
https://beyondtheclouds.github.io/enos/
GNU General Public License v3.0
30 stars 22 forks source link

Single network card and internet access for the deployed servers #227

Open msimonin opened 6 years ago

msimonin commented 6 years ago

Problem statement

Kolla (and thus EnOS) assumes that at least two network interfaces are available. There are cases where only one interface is available on the nodes used for the deployment. For instance on Chameleon BareMetal or Grid'5000 not all the physical machines have a second interface wired. One of the interfaces is used to access the external world (internet).

It's possible to deploy OpenStack using EnOS on nodes with only one network card. But a deployed instance won't get internet access by default.

Technical details

Only the G5K (when deploying on nodes with only one network card) and openstack/chameleon provider are impacted by this issue. In the previous provider a virtual device (veth) is created to act as the external interface and the two interfaces (the real and the virtual) are passed to Kolla. At the end of the deployment the veth device is bridged on br-ex but not physically linked to any network. Thus no traffic send to/from br-ex can be received by the instances (this include internal to external or external to internal traffic).

Possible solutions

The network interface

IF=eno1

This is the list of the vip of eth0

ips=$(ip addr show dev $IF|grep "inet .*/32" | awk '{print $2}') if [[ ! -z "$ips" ]] then

vip detected

echo $ips docker exec -ti openvswitch_vswitchd ovs-vsctl add-port br-ex $IF && ip addr flush $IF && dhclient -nw br-ex for ip in $ips do ip addr add $ip dev br-ex done else echo "nothing to do" fi

rizaon commented 6 years ago

I tried the script and it works well.

Just little note that after running this script, enos os --reconfigure does not work because the network node ip is missing. So probably need to revert the script first before reconfigure.

SimonDelamare commented 3 years ago

Hello ! The workaround works well under Grid'5000. Are you planning a more permanent solution to this problem? (just asking because we are doing some spring cleaning on our Enos deployment scripts ;))

msimonin commented 3 years ago

I guess this could be put in the enos logic at the end of the deployment. This would be eased if we update the EnOSlib dependency. I know that @rcherrueau is currently updating the enos code to fit with a newer Openstack version but not sure if updating the lib is planned.

By the way, maybe that's a good idea to test EnOSlib as well on G5k ? :)

https://discovery.gitlabpages.inria.fr/enoslib/

SimonDelamare commented 3 years ago

By the way, maybe that's a good idea to test EnOSlib as well on G5k ? :)

We already do it :) https://gitlab.inria.fr/grid5000/jenkins-scripts/-/blob/master/lib/enoslibtester.rb

msimonin commented 3 years ago

\o/ (btw I can't access the link :( )