Xen Paravirtualization
IBM X3105
Opteron 1212, Mem 1 GB
1. Cek compabilitas dari server
cat /proc/cpuinfo |grep svm
flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush mmx fxsr sse sse2 ht nx mmxext fxsr_opt lm 3dnowext 3dnow up pni cx16 lahf_lm cmp_legacy svm extapic cr8legacy ts fid vid ttp tm stc
2. Download
http://www.jailtime.org/lib/exe/fetch.php?cache=cache&media=download%3Acentos%3Acentos.5-2.20080708.img.tar.
bz2
3. Ekstrak file di /vm/centos
isinya :
-rw-r--r-- 1 root root 2098200576 Jul 9 10:22 centos.5-2.img
-rw-r--r-- 1 root root 280 Dec 24 00:34 centos.5-2.xen3.cfg
4. Buat swap
dd if=/dev/zero of=swapimage.img bs=1024 count=128
mkswap swapimage.img
Edit file centos.5-2.xen3.cfg
kernel = "/boot/vmlinuz-2.6.18-92.el5xen"
memory = 256
name = "centos.5-2"
vif = [ 'mac=00:16:3e:13:e4:81, bridge=xenbr0', ]
#dhcp = "dhcp"
disk = ['file:/vm/centos/centos.5-2.img,sda1,w','file:/vm/centos/swapimage.img,sda2,w']
root = "/dev/sda1 ro"
5. Jalankan xm create -c centos.5-2.xen3.cfg
Sering error
mount: could not find filesystem '/dev/root'
Lakukan :
mkinitrd /boot/initrd-2.6.18-92.el5xen-centos5.2.img `uname -r` --with xenblk --with xennet --preload xenblk --preload xennet
Edit file cfg
kernel = "/boot/vmlinuz-2.6.18-92.el5xen"
ramdisk = "/boot/initrd-2.6.18-92.el5xen-centos5.2.img"
memory = 256
name = "centos.5-2"
vif = [ 'mac=00:16:3e:13:e4:81, bridge=xenbr0', ]
#dhcp = "dhcp"
disk = ['file:/vm/centos/centos.5-2.img,sda1,w','file:/vm/centos/swapimage.img,sda2,w']
root = "/dev/sda1 ro"
6. Aktifkan swap
#mount /vm/centos/centos.5-2.img /mnt/tmp/ -o loop
vim /mnt/tmp/etc/fstab/
ubah menjadi
[root@pjbekasi ~]# cat /mnt/tmp/etc/fstab
/dev/sda1 / ext3 defaults 1 1
/dev/sda2 none swap sw 0 0
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
7. Jalankan #xm create -c centos.5-2.xen3.cfg
Perlu diingat bahwa konfigurasi diatas menggunakan kernel yang sama dengan Domain0
dan initrd berada lokasi yang sama di /boot Domain0
# ls -l
total 19091
-rw-r--r-- 1 root root 65406 Jun 11 2008 config-2.6.18-92.el5
-rw-r--r-- 1 root root 65287 Jun 11 2008 config-2.6.18-92.el5xen
drwxr-xr-x 2 root root 1024 Dec 23 20:28 grub
-rw------- 1 root root 3116031 Jul 24 01:03 initrd-2.6.18-92.el5.img
-rw-r--r-- 1 root root 2830386 Jul 24 19:55 initrd-2.6.18-92.el5kdump.img
-rw------- 1 root root 3136131 Dec 23 23:30 initrd-2.6.18-92.el5xen-centos5.2.img
-rw------- 1 root root 3117050 Dec 24 2008 initrd-2.6.18-92.el5xen.img
drwx------ 2 root root 12288 Jul 24 00:55 lost+found
-rw-r--r-- 1 root root 80032 Nov 23 2007 message
-rw-r--r-- 1 root root 91734 Jun 11 2008 symvers-2.6.18-92.el5.gz
-rw-r--r-- 1 root root 93281 Jun 11 2008 symvers-2.6.18-92.el5xen.gz
-rw-r--r-- 1 root root 912686 Jun 11 2008 System.map-2.6.18-92.el5
-rw-r--r-- 1 root root 908390 Jun 11 2008 System.map-2.6.18-92.el5xen
-rw-r--r-- 1 root root 1806388 Jun 11 2008 vmlinuz-2.6.18-92.el5
-rw-r--r-- 1 root root 2161376 Jun 11 2008 vmlinuz-2.6.18-92.el5xen
IBM X3105
Opteron 1212, Mem 1 GB
1. Cek compabilitas dari server
cat /proc/cpuinfo |grep svm
flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush mmx fxsr sse sse2 ht nx mmxext fxsr_opt lm 3dnowext 3dnow up pni cx16 lahf_lm cmp_legacy svm extapic cr8legacy ts fid vid ttp tm stc
2. Download
http://www.jailtime.org/lib/exe/fetch.php?cache=cache&media=download%3Acentos%3Acentos.5-2.20080708.img.tar.
bz2
3. Ekstrak file di /vm/centos
isinya :
-rw-r--r-- 1 root root 2098200576 Jul 9 10:22 centos.5-2.img
-rw-r--r-- 1 root root 280 Dec 24 00:34 centos.5-2.xen3.cfg
4. Buat swap
dd if=/dev/zero of=swapimage.img bs=1024 count=128
mkswap swapimage.img
Edit file centos.5-2.xen3.cfg
kernel = "/boot/vmlinuz-2.6.18-92.el5xen"
memory = 256
name = "centos.5-2"
vif = [ 'mac=00:16:3e:13:e4:81, bridge=xenbr0', ]
#dhcp = "dhcp"
disk = ['file:/vm/centos/centos.5-2.img,sda1,w','file:/vm/centos/swapimage.img,sda2,w']
root = "/dev/sda1 ro"
5. Jalankan xm create -c centos.5-2.xen3.cfg
Sering error
mount: could not find filesystem '/dev/root'
Lakukan :
mkinitrd /boot/initrd-2.6.18-92.el5xen-centos5.2.img `uname -r` --with xenblk --with xennet --preload xenblk --preload xennet
Edit file cfg
kernel = "/boot/vmlinuz-2.6.18-92.el5xen"
ramdisk = "/boot/initrd-2.6.18-92.el5xen-centos5.2.img"
memory = 256
name = "centos.5-2"
vif = [ 'mac=00:16:3e:13:e4:81, bridge=xenbr0', ]
#dhcp = "dhcp"
disk = ['file:/vm/centos/centos.5-2.img,sda1,w','file:/vm/centos/swapimage.img,sda2,w']
root = "/dev/sda1 ro"
6. Aktifkan swap
#mount /vm/centos/centos.5-2.img /mnt/tmp/ -o loop
vim /mnt/tmp/etc/fstab/
ubah menjadi
[root@pjbekasi ~]# cat /mnt/tmp/etc/fstab
/dev/sda1 / ext3 defaults 1 1
/dev/sda2 none swap sw 0 0
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
7. Jalankan #xm create -c centos.5-2.xen3.cfg
Perlu diingat bahwa konfigurasi diatas menggunakan kernel yang sama dengan Domain0
dan initrd berada lokasi yang sama di /boot Domain0
# ls -l
total 19091
-rw-r--r-- 1 root root 65406 Jun 11 2008 config-2.6.18-92.el5
-rw-r--r-- 1 root root 65287 Jun 11 2008 config-2.6.18-92.el5xen
drwxr-xr-x 2 root root 1024 Dec 23 20:28 grub
-rw------- 1 root root 3116031 Jul 24 01:03 initrd-2.6.18-92.el5.img
-rw-r--r-- 1 root root 2830386 Jul 24 19:55 initrd-2.6.18-92.el5kdump.img
-rw------- 1 root root 3136131 Dec 23 23:30 initrd-2.6.18-92.el5xen-centos5.2.img
-rw------- 1 root root 3117050 Dec 24 2008 initrd-2.6.18-92.el5xen.img
drwx------ 2 root root 12288 Jul 24 00:55 lost+found
-rw-r--r-- 1 root root 80032 Nov 23 2007 message
-rw-r--r-- 1 root root 91734 Jun 11 2008 symvers-2.6.18-92.el5.gz
-rw-r--r-- 1 root root 93281 Jun 11 2008 symvers-2.6.18-92.el5xen.gz
-rw-r--r-- 1 root root 912686 Jun 11 2008 System.map-2.6.18-92.el5
-rw-r--r-- 1 root root 908390 Jun 11 2008 System.map-2.6.18-92.el5xen
-rw-r--r-- 1 root root 1806388 Jun 11 2008 vmlinuz-2.6.18-92.el5
-rw-r--r-- 1 root root 2161376 Jun 11 2008 vmlinuz-2.6.18-92.el5xen