direct-io.hg

view tools/vnet/doc/vnet-xend.txt @ 5517:10e9028c8e3d

bitkeeper revision 1.1718.1.10 (42b7b19aqOS_1M8I4pIOFjiTPYWV-g)

Merge bk://xenbits.xensource.com/xen-unstable.bk
into spot.cl.cam.ac.uk:C:/Documents and Settings/iap10/xen-unstable.bk
author iap10@spot.cl.cam.ac.uk
date Tue Jun 21 06:20:10 2005 +0000 (2005-06-21)
parents 777fa188124b
children 6bad5eb72ce0 dfaf788ab18c
line source
2 Vnets: Virtual Networks for Virtual Machines
4 Mike Wray <mike.wray@hp.com>
6 0) Introduction
7 ---------------
9 Vnets provide virtual private LANs for virtual machines.
10 This is done using bridging and tunneling. A virtual interface
11 on a vnet can only see other interfaces on the same vnet - it cannot
12 see the real network, and the real network cannot see it either.
14 Virtual interfaces on the same vnet can be on the same machine
15 or on different machines, they can still talk. The hosting machines
16 can even be on different subnets if you run vnetd to forward,
17 or have multicast routing enabled.
20 1) Installing vnet support
21 --------------------------
23 Assuming the code has been installed (make install in the parent directory),
24 configure xend to use 'network-vnet' instead of the default 'network' to
25 start up networking. This just loads the vnet module when networking starts.
27 In /etc/xend/xend-config.sxp:
29 Configure the network script:
31 (network-script network-vnet)
33 Restart xend.
35 2) Creating vnets
36 -----------------
38 Xend already implements commands to add/remove vnets and
39 bridge to them. To add a vnet use
41 xm call vnet_add <vnet config file>
43 For example, if vnet97.sxp contains:
45 (vnet (id 97) (bridge vnet97) (vnetif vnetif97) (security none))
47 do
49 xm call vnet_add vnet97.sxp
51 This will define a vnet with id 97 and no security. The bridge for the
52 vnet is called vnet97 and the virtual interface for it is vnetif97.
53 To add an interface on a vm to this vnet simply set its bridge to vnet97
54 in its configuration.
56 In Python:
58 vif="bridge=vnet97"
60 In sxp:
62 (dev (vif (mac aa:00:00:01:02:03) (bridge vnet97)))
64 Once configured, vnets are persistent in the xend database.
65 To remove a vnet use
67 xm call vnet_delete <vnet id>
69 To list vnets use
71 xm call vnets
73 To get information on a vnet id use
75 xm call vnet <vnet id>
77 3) Troubleshooting
78 ------------------
80 The vnet module should appear in 'lsmod'.
81 If a vnet has been configured it should appear in the output of 'xm call vnets'.
82 Its bridge and interface should appear in 'ifconfig'.
83 It should also show in 'brctl show', with its attached interfaces.
85 You can 'see into' a vnet from dom0 if you put an IP address on the bridge.
86 For example, if you have vnet97 with a vm with ip addr 10.0.0.12 on it,
87 then
89 ifconfig vnet97 10.0.0.20 up
91 should let you ping 10.0.0.12 via the vnet97 bridge.
93 4) Examples
94 -----------
96 Here's the full config for a vm on vnet 97, using ip addr 10.0.0.12:
98 (vm
99 (name dom12)
100 (memory '64')
101 (cpu '1')
102 (console '8502')
103 (image
104 (linux
105 (kernel /boot/vmlinuz-2.6-xenU)
106 (ip 10.0.0.12:1.2.3.4::::eth0:off)
107 (root /dev/hda1)
108 (args 'rw fastboot 4')
109 )
110 )
111 (device (vbd (uname phy:hda2) (dev hda1) (mode w)))
112 (device (vif (mac aa:00:00:11:00:12) (bridge vnet97)))
113 )
115 If you run another vm on the same vnet:
117 (vm
118 (name dom11)
119 (memory '64')
120 (cpu '1')
121 (console '8501')
122 (image
123 (linux
124 (kernel /boot/vmlinuz-2.6-xenU)
125 (ip 10.0.0.11:1.2.3.4::::eth0:off)
126 (root /dev/hda1)
127 (args 'rw fastboot 4')
128 )
129 )
130 (device (vbd (uname phy:hda3) (dev hda1) (mode w)))
131 (device (vif (mac aa:00:00:11:00:11) (bridge vnet97)))
132 )
134 the vms should be able to talk over the vnet. Check with ping.
135 If they are both on the same machine the connection will simply
136 be the vnet97 bridge, if they are on separate machines their
137 packets will be tunneled in etherip. They should be able to
138 see each other, but not the real network.