Xen installation, configuration, use and problems and solutions in Redhat-el5_x86_64

Source: Internet
Author: User

Xen installation, configuration, use and problems and solutions in Redhat-el5_x86_64

1. Configure and install xen 1) first install the kernel package:

[Root @ localhost ~] # Yum-y install kernel-xen.x86_64
[Root @ localhost ~] # Yum-y install xen-libs.x86_64
2) Next, modify the boot Kernel configuration file/etc/grub. conf to enable the system to boot the xen kernel.

After kernel-xen is installed, the following content will appear in the/etc/grub. conf file:
# Grub. conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# Notice: You have a/boot partition. This means that
# All kernel and initrd paths are relative to/boot/, eg.
# Root (hd0, 0)
# Kernel/vmlinuz-version Ro root =/dev/volgroup00/logvol00
# Initrd-version.img/initrd
# Boot =/dev/hda
Default = 1
Timeout = 5
Splashimage = (hd0, 0)/GRUB/splash.xpm.gz
Hiddenmenu
Title Red Hat Enterprise Linux Server (2.6.18-8. el5xen)
Root (hd0, 0)
Kernel/xen.gz-2.6.18-8. EL5
Module/vmlinuz-2.6.18-8.el5xen Ro root =/dev/volgroup00/logvol00 rhgb quiet
Module/initrd-2.6.18-8.el5xen.img

Title Red Hat Enterprise Linux Server (2.6.18-8. EL5)
Root (hd0, 0)
Kernel/vmlinuz-2.6.18-8.el5 Ro root =/dev/volgroup00/logvol00 rhgb quiet
Initrd/initrd-2.6.18-8.el5.img
Change "default = 1" to "default = 0"

3) restart the computer

[Root @ localhost ~] # Reboot
4) after the system is restarted, install and manage the Virtual Machine package. I use yum for Installation

[Root @ localhost ~] # Yum-y install libvirt. x86_64
# Install the xen Service
[Root @ localhost ~] # Yum-y install xen. x86_64
[Root @ localhost ~] # Yum-y install xen-devel.x86_64
Add xen service to self-starting script
[Root @ localhost ~] # Chkconfig -- add xend
[Root @ localhost ~] # Chkconfig -- level 345 xend on
Start xen Service
[Root @ localhost ~] #/Etc/init. d/xend start
Starting xend: [OK]
2. Configure to start a VM. 1) Prepare the installation source.

Xen supports multiple domain installation methods, including NFS file service, HTTP File Service, and FTP service. The following configuration is an FTP-based installation source. The premise is to prepare the OS ISO image. Put it in a directory such as/home/liws/software/redhat-el5.iso.
[Root @ localhost ~] #/Etc/init. d/vsftpd start # enable Anonymous FTP users
[Root @ localhost ~] # Mount-o loop/home/liws/software/redhat-el5.iso/var/FTP/pub/# mount the OS image to the FTP
2) use the XM command line to create a virtual machine:

[Root @ localhost ~] # Virt-install -- prompt (the parameter -- prompt is required for the new xen version, and the hard disk size parameter is set. This parameter is not set for the old version.
What is the name of your virtual machine? Domain1 # Virtual Machine name VM1
How much RAM shoshould be allocated (in megabytes )? 512 # allocate a minimum of 512 MB of memory to the VM
What wocould you like to use as the disk (file path )? /Data/vmtest/domain1.img # IMG storage location of virtual OS
How large wocould you like the disk (/data/vmtest/domain1.img) to be (in gigabytes )? 10 # imgfile size of virtual OS
What is the install URL? /Var/FTP/pub # OS boot file. Here, we only need to let xen find the OS boot, and then select the specific settings for installing the OS.
You can also enter:
Virt-install-N domain1-r 512 -- vcpus = 1-F/data/vmtest/domain1.img-S 10-P-l/var/FTP/pub -- nographics create and install domain. The parameters have the following meanings:
-N domain1, name
-R 512: allocate MB of memory to domain1
-- Vcpu = 1, allocate a virtual CPU
-F/data/vmtest/domain1.img: Specify the virtual disk file as/data/vmtest/domain1.img.
-S 10, the disk size is 8 GB
-P, using para semi-virtualization mode (because the CPU of this test machine does not support VT Technology)
-L/var/FTP/pub: Specifies the image installation location
-- Nographics: starts the character mode instead of the graphic mode.
If any problem occurs in the middle, run the XM console domain1 to go to the console mode and check the problem.
3) The following is the OS installation interface. Note that you must select FTP when installing the source. You can set the IP address and directory of the specific FTP server.

For more information about operating system installation, see laruence. Http://linux.vbird.org/linux_enterprise/xen.php#other_inst
3. Start a virtual machine

Run the xm create command on the command line to start the domain. For example, run the following command to boot the domain of the system just installed.
[Root @ localhost ~] # XM create domain1
After creating the domain, you can run the following command to access the installed OS.
[Root @ localhost ~] # XM console domain1
For the XM command, you can use the command: XM help to view it or find other information.
4. Enable Domain to automatically start with server startup

When the server is restarted, all domain names are automatically stopped. After the server is restarted, the domain will continue to be shut down instead of automatically starting. To enable the domain to start automatically, perform the following operations. domain1 is used as an example:
[Root @ localhost ~] # Ln-S/etc/xen/domain1/etc/xen/auto/domain1
This step links the domain configuration file to the auto directory. All domain in the auto directory will be automatically started as the server starts.
After that, you must set xendomains as a background service that is randomly started.
[Root @ localhost ~] # Chkconfig -- add xendomains
Restart the server and you will find that the domain named domain1 is also started with the server.
 
 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.