Setting up Virtual Machine Clusters on Debian
Tools we used
- VDE-- Virtual Network Solution
- KVM-- Virtual Machine Solution
- qemu
- bridge-utils
- uml-utilities
Network Topo
OS standard ¶
debian lenny x64
Deployment Steps
1. Setup the first virtual machine
- 1.1 For Host-OS Debian Lenny X64. Open Virtualization Support in BIOS.
- 1.1 Get the AMD 64 setup mini-iso http://cdimage.debian.org/debian-cd/5.0.0/amd64/iso-cd/debian-500-amd64-businesscard.iso
- 1.2 Create Virtual Harddisk Image: qemu-img create filename size
- 1.3 Start Virtual machine and setup Debian
- 1.4 "kvm -cpu qemu64 -cdrom iso/debian-500-***.iso -hda vdisks/Machine_0.img -vnc :0"
- 1.5 You may connect to the virtual machine with a vnc client.
- 1.6 Add the VM initialization scripts
2. Setup Virtual Network Environment
- 2.1 Setup tap0 interface for the VDE to bind.
Modify the /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
auto tap0
iface tap0 inet dhcp
up ifconfig $IFACE up
ifconfig $IFACE down
tunctl_user root
auto br0
iface br0 inet static
address 10.1.231.55
netmask 255.255.255.0
broadcast 10.1.231.255
gateway 10.1.231.251
bridge_ports all tap0
3. Setup several Virtual machines
- 3.1 Make several copies of Virtual harddisk
- 3.2 Start Virtual swith that connect to tap0
vde_switch -hub -sock /tmp/switch0 -tap tap0 -m 666
- 3.3 Start Virtual Machine that connected to this virtual switch one by one
vdekvm -sock /tmp/switch0 -cpu qemu64 -hda vdisks/Machine_1.img -net nic,vlan=0,macaddr=00:AA:BB:CC:DD:00 -net vde,vlan-0,sock=/tmp/switch0 -vnc:0
vdekvm -sock /tmp/switch0 -cpu qemu64 -hda vdisks/Machine_1.img -net nic,vlan=0,macaddr=00:AA:BB:CC:DD:00 -net vde,vlan-0,sock=/tmp/switch0 -vnc:1 - 3.4 Now the virtual machines should have been started with a normal IP address in the same subnet as the physical network.
Comments
Post a Comment