r/openstack • • Dec 02 '22

Connect VM’s to one of the computes/network node network VLAN (bridge)

Hello everyone,

I am currently working with Kolla-ansible to install Openstack (master branch) using all-in-one. I successfully installed openstack with main components. Neutron is using openvswitch with DVR, it seems to be working very well (vm’s can reach public internet, floatingip on vm’s are accessible from outside, vm’s can reach each other on the same network). I now need to connect some specific VM’s to a specific VLAN.

My server have 2 network card with two ports each (eth2/eth3 (bond0) and eth0/eth1 (bond1).

I have created multiples vlans on bond1 to correctly separate the traffic for openstack services and bond0 is completely dedicated to provider network. In those vlans, I have one vlan (vlan10, 10.0.10.0/24) that I would like to connect to some vm’s in openstack.

How can I do that?

I tried multiple things:

  • removing eth1 from bond1, to create a second network provider but this time not for public, but private ip’s, it didnt worked.

  • creating one veth pair. One side on the snat of the network that the vms is connected on (using the namespace created by openstack) and the other side the the bridge used on my compute/network node where the vlan is tagged and enabling masquerade, but it also didnt worked.

  • countless desperate way of connecting them…

Maybe I miss implemented one of the solution I tried if it should have worked, please help me!

7 Upvotes

11 comments sorted by

3

u/dasbierclaw Dec 02 '22

If your VMs can successfully connect to the Internet right now, that implies that you've got an interface connected to the provider bridge (ie. br-ex) and have created at least 1 working (external) provider network. Was that a VLAN or FLAT based network? Normally in this case I would just say: create a new neutron network using segmentation ID 10 and VLAN type, and ensure the allocation pool doesn't step on anything that's already in that VLAN/subnet. If you're creating multiple flat networks things get a little trickier, but it's hard to say without knowing the details of the environment.

Can you share details of the existing networks you've created (OpenStack network show) and maybe the output of 'ovs-vsctl show' from the compute node(s)?

1

u/G3EK22 Dec 02 '22

The provider network for the moment is on a flat network, not a vlan tagged. I tried to do it on vlan50 but it wasnt working, only flat was working.

1

u/dasbierclaw Dec 02 '22

Gotcha. So if flat is working, then it sounds like bond0 is setup as an access port at the switch level versus a a trunk. You'll be limited to that single network segment. If you can configure bond0 as a trunk, then neutron can handle vlan tagging for you

1

u/G3EK22 Dec 02 '22

My server is hosted on OVH (dedicated server). I unfortunately dont have access to the switch in front of the server, but pretty sure it should already use trunks. The server is in a vrack and I am using the vrack network bond0 for the provider network (thats where mu ip range (/29) is attached)

2

u/dasbierclaw Dec 02 '22

Can't speak to OVH bare metal service, but in a shared hosting environment I would expect uplinks to servers to be configured as access ports to limit that server's ability to send tagged traffic and end up in someone else's network. If the server has multiple network interfaces, and if one of them can be connected to vlan 10, then neutron could use that interface in a second provider bridge and another flat network could be created using that bridge. Then, VMs could be deployed on vlan 10.

1

u/G3EK22 Dec 02 '22

https://docs.ovh.com/ca/en/dedicated/multiple-vlans/

Seems it should handle vlan on bare metal and vrack. Might have some stuff to do though to configure it. I will check into this. I will still send the output of the commands you asked later

1

u/G3EK22 Dec 02 '22

I will send the output of those command later tonight, I am currently on a road trip (not driving). Thanks for proposing your help.

1

u/G3EK22 Dec 07 '22

(openvswitch-db)[root@ca-bhs8-hv-p-01 /]# ovs-vsctl show

53c7db93-ea56-4803-b789-9504eb5d4ed6

Manager "ptcp:6640:127.0.0.1"

is_connected: true

Bridge br-ex1

Controller "tcp:127.0.0.1:6633"

is_connected: true

fail_mode: secure

datapath_type: system

Port phy-br-ex1

Interface phy-br-ex1

type: patch

options: {peer=int-br-ex1}

Port br-ex1

Interface br-ex1

type: internal

Port br_vxlan

Interface br_vxlan

Bridge br-tun

Controller "tcp:127.0.0.1:6633"

is_connected: true

fail_mode: secure

datapath_type: system

Port br-tun

Interface br-tun

type: internal

Port patch-int

Interface patch-int

type: patch

options: {peer=patch-tun}

Bridge br-int

Controller "tcp:127.0.0.1:6633"

is_connected: true

fail_mode: secure

datapath_type: system

Port int-br-ex2

Interface int-br-ex2

type: patch

options: {peer=phy-br-ex2}

Port br-int

Interface br-int

type: internal

Port int-br-ex1

Interface int-br-ex1

type: patch

options: {peer=phy-br-ex1}

Port patch-tun

Interface patch-tun

type: patch

options: {peer=patch-int}

Bridge br-ex2

Controller "tcp:127.0.0.1:6633"

is_connected: true

fail_mode: secure

datapath_type: system

Port br_mgmt

Interface br_mgmt

Port br-ex2

Interface br-ex2

type: internal

Port phy-br-ex2

Interface phy-br-ex2

type: patch

options: {peer=int-br-ex2}

2

u/fydrah Dec 02 '22

To understand, your vlan 10 in only configured for eth2/3 (bond1), and you want to both use this vlan from your host and from your VM?

If it is, I think you could use an ovs bridge over your bond1 (e.g. br-vlan), manage your several vlans interfaces from ovs --> https://docs.openvswitch.org/en/latest/faq/vlan/ (warning when configuring it, you will break network access to your host if your ssh network access is on one of those vlan), declare the br-vlan in ml2 bridge mapping and use an openstack vlan provider network over it to make the vlan 10 available to your VMs (not sure I explain it well..)

Also if you have a schema of what you want to achieve it could help!

1

u/G3EK22 Dec 02 '22

Will do it and share it here before end of monday, if you can look back later.

1

u/G3EK22 Dec 07 '22

Here is an example : Network Diagram

Like I said I have a br-mgmt that I want to share with one of the VMs. The Diagram might not be perfect, but it is giving an idea of what I want to do.

br-ex1 is on br-vxlan

br-ex2 is on br-mgmt