Saya coba sharing ilmu gimana cara virtualisasi menggunakan XEN di RHEL 5.1
Yang harus di siapkan adalah
1. Komputer yang sudah terinstall OS RHEL atau CentOS juga bisa.
2. ISO OS RHEL atau CentOS.
3. FTP di host OS (komputer utama/asli).
4. Partisi untuk guest OS.
Untuk virtualisasi menggunakan XEN kita harus install kernel-xen dan paket-paket mendukungnya di host.
Untuk menginstallnya sebaiknya dengan groupnya.
pertama kita lihat nama groupnya untuk virtualisasi ( biasanya bernama Virtualization ).
1 | [root@host~]# yum grouplist |
nanti akan keluar seperti ini
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | [root@server1 ~]# yum grouplist Loading "installonlyn" plugin Loading "rhnplugin" plugin Loading "security" plugin This system is not registered with RHN. RHN support will be disabled. Setting up Group Process Setting up repositories VT 100% |=========================| 1.3 kB 00:00 Server 100% |=========================| 1.1 kB 00:00 Installed Groups: Office/Productivity MySQL Database Editors System Tools Text-based Internet Virtualization Legacy Network Server DNS Name Server GNOME Desktop Environment FTP Server Network Servers Legacy Software Development X Window System Graphics Web Server Windows File Server Printing Support Mail Server Server Configuration Tools Administration Tools Graphical Internet Available Groups: Engineering and Scientific Development Libraries Development Tools GNOME Software Development X Software Development Authoring and Publishing Games and Entertainment Java Development KDE Software Development KDE (K Desktop Environment) Sound and Video PostgreSQL Database News Server Done |
untuk menginstall dengan perintah ini
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | [root@server1 ~]# yum groupinstall Virtualization Loading "installonlyn" plugin Loading "rhnplugin" plugin Loading "security" plugin This system is not registered with RHN. RHN support will be disabled. Setting up Group Process Setting up repositories Setting up repositories Reading repository metadata in from local files Resolving Dependencies --> Populating transaction set with selected packages. Please wait. ---> Downloading header for gnome-applet-vm to pack into transaction set. gnome-applet-vm-0.1.2-1.e 100% |=========================| 8.6 kB 00:00 ---> Package gnome-applet-vm.i386 0:0.1.2-1.el5 set to be updated ---> Downloading header for libvirt to pack into transaction set. libvirt-0.2.3-9.el5.i386. 100% |=========================| 24 kB 00:00 ---> Package libvirt.i386 0:0.2.3-9.el5 set to be updated ---> Downloading header for xen to pack into transaction set. xen-3.0.3-41.el5.i386.rpm 100% |=========================| 86 kB 00:00 ---> Package xen.i386 0:3.0.3-41.el5 set to be updated ---> Downloading header for kernel-xen to pack into transaction set. kernel-xen-2.6.18-53.el5. 100% |=========================| 252 kB 00:00 ---> Package kernel-xen.i686 0:2.6.18-53.el5 set to be installed ---> Downloading header for Virtualization-en-US to pack into transaction set. Virtualization-en-US-5.1. 100% |=========================| 27 kB 00:00 ---> Package Virtualization-en-US.noarch 0:5.1.0-12 set to be updated ---> Downloading header for virt-manager to pack into transaction set. virt-manager-0.4.0-3.el5. 100% |=========================| 35 kB 00:00 ---> Package virt-manager.i386 0:0.4.0-3.el5 set to be updated --> Running transaction check --> Processing Dependency: libvirt-python >= 0.2.1-1.el5 for package: virt-manager --> Processing Dependency: python-virtinst for package: xen --> Processing Dependency: python-virtinst >= 0.103.0 for package: virt-manager --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages. Please wait. ---> Downloading header for python-virtinst to pack into transaction set. python-virtinst-0.103.0-3 100% |=========================| 7.8 kB 00:00 ---> Package python-virtinst.noarch 0:0.103.0-3.el5 set to be updated ---> Downloading header for libvirt-python to pack into transaction set. libvirt-python-0.2.3-9.el 100% |=========================| 13 kB 00:00 ---> Package libvirt-python.i386 0:0.2.3-9.el5 set to be updated --> Running transaction check |
1 | Dependencies Resolved |
1 2 3 4 5 6 7 8 9 10 11 12 13 | ============================================================================= Package Arch Version Repository Size ============================================================================= Installing: Virtualization-en-US noarch 5.1.0-12 VT 1.4 M gnome-applet-vm i386 0.1.2-1.el5 VT 75 k kernel-xen i686 2.6.18-53.el5 Server 14 M libvirt i386 0.2.3-9.el5 VT 655 k virt-manager i386 0.4.0-3.el5 VT 1.3 M xen i386 3.0.3-41.el5 VT 1.9 M Installing for dependencies: libvirt-python i386 0.2.3-9.el5 VT 63 k python-virtinst noarch 0.103.0-3.el5 VT 63 k |
1 2 3 4 5 6 7 8 | Transaction Summary ============================================================================= Install 8 Package(s) Update 0 Package(s) Remove 0 Package(s) <code> Total download size: 20 M Is this ok [y/N]: |
–> y
klo udah selesai.
edit grub.conf, set boot nya ke kernel-xen
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu <strong>title Red Hat Enterprise Linux Server (2.6.18-53.el5xen) root (hd0,0) kernel /xen.gz-2.6.18-53.el5 module /vmlinuz-2.6.18-53.el5xen ro root=/dev/GLSvg/GLSroot rhgb quiet module /initrd-2.6.18-53.el5xen.img </strong> title Red Hat Enterprise Linux Server (2.6.18-53.el5) root (hd0,0) kernel /vmlinuz-2.6.18-53.el5 ro root=/dev/GLSvg/GLSroot rhgb quiet initrd /initrd-2.6.18-53.el5.img |
Setelah itu restart komputernya. Dan pastikan bootingnya ke kernel-xen.
Sekarang kita install OS virtualnya.
Oh iya..yang saya buat ini paravirtualisasi.
Disini saya untuk menginstallnya menggunakan command virt-install
1 2 3 4 5 6 | [root@ldap ~]# virt-install What is the name of your virtual machine? adit-virt How much RAM should be allocated (in megabytes)? 256 What would you like to use as the disk (path)? /dev/virtvg/lvadit Would you like to enable graphics support? (yes or no) no What is the install location? ftp://server1/pub/ |
jika path ftpnya benar, guest os akan langsung booting.
nanti akan ada tampilan installnya seperti ini.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | +---------+ Choose a Language +---------+ | | | What language would you like to use | | during the installation process? | | | | Catalan ^ | | Chinese(Simplified) : | | Chinese(Traditional) # | | Croatian : | | Czech : | | Danish : | | Dutch : | | English v | | | | +----+ | | | OK | | | +----+ | | | | | |
+—————————————+
/ between elements | selects | next screen

Guest OS siap di install. Lakukan seperti install biasa..
Setelah selesai.

pilih exit ketika ada pilihan ini

guest OS siap digunakan..

Gambar di atas menggambarkan kita sedang ada di console os guest.
Untuk keluar dari console guest tekan ctrl+]
Untuk masuk ke console guest lagi dengan xm console [nama virtual mesin]
Untuk lengkapnya silahkan lihat xm --help
Semoga bermanfaat ... ^_^
Referensi
http://kb.redhat.com/faq/docs/DOC-9959
