Hi John,
I've been chatting with Aron Xu, a Debian Developer from Beijing. He has
been trying XCP. Chatting with him, we agreed that there's really not
enough documentation when we want to work with VLAN networking and XCP.
So we are trying to address this before Wheezy is released.
Thanks to Aron, we have a beginning of a small howto for the dom0 (I
changed only a bit of his style because he was writing to me and not for
a doc, but the content is his). Could you please proof-read what has
been written already in the attached file? Then, could you write
something for point 3/ and 4/? I'm quite unsure how to use "xe
network-create" or "xe vlan-create", what they do.
Also, what is the typical use case? Should all VMs be connected to the
VLAN of the dom0? Can a NIC be connected in multiple networks/vlans?
Cheers,
Thomas
In this howto, we will explain how to setup VLANs and use them with XCP.
1/ Prerequired
1.1/ VLAN tagging capable switch
If you are using multiple physical hosts (with a master and multiple slaves),
they should be connected to a switch that understand VLAN tagging. You need to
ensure that your physical switch is in trunk mode, which means it will pass all
kinds of VLAN tagged network flow, and add corresponding VLAN tag to the ports
that connect to your server. This is the basic of a working VLAN.
1.2/ vconfig package
You need to have the vconfig package installed in your system (install it using
apt-get or dpkg -i).
1.3/ xcp-networkd mode: openvswitch
This howto also assumes that you are using XCP together with openvswitch, and
that the networking mode of XCP is using openvswitch: check that your
configuration in /etc/xcp/network.conf is set to "openvswitch" and not to
"bridge", if it's not the case change the value (by hand or using
"dpkg-reconfigure xcp-networkd" and reboot.
2/ Setting-up eth0 in the VLAN 100
Your /etc/network/interfaces configuration should look like this one:
auto lo
iface lo inet loopback
auto eth0.100
iface eth0.100 inet manual
vlan_raw_device eth0
# The primary network interface
auto xenbr0
iface xenbr0 inet static
bridge_ports eth0.100
bridge_stp on
address 192.168.0.123
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 8.8.8.8
dns-search example.com
This will make xenbr0 bridged to eth0.100, which means VLAN tag 100 on eth0.
As you can see, there's no definition of eth0. This is normal. There is no need
to write about iface eth0, neither bring those devices up explicitly, as the
network will be brought up in a dependency based manner.
In this very example, VLAN 100 was configured as the default tag on the
physical switch, which means everything no tagged will be tagged as 100. But
you are free to use other VLAN for the device as long as you have added the
VLANs to corresponding ports on your physical switch.
You can then continue with what we already have in README.Debian, to configure
the PIFs using "xe pif-reconfigure-ip" of your physical devices, namely eth0.
3/ Setting-up a VLAN for a bunch of virtual machines
...
4/ Creating a virtual machine and attaching it to the VLAN