Configure GuestOS
|
[1] | Configure GuestOS |
[root@ns ~]# mount /dev/Xen/www00 /mnt [root@ns ~]# cd /lib/modules [root@ns modules]# cp -a 2.6.18-8.1.1.el5xen /mnt/lib/modules/ [root@ns modules]# [root@ns ~]# vi /mnt/etc/fstab # default settings are done for HostOS environment like below /dev/Xen/www00 / ext3 defaults 1 1 LABEL=/boot /boot ext3 defaults 1 2 devpts /dev/pts devpts gid=5,mode=620 0 0 tmpfs /dev/shm tmpfs defaults 0 0 proc /proc proc defaults 0 0 sysfs /sys sysfs defaults 0 0 /dev/Xen/www04 /tmp ext3 defaults 1 2 /dev/Xen/www02 /usr ext3 defaults 1 2 /dev/Xen/www03 /var ext3 defaults 1 2 /dev/Xen/www01 swap swap defaults 0 0 /dev/Xen/Host01 swap swap defaults 0 0 # change for GuestOS environment like below /dev/hda1 / ext3 defaults 1 1 devpts /dev/pts devpts gid=5,mode=620 0 0 tmpfs /dev/shm tmpfs defaults 0 0 proc /proc proc defaults 0 0 sysfs /sys sysfs defaults 0 0 /dev/hda5 /tmp ext3 defaults 1 2 /dev/hda3 /usr ext3 defaults 1 2 /dev/hda4 /var ext3 defaults 1 2 /dev/hda2 swap swap defaults 0 0 [root@ns ~]# vi /mnt/etc/sysconfig/network-scripts/ifcfg-eth0 # Broadcom Corporation NetXtreme BCM5751 Gigabit Ethernet PCI Express DEVICE=eth0 BOOTPROTO=static BROADCAST=192.168.0.255 # make it comment # HWADDR=00:13:72:0F:00:80IPADDR=192.168.0.18 IPV6ADDR= IPV6PREFIX= NETMASK=255.255.255.0 NETWORK=192.168.0.0 ONBOOT=yes [root@ns ~]# vi /mnt/etc/sysconfig/selinux # line 6: change SELINUX= disabled [root@ns ~]# vi /mnt/etc/modprobe.conf alias eth0 tg3 alias scsi_hostadapter ahci # add driver for xen alias eth0 xennet [root@ns ~]# vi /mnt/etc/ld.so.conf.d/libc6-xen.conf # add hwcap 0 nosegneg [root@ns ~]# umount /mnt [root@ns ~]# vi /etc/xen/www # kernel kernel = "/boot/vmlinuz-2.6.18-8.1.1.el5xen" # initrd ramdisk = "/boot/initrd-2.6.18-8.1.1.el5xen.img" # memory memory = "512" # name name = "www" # virtual CPUs vcpus = "2" # NICs nicks = "1" # mac address vif = [ 'mac=00:16:3e:00:00:11,bridge=xenbr0' ] # disk disk = [ 'phy:Xen/www00,hda1,w', 'phy:Xen/www01,hda2,w', 'phy:Xen/www02,hda3,w', 'phy:Xen/www03,hda4,w', 'phy:Xen/www04,hda5,w' ] # root partition root = "/dev/hda1 ro" # run level 3 extra = "3" [root@ns ~]# xm create -c www # start # success to boot guestOS if following prompt is shown www.server-linux.info login: # following messages are displayed endlessly, so login and execute following command ( input command even if follwoing message is shown ) printk: 170 messages suppressed. 4gb seg fixup, process pcscd (pid 1266), cs:ip 73:00bbd8b6 [root@www ~]# [root@www ~]# shutdown -r now www.server-linux.info login: # boot normally |
[2] | Set initial configurations first. |
[3] | Backup guestOS in order to add new guestOS easily and quickly if needed. |
# push Ctrl + ] [root@www ~]# # switch to HostOS [root@www ~]# [root ~]# # shutdown Guest [root@ns ~]# xm shutdown www [root@ns ~]# mount /dev/Xen/www00 /mnt [root@ns ~]# cd /mnt [root@ns mnt]# tar czvf root.tgz * [root@ns mnt]# mv root.tgz /root/ [root@ns mnt]# [root@ns ~]# umount /mnt [root@ns ~]# mount /dev/Xen/www02 /mnt [root@ns ~]# cd /mnt [root@ns mnt]# tar czvf usr.tgz * [root@ns mnt]# mv usr.tgz /root/ [root@ns mnt]# [root@ns ~]# umount /mnt [root@ns ~]# mount /dev/Xen/www03 /mnt [root@ns ~]# cd /mnt [root@ns mnt]# tar czvf var.tgz * [root@ns mnt]# mv var.tgz /root/ [root@ns mnt]# [root@ns ~]# umount /mnt [root@ns ~]# total 372120 -rw------- 1 root root 1333 Apr 15 18:39 anaconda-ks.cfg -rw-r--r-- 1 root root 18026 Apr 15 18:39 install.log -rw-r--r-- 1 root root 2889 Apr 15 18:39 install.log.syslog -rw-r--r-- 1 root root 60396721 Apr 15 18:39 root.tgz -rw-r--r-- 1 root root 299138604 Apr 15 18:39 usr.tgz -rw-r--r-- 1 root root 88646338 Apr 15 18:39 var.tgz |
Sponsored Link |