i get it, but the performance between SVM and VMs is very bad :(
here show the details, it is a bit longer :)
1, add br1.
ovs-vsctl add-br br1
2, create ovs-br1.xml.
ovs-br1
3, start network ovs-br1.
virsh create ovs-br1.xml
4, start 3 VMs.
ovs-br1-centos7x64min1511 vlan-all eth0 NON-IPADDRas SVM
vlan-trunks=2,3
_ovs-br1-centos7x64min1511vlan-02 eth0 192.168.111.92as VM vlan-tag=2
__ovs-br1-centos7x64min1511 vlan-03 eth0 192.168.111.93as VM vlan-tag=3
# then enable sshd on each VM.
5, configure SVM.
modprobe 8021q
systemctl stop NetworkManager
chkconfig NetworkManager off
vconfig add eth0 2
vconfig add eth0 3
vconfig set_name_type DEV_PLUS_VID_NO_PAD
# add ifcfg-eth0.2 and ifcfg-eth0.3 in /etc/sysconfig/network-scripts/
set IPADDR=192.168.111.102 VLAN=yes DEVICE=eth0.2 in ifcfg-eth0.2
set IPADDR=192.168.111.103 VLAN=yes DEVICE=eth0.3 in ifcfg-eth0.3
systemctl restart network
ip addr ls # will show eth0.2@eth0 192.168.111.102 and eth0.3@eth0
192.168.111.103, their mac is same as eth0 itself.
6, add routes for SVM.
ip route add 192.168.111.92/32 via 192.168.111.102 dev eth0.2
ip route add 192.168.111.93/32 via 192.168.111.103 dev eth0.3
7, test connectivity.
# ping from 192.168.111.92(VM vlan-tag=2) to 192.168.111.102(SVM
vlan-trunks=2,3) is ok, v.v. :)
# ping from 192.168.111.93(VM vlan-tag=3) to 192.168.111.103(SVM
vlan-trunks=2,3) is ok, v.v. :)
# ping from 192.168.111.92(VM vlan-tag=2) to 192.168.111.103(SVM
vlan-trunks=2,3) is ok, v.v. :)
# ping from 192.168.111.93(VM vlan-tag=3) to 192.168.111.102(SVM
vlan-trunks=2,3) is ok, v.v. :)
#
# ping from 192.168.111.92(VM vlan-tag=2) to 192.168.111.93(VM vlan-tag=3) is
not ok, v.v. :)
#
# so, it seems to meet requirements now :)
8, test performance.
# @SVM, iperf -s.
# @VMs, iperf -c 192.168.111.102 -d -t 60 or iperf -c 192.168.111.103 -d -t 60,
up and down bandwidths are only tens KBps :(
# next, i scp a 3.3GB size file from VM to SVM, speed is only tens KBps, even
stalled !
# then i start another vm A(ovs-br1, tag=2) and scp the same file from VM to A,
speed is up to hundreds MBps !
what is the bottleneck ?
i guess that SVM can not deal 8021q fast enough may be the reason ?
i need help, thanks for anyone who check this email :)
regards !
-- Original --
From: "Ben Pfaff";;
Date: Mon, Feb 6, 2017 12:42 PM
To: "xiucai";
Cc: "dev";
Subject: Re: [ovs-dev] [urgent] is there anyway to enable multi-vlan for onevm
upon ovs ?
I don't think it normally makes sense to have IP addresses on the same
subnet on different VLANs. If you do that, then how would the kernel
know, when it sends a packet to that subnet, which VLAN to use?
On Mon, Feb 06, 2017 at 10:17:31AM +0800, xiucai wrote:
> thanks a lot.
> i am very sorry about my delay, because i have take the Chinese spring
> festival holidays :)
>
>
> in SVM, i had configured vlan as below:
> modprobe 8021q
> vconfig add eth0 2
> vconfig add eth0 3
> # add ifcfg-eth0.2/ifcfg-eth0.3 to /etc/sysconfig/network-scripts/ and
> modify them.
> systemctl restart network
> # eth0/192.168.111.1 eth0.2@eth0/192.168.111.102
> eth0.3@eth0/192.168.111.103 will appear.
>
>
> but, it still does not work :(
>
>
> so, could you give me details of "how to enable multi-vlan for one vm upon
> openvswitch" :)
>
>
> regards!
>
>
> -- Original --
> From: "Ben Pfaff";;
> Date: Tue, Jan 24, 2017 00:21 AM
> To: "xiucai";
> Cc: "ovs-dev";
> Subject: Re: [ovs-dev] [urgent] is there anyway to enable multi-vlan for
> onvm upon ovs ?
>
>
>
> On Sun, Jan 22, 2017 at 05:18:48PM +0800, xiucai wrote:
> > hi,
> > everyone :)
> >
> >
> > in my case, there is one vm for storage sharing, we name it SVM, and
> > several VMs as testing client.
> > for historic reasons, i can not modify the network which uses vlan upon
> > ovs.
> >
> >
> > the SVM is corresponding to vnet0, make it as trunk for tag-2 and tag-3;
> > the VM1 is corresponding to vnet2/tag-2 and the VM2 is corresponding to
> > vnet4/tag-3.
> > i wanna all VMx can connect to SVM, but VMx can not communicate with
> > each other!
> >
> >
> > ==configurations==
> > SVM's eth0: 192.168.1.1 static 52:54:01:CB:35:C4
> > VM1's eth0: 192.168.1.2 static 52:54:02:CB:35:C4
> > VM2's eth0: 192.168.1.3 static 52:54:03:CB:35:C4
> >
> >
> > Bridge "br1"
> > Port "vnet4"
> > tag: 3
> > Interface "vnet4"
> > Port "vnet0"
> > trunks: [2, 3]
> > Interface "vnet0"
> > Port "vnet2"
> > tag: 2
> > Interface "vnet2"
> > Port "br1"
> > Interface "br1"
> >