可用服务器:内网机器172.16.1.15

服务器配置:16cpu E5620 ;内存:48G;硬盘500G

测试环境要求:

IP范围172.16.1.101---172.16.1.130

每台测试机的安装环境

Centos6.3

线上测试机的平台采用的kvm搭建:

1.       我们线上测试机标准配置:

1cpu

2G内存

20G硬盘(如部分开发人员有需要,可以扩展)

两块网卡(1网段和2网段)

 

2.       基础安装:

首先配置桥接网卡,网上有现成的脚本可以使用,这个是我在之前测试convirt时发现的,实际上是convirt的环境配置工具。

先将工具包下载下来下

wget  http://www.convirture.com/downloads/convirture-tools/2.0.1/convirture-tools-2.0.1.tar.gz

然后解压软件包吧

# tar zxvf convirture-tools-2.0.1.tar.gz

# /root/convirture-tools/install/managed_server/scripts/convirt-tool --bridge setup

执行完毕,ifconfig,查看你的虚拟网卡br

以下是我实现wget好的网络安装的镜像

# ls /root/CentOS-6.3-x86_64-netinstall.iso

# mount -t iso9660  CentOS-6.3-x86_64-netinstall.iso /media/ -o loop

创建虚拟磁盘

#cd /data/kvm

# qemu-img create -f raw test101.img 20G

#virt-install --name=test101 --ram=2048 --vcpus 1 -l /media/ --disk /data/kvm/test101.img  --force --network bridge=br1 --network bridge=br2 --hvm --prompt --extra-args "console=tty0 console=ttyS0,115200n8"

一般会提示ERROR    Cannot get interface MTU on 'br2': No such device这时你要确保你的桥接网卡有两块,即br1、br2,若需求是一块网卡,可只加一个network参数

进入安装选项

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 │                │

                    │               └────┘                │

                    │                                     │

                    │                                     │

                    └─────────────────────────────────────┘

 

  <Tab>/<Alt-Tab> between elements  | <Space> selects | <F12> next screen

继续

         ┌───┤ Installation Method ├───┐                         

                        │                             │                         

                        │ What type of media contains │                         

                        │ the installation p_w_picpath?     │                         

                        │                             │                         

                        │        Local CD/DVD         │                         

                        │        Hard drive           │                         

                        │        NFS directory        │                         

                        │        URL                  │                         

                        │                             │                         

                        │   ┌────┐       ┌──────┐     │                         

                        │   │ OK │       │ Back │     │                         

                        │   └────┘       └──────┘     │                         

                        │                             │                         

                        │                             │                         

                        └─────────────────────────────┘                         

                                                                

此处你可以按需求选择,如标题所示,此处采用网络安装,所以选择URL

然后进入网卡设置选项,需要声明的是你要确保你的虚拟服务主机是能够连接网络的,设置你的网卡模式,确保虚拟网卡连接网络

如我设置

IPv4 address: 172.16.1.232____ / 255.255.255.0___              │       

       │ Gateway:      172.16.1.1_______________________________        │       

       │ Name Server:  8.8.8.8__________________________________        │       

       │                                                                │       

       │             ┌────┐                        ┌──────┐             │       

       │             │ OK │                        │ Back │             │       

       │             └────┘                        └──────┘         进入你的网络安装源设置

 

        ┌────────────────────────┤ URL Setup ├─────────────────────────┐        

        │                                                              │        

        │          Please enter the URL containing the CentOS          │        

        │          installation p_w_picpath on your server.                  │        

        │                                                              │        

        │ http://mirrors.163.com/centos/6.3/os/x86_64/________________ │        

        │                                                              │        

        │ [ ] Enable HTTP proxy                                        │        

        │                                                              │        

        │ Proxy URL        ___________________________________         │        

        │ Username         _______________                             │        

        │                                                              │        

        │ Password         _______________                             │        

        │                                                              │        

        │            ┌────┐                       ┌──────┐             │        

        │            │ OK │                       │ Back │             │        

        │            └────┘                       └──────┘             │        

        │                                                              │        

        │                                                              │        

        └──────────────────────────────────────────────────────────────┘       我采用的是http://mirrors.163.com/centos/6.3/os/x86_64/   注意这里不是网络镜像,是读取的网络文件

进入安装等待完成

\更多安装设置选项virt-install --help查看

完成安装重启