Escolar Documentos
Profissional Documentos
Cultura Documentos
Basel
Baden
Bern
Lausanne
Zrich
Dsseldorf
Frankfurt/M.
Freiburg i. Br.
Hamburg
Mnchen
Stuttgart
LinuxWorld 2006
MnB / CyM
2006
Paravirtualization: Guest-OS with a modified kernel Full / Hardware virtualization, HVM: Non-modified guest-OS, CPU extensions
Intel Vanderpool (VT) AMD Pacifica
LinuxWorld 2006
MnB / CyM
2006
LinuxWorld 2006
MnB / CyM
2006
LinuxWorld 2006
MnB / CyM
2006
DomU
Unmodified user programs Guest OS
Modified kernel (paravirt.)
Host OS
Linux XEN-Kernel
Back-End Device Drivers Native Device Drivers
Control Interface
Event Channel
Virtual CPU
Virtual MMU
LinuxWorld 2006
MnB / CyM
2006
Computer - XEN
N e t w o r k dom0 eth0 veth0 domU-X
vifX.0
eth0
LinuxWorld 2006
MnB / CyM
2006
Computer - XEN
N e t w o r k dom0 eth0 domU-X
LinuxWorld 2006
MnB / CyM
2006
Oracle Database
LinuxWorld 2006
10
MnB / CyM
2006
Example
HA system with Oracle Real Application Cluster
Linux SuSE SLES 10 Cluster with 2 nodes Oracle RAC database version 10.2 Shared storage on a SAN Datafiles on a cluster filesystem (OCFS2) Cluster interconnect with bonding Linux SuSE SLES 10 (with SLES9 hardware virtualization required) Cluster with 2 nodes 2 DomU Oracle RAC database version 10.2 Shared storage on a SAN ??? Datafiles on a cluster filesystem (OCFS2) Cluster interconnect with bonding ???
LinuxWorld 2006
11
MnB / CyM
2006
SAN
SAN
LinuxWorld 2006
12
MnB / CyM
2006
LinuxWorld 2006
13
MnB / CyM
2006
Normally more interfaces are used for redundancy In a XEN environment, we normally use virtual network devices
eth0, eth1, eth2
LinuxWorld 2006
14
MnB / CyM
2006
LinuxWorld 2006
15
MnB / CyM
2006
Shared storage
(Shared) Storage for VM on the same Dom0
Physical devices
RAC1 RAC2
SAN
disk = [ 'phy:sdc,hdb,r','phy:/dev/vg1/lv_vm1,sda,w' ]
Files
disk = [ 'file:/xen/vm1/hda,hda,w' ]
Can also be a sparse file (empty blocks are not yet allocated)
dd if=/dev/zero of=/xen/vm1/hda bs=1024k seek=1023 count=1
Slower, because write-cache will be deactivated (SLES10 Readme) Not acceptable for Cluster: remove losetup -y in /etc/xen/scripts/block
LinuxWorld 2006
16
MnB / CyM
2006
Shared storage
Per default, XEN blocks multiple access to a device
Error: Device 2048 (vbd) could not be connected. File /u03/xen/env4/san/sda is loopback-mounted through /dev/loop111, which is mounted in a guest domain, and so cannot be mounted now.
LinuxWorld 2006
17
MnB / CyM
2006
Shared storage
Shared Storage for VM on different Dom0 (e.g. 2 Laptops)
The shared storage is handled on the Dom0 layer and presented to the DomU like on a single Dom0
Real shared storage (SCSI, fibre channel SAN) When the device for domU is a disk-file, it can be shared via NFS iSCSI (SCSI over IP), visible like normal SCSI disks (slow)
What is iSCSI
Fibre Channel, Host Bus Adaptor
The HBA presents the SAN Storage like SCSI disks to the server (LUN) High-end solution: fast, complex and expensive Can also be used for XEN
Optional: SAN-Switch, Fabric
SCSI HBA
172.16.1.2
SCSI HBA
172.16.1.3
SAN
TCP/IP LAN
LinuxWorld 2006 19 MnB / CyM 2006
What is iSCSI
iSCSI (SCSI over IP, RFC 3720, 256 pages)
SCSI commands are encapsulated in IP packets and transferred via network No expensive, special hardware, no SAN knowledge required Slower access time due to network delay (ping)
SCSI
NIC
iSCSI-target
SCSI
NIC
172.16.1.3
NIC
172.16.1.2
TCP/IP LAN
LinuxWorld 2006
20
MnB / CyM
2006
LinuxWorld 2006
21
MnB / CyM
2006
LinuxWorld 2006
22
MnB / CyM
2006
23
MnB / CyM
2006
-m node -r 2f03cf -o update -n node.conn[0].startup -v automatic # shows the iSCSI disks like /dev/sda, /dev/sdb, ...
24 MnB / CyM 2006
LinuxWorld 2006
25
MnB / CyM
2006
Start DomU
> xm create c xen1 pci=02:01.0 pci=07:01.0
LinuxWorld 2006
26
MnB / CyM
2006
Definition of DomU
Network
Virtual ethernet devices can be presented to DomU Connected to a bridge (acts like a switch) Number of interfaces is restricted to 3
vif = [ 'mac=00:16:3e:36:56:b0', 'mac=00:16:3e:36:56:b1,bridge=xenbr1' , 'mac=00:16:3e:36:56:b4,bridge=xenbr2' ]
LinuxWorld 2006
27
MnB / CyM
2006
Definition of DomU
Kernel
Specify to boot
kernel and initrd (path of Dom0) root-filesystem (relative to the DomU disk)
kernel = '/boot/vmlinuz-xen' ramdisk = '/boot/initrd-xen' root = "/dev/hda1 ro"
bootentry: point of view of the DomU The kernel and initrd to boot will be copied to Dom0 in a temporary dir.
LinuxWorld 2006
28
MnB / CyM
2006
LinuxWorld 2006
29
MnB / CyM
2006
OS installation
yast2 offers a module to install a DomU from installation media
Use of ISO images possible (cdrom=/path/file.iso)
change of CD means: move the next image to the specified name To Re-read the (new) cd-image, press eject when a graphical installation is preferred:
LinuxWorld 2006
30
MnB / CyM
2006
In our example we will use iSCSI and access the shared storage via a cluster filesystem, OCFS2
LinuxWorld 2006
31
MnB / CyM
2006
LinuxWorld 2006
32
MnB / CyM
2006
Setup of OCFS2
For initial setup, use the graphical tool ocfs2console Enable startup in runlevel
/etc/init.d/o2cb enable chkconfig ocfs2 on
/etc/fstab
LABEL=u05 /u05 ocfs2 _netdev,datavolume,nointr
0 0
Fencing
Fencing is the act of forcefully removing a node from a cluster Fencing will be done by a system panic
this normally results to a system reboot
# /etc/sysctl.conf # Reboot after 60 seconds kernel.panic = 60
Network configuration
Virtual network cards (eth0, eth1, eth2)
Configuration via Yast2
Bonding
Use of 2 network devices with the same IP It is also possible to configure bonding on virtual devices
For speed, it does not really make sense, because it is not really faster When you use bonding in the production, use it also here to have the same device names
LinuxWorld 2006
35
MnB / CyM
2006
bond0
eth1 eth2
eth1 eth2
bond0
LinuxWorld 2006
36
MnB / CyM
2006
Oracle installation
Insert the installation CD and mount it
When the cdrom or iso-image is not attached to domU, attach it now
host# xm block-attach domU file://tmp/10gR2.iso /dev/hdc ro xen# mount /dev/hdc /mnt #or remove it xen# umount /mnt host# xm block-detach domU /dev/hdc
Education @home
Daten sind immer im Spiel
LinuxWorld 2006
38
MnB / CyM
2006