虚拟化H搭建
H搭建所需要的硬件配置
最大值:所有组件不能超过160个cpu
按安装H需要2G内存+若干个guest(不明确多大),最大支持2个TB内存
最小磁盘2G
一个千兆网卡
lscpu信息
[root@serverb ~]# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 2
On-line CPU(s) list: 0,1
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 2
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 60
Model name: Intel(R) Core(TM) i7-4710MQ CPU @ 2.50GHz
Stepping: 3
CPU MHz: 2494.234
BogoMIPS: 4988.46
Virtualization: VT-x
Hypervisor vendor: KVM
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 4096K
NUMA node0 CPU(s): 0,1
[kiosk@foundation0 Desktop]$ ssh root@classroom.example.com
[root@classroom ~]# cd /var/www/html/
[root@classroom html]# ls
content materials pub rh_survey
[root@classroom html]# cd content/
boot/ ks/ rhel6.6/ rhel7.1/ rhtops/
courses/ manifests/ rhel7.0/ rhev3.5/ slides/
[root@classroom html]# cd content/rhev3.5/
[root@classroom rhev3.5]# ls
x86_64
[root@classroom rhev3.5]# cd x86_64/
[root@classroom x86_64]# ls
dvd extras isos vms
[root@classroom x86_64]# cd dvd/
[root@classroom dvd]# ls
jb-eap-6-for-rhel-6-server-rpms rhel-6-server-rpms
rhel-6-server-rhev-agent-rpms rhel-7-server-rh-common-rpms
rhel-6-server-rhevh-rpms rhel-7-server-rhevh-rpms
rhel-6-server-rhevm-3.5-rpms rhel-7-server-rhev-mgmt-agent-rpms
rhel-6-server-rhev-mgmt-agent-rpms rhel-7-server-rpms
[root@classroom dvd]# cd rhel-7-server-rhevh-rpms/
[root@classroom rhel-7-server-rhevh-rpms]# ls
20150429 Packages repodata
[root@classroom rhel-7-server-rhevh-rpms]# cd Packages/ 下面的前2个包为驱动,后面一个为镜像包
[root@classroom Packages]# ls
ovirt-node-plugin-vdsm-0.2.0-21.el7ev.noarch.rpm
ovirt-node-plugin-vdsm-recipe-0.2.0-21.el7ev.noarch.rpm
rhev-hypervisor7-7.1-20150420.0.el7ev.noarch.rpm
[root@classroom Packages]# mkdir /zlm
[root@classroom Packages]# cp rhev-hypervisor7-7.1-20150420.0.el7ev.noarch.rpm /zlm/
[root@classroom Packages]# cd /zlm/
[root@classroom zlm]# ls
rhev-hypervisor7-7.1-20150420.0.el7ev.noarch.rpm
[root@classroom zlm]# rpm2cpio rhev-hypervisor7-7.1-20150420.0.el7ev.noarch.rpm | cpio -imd 解压安装包并非安装
493570 blocks
[root@classroom zlm]# ls
rhev-hypervisor7-7.1-20150420.0.el7ev.noarch.rpm usr
[root@classroom zlm]# cd usr/
[root@classroom usr]# ls
share
[root@classroom usr]# cd share/
[root@classroom share]# ls
rhev-hypervisor
[root@classroom share]# cd rhev-hypervisor/
[root@classroom rhev-hypervisor]# ls 下面有一个rhevh-7.1.-20150420.0.el7ev.iso 镜像文件
rhevh-7.1-20150420.0.el7ev.iso version-7.1-20150420.0.el7ev.txt
vdsm-compatibility-7.1-20150420.0.el7ev.txt
[root@classroom rhev-hypervisor]# cp rhevh-7.1-20150420.0.el7ev.iso /root/
c[root@classroom rhev-hypervisor]# cd /root/
[root@classroom ~]# ls
anaconda-ks.cfg cacert.p12 ldap
bin classroom-config-post.log rhevh-7.1-20150420.0.el7ev.iso
ca-agent.p12 DHCP-ranges.txt selinux_modules
[root@classroom ~]# mkdir /zzz
[root@classroom ~]# mount -o loop rhevh-7.1-20150420.0.el7ev.iso /zzz/
mount: /dev/loop0 is write-protected, mounting read-only 将镜像文件挂在到/zzz
[root@classroom ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 10G 4.6G 5.5G 46% /
devtmpfs 904M 0 904M 0% /dev
tmpfs 921M 84K 921M 1% /dev/shm
tmpfs 921M 17M 904M 2% /run
tmpfs 921M 0 921M 0% /sys/fs/cgroup
172.25.254.250:/content 494G 29G 466G 6% /content
172.25.254.250:/content/rhev3.5/x86_64/dvd 4.3G 4.3G 0 100% /content/rhev3.5/x86_64/dvd
/dev/loop0 241M 241M 0 100% /zzz
[root@classroom ~]# cd /zzz/
[root@classroom zzz]# ls
EFI isolinux LiveOS
[root@classroom zzz]# cd LiveOS/
[root@classroom LiveOS]# ls
livecd-iso-to-disk livecd-iso-to-pxeboot osmin.img squashfs.img
[root@classroom LiveOS]# cp livecd-iso-to-* /root/
[root@classroom LiveOS]# cd /root/
[root@classroom ~]# ls
anaconda-ks.cfg classroom-config-post.log livecd-iso-to-pxeboot
bin DHCP-ranges.txt rhevh-7.1-20150420.0.el7ev.iso
ca-agent.p12 ldap selinux_modules
cacert.p12 livecd-iso-to-disk
[root@classroom ~]# ./livecd-iso-to-pxeboot rhevh-7.1-20150420.0.el7ev.iso 执行livecd-iso-to-pxeboot文件到iso,ivecd-iso-to-pxeboot就是一个脚本引导iso文件。
mount: /dev/loop1 is write-protected, mounting read-only
Your pxeboot image is complete.
Copy tftpboot/ subdirectory to /tftpboot or a subdirectory of /tftpboot.
Set up your DHCP, TFTP and PXE server to serve /tftpboot/.../pxeboot.0
Note: The initrd image contains the whole CD ISO and is consequently
very large. You will notice when pxebooting that initrd can take a
long time to download. This is normal behaviour.
提示Your pxeboot image is complete 就成功了
在以后布置还需要安装DHCP、TFTP、PXE server就可以自动引导安装
到现在H的引导就已经做完,接下来做的就是H的系统配置
1、创建虚拟机
2、选择EXP模式
Forward
1、Linux
2、选择7.0版本
Forward
1、4096内存
2、双核
Forward
1、硬盘50G
Forward
下面的配置对应serverb做参照
1、H机host主机名
2、勾选
3、选择vnet0
4、make地址
finish
1、虚拟化的真机
1、物理接口
Begin installation
1、选择Install RHEV Hypervisor 7.1启动
启动后:
回车
回车
1、在本行空格下,前面就会出现一个X说明勾选
Continue
Continue
Continue
1、验证admin用户的密码
Install
过后就会加载硬盘并会重启机器
重启后:
1、输入admin用户和密码
1、选到Network
2、主机名为:servera.pod0.example.com
3、DNS:172.25.254.254
4、NTP:172.25.254.254
Save
加载完成后就
Close
1、选中eth0回车
1、选择static静态地址
2、IP地址:172.25.0.10
3、子网:255.255.255.0
4、网关:172.25.0.254
加载完成后
Close
1、选择RHEU-M
2、将rhevm.pod0.example.com发布给M就进行管理
3、输入root用户密码
Save & Register
Accept
加载完成后
Close
1、选择Send Key下的Ctrl+Alt+F2就可以跳到命令行
进入命令行后用root用户登陆密码为redhat
cd /home/admin/
mkdir -p /config/usr/share/libvirt
wget http://classroom.example.com/materials/cpu_map.xml -P /config/usr/share/libvort 下载所有CPU厂商
echo "/usr/share/libvirt/cpu_map.xml" >> /config/files 将文件中CPU信息复制到file文件中
uuidgen -r > /etc/vdsm/vdsm.id 查找对应的信息生成一个vdsm.id 文件
现在所做的是在虚拟环境下,在真实环境就不需要做这
随后reboot重启
在M机中创建一个域,域下面有一个rhevadmin用户,并重启起虚拟化
[root@rhevm ~]# engine-manage-domains add --domain=example.com --user=rhevadmin --provider=IPA
Enter password:
The domain example.com has been added to the engine as an authentication source but no users from that domain have been granted permissions within the oVirt Manager.
Users from this domain can be granted permissions by editing the domain using action edit and specifying --add-permissions or from the Web administration interface logging in as admin@internal user.
oVirt Engine restart is required in order for the changes to take place (service ovirt-engine restart).
Manage Domains completed successfully
[root@rhevm ~]# /etc/init.d/ovirt-engine restart
Stopping oVirt Engine: [ OK ]
Starting oVirt Engine: [ OK ]
进网页访问rhevm.pod0.example.com就可以登陆查看
首先rhcevadmin登陆是没有权限的,是先要用admin管理员用户管理登陆在右上角有个设置下系统权限内添加以域搜索勾上RHEV用户分配SuperUser权限确定就可以登陆了
1、添加后就会有一个RHEV Admin用户
1、登陆rhevadmin用户
2、选择example.com域登陆
1、登陆成功后就会在机主下多一个刚刚做的PC
以上实验只是对一个PC,以后在企业会面对多个PC,就可以上须方法对应M,就可以在M上批量管理每一台PC。