|
一:安装环境
CentOS6.5 内核版本:2.6.32-431.el6.x86_64 VMware-Workstation
二:xen的安装使用
1
2
| [iyunv@node1 ~]# cat /proc/cpuinfo |grep flag
flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc up arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt hypervisor lahf_lm arat epb xsaveopt pln pts dts
|
出现‘pae’表示cpu支持半虚拟化。
1
2
3
4
| [iyunv@node1 ~]#yum install centos-release-xen
[iyunv@node1 ~]#yum update
[iyunv@node1 ~]#yum install xen -y (修改了/etc/grub.conf)
[iyunv@node1 ~]#yum install libvirt virt-manager (libvirt 是一个服务)
|
安装xen后grub信息已经被修改了(xen4.4.2自动修改了grub的信息,不用手动修改)
由于Dom0只能运行于2.6.37以后的版本,因此安装xen的同时自动地安装了3.10.68的内核版本。kernel用的是xen而我们新安装的内核被当作模块来运行了。
装完重启后就会发现系统启动的是xen的内核。
[iyunv@node1 xen]# cat /proc/xen/capabilities
control_d
出现control_d表示我们的xen已经可以正常使用。
三:安装DomU
安装xen的DomU,我们可以使用三种方式安装,nfs,ftp,http,这里使用nfs方式安装;
现将CentOS6.5的系统盘挂载指系统:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| [iyunv@node1 ~]#mount /dev/cdrom /media/cdrom
[iyunv@node1 ~]#mkdir /mnt/centos/
[iyunv@node1 ~]#cp -r /media/cdrom/* /mnt/centos/
[iyunv@node1 ~]#chmod 777 /mnt/centos/.treeinfo
[iyunv@node1 ~]#vim /mnt/centos/.treeinfo 为如下:
[general]
family = CentOS
timestamp = 1385726532.68
variant =
totaldiscs = 1
version = 6.5
discnum = 1
packagedir =
arch = x86_64
[images-x86_64]
initrd = images/pxeboot/initrd.img
[images-xen]
kernel = images/pxeboot/vmlinuz //增加这一行
initrd = images/pxeboot/initrd.img
[stage2]
mainimage = images/install.img
|
安装nfs服务并挂载
1
2
3
4
5
6
| [iyunv@node1 ~]#yum install nfs-utils -y (3.10.68启动nfs的时候直接使用service nfs start)
[iyunv@node1 ~]#echo '/mnt/centos/ *(ro)'>>/etc/exports
[iyunv@node1 ~]service nfs start
[iyunv@node1 centos]# showmount -e localhost
Export list for localhost:
/mnt/centos *
|
以上说明nfs安装成功。
安装DomU命名为Dom2:
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
| [iyunv@node1 ~]# virt-install -n Dom2 -r 512 --vcpus=1 --prompt --disk path=/dev/sdb --nographics -l nfs:10.43.2.11:/mnt/centos/ 我们将Dom2安装在另一块硬盘/dev/sdb上。
1. Starting install...
Retrieving file .treeinfo... | 616 B 00:00 ...
Retrieving file vmlinuz... | 7.9 MB 00:00 ...
Retrieving file initrd.img... | 64 MB 00:08 ...
Creating domain... | 0 B 00:03
Connected to domain Dom2
Escape character is ^]
Initializing cgroup subsys cpuset
………
Greetings.
anaconda installer init version 13.21.215 starting
mounting /proc filesystem... done
Welcome to CentOS for x86_64
┌────────┤ Choose a Language ├────────┐
│ │
│ What language would you like to use │
│ during the installation process? │
│ │
│ Catalan ↑ │
│ Chinese(Simplified) │
│ Chinese(Traditional) │
│ Croatian │
│ Czech │
│ Danish │
│ Dutch │
│ English ↓ │
│ │
│ ┌────┐ │
│ │ OK │ │
│ └────┘
出现上边信息安装普通的安装操作系统走下去即可。
|
网桥配置管理工具安装:(最小化安装的CentOS6.x需要此操作)
1
| yum install -y bridge-utils
|
启动xend与libvirt并让其开机自启动
1
2
3
4
| service xend start
service libvirt start
chkconfig xend on
chkconfig libvirt on
|
至此我们的xen中的Dom2已经安装完成。
本篇介绍了xen以及DomU的安装,下篇我们将介绍xen中的网络配置。
|
|
|
|
|
|
|