RH133读书笔记(10)-Lab 10 Exploring Virtualization

本文详细介绍了如何安装Xen虚拟化环境,并通过yum命令完成安装必要的包;接着编辑grub配置文件使系统默认启动Xen内核;最后使用virt-manager创建并管理Domain-U类型的虚拟机,包括配置虚拟机参数、启动和运行虚拟系统的过程。

Lab 10 Exploring Virtualization

Goal: To explore the Xen virtualization environment and the creation of a Domain-U virtual machine.

Sequence 1: Installing the Xen Virtualization Environment

Deliverable: A Red Hat Enterprise Linux system running the Xen virtualization environment.

Instructions:

1. Using yum, install the packages needed to set up the Xen virtualization environment:
kernel-xen, xen, and virt-manager. Do not forget to configure yum since we just re-installed our system.

cd /etc/yum.repos.d/
wget http://server1/pub/gls/server1.repo
yum -y install kernel-xen xen virt-manager

2. Edit the grub.conf file to make the xen kernel boot by default.

a. If the Xen kernel is the first kernel listed in /boot/grub/grub.conf, then edit that file to set default=0.

3. Reboot to the xen kernel.Verify that the kernel name has "xen" in it using the uname command.

a. [root@stationX]# reboot

Note that several item mays fail including kdump and Intel microcode.

b. [root@stationX]# uname -r

2.6.18-8.el5xen

Sequence 2: Creating a Domain-U Virtual Machine

Deliverable: A Domain-U virtual machine running Red Hat Enterprise Linux

Instructions:

1. Using virt-manager create a new virtual machine using the following configuration information:

a. System Name: vm1
b. Install Media URL: ftp://server1/pub
c. Kickstart URL: ftp://server1/pub/gls/vm1.cfg
d. VM Max Memory: 256 MB
e. VCPUS: 1
f. Simple File with File Location: /var/lib/xen/images/vm1.img

To create the new virtual machine, do the following:

a. Run the Virtual Machine Manager.

[root@stationX]# virt-manager

b. When the Open Connection dialog appears, select Local Xen host and click Connect.

c. The Virtual Machine Manager window will open. Start the new virtual system
wizard by selecting New Machine... from the File menu. Click Forward.

d. For System Name enter vm1 and click Forward.

e. Select Paravirtualized and click Forward.

f. For Install Media URL enter ftp://server1/pub. For Kickstart URL enter
ftp://server1/pub/gls/vm1.cfg. Click Forward.

g. Select Simple File, enter /var/lib/xen/images/vm1.img as the File Location, and set the File Size to 2000 MB. Click Forward.

h. Set VM Max Memory and Vm Startup Memory to 256 MB and the number of VCPUs to 1. Click Forward.

i. Review the summary screen and click Finish to boot and kickstart the new virtual machine.

j. A new New Keyring Password dialog will open. Enter redhat as the password. Click OK.

k. A window will open and a text kickstart install will run. When the installation finishes, select Reboot in the virtual machine's window.

Sequence 3: Starting and Managing Domain-Us

Scenario: It is now time to boot up the newly created virtual system by using the xm create command.

Deliverable: The new virtual system it up and running.

Instructions:

1. Use the xm create command to boot up the newly-created virtual system.

a. [root@stationX]# xm create vm1

2. Once vm1 is up, login and find your IP address.

a. [root@stationX]# xm console vm1

b. Login as root.

c. [root@vm1]# ip a
inet 192.168.0.Y

3. In another terminal window ping vm1 domain and leave the ping running.

In your original terminal window pause and unpause the vm1 domain. Note that it stops responding to pings when it is paused and starts as soon as it is unpaused.

a. In a separate terminal:

[root@stationX]# ping 192.168.0.Y

b. [root@stationX]# xm pause vm1

c. [root@stationX]# xm list

Name ID Mem(MiB) VCPUs State Time(s)
Domain-0 0 736 1 r----- 353.6
vm1 4 256 1 --p--- 13.6

d. [root@stationX]# xm unpause vm1

4. Close the Virtual Machine Manager.

转载于:https://www.cnblogs.com/thlzhf/p/3476838.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值