慧9建 发表于 2017-6-25 09:04:23

虚拟化H搭建

  虚拟化H搭建
  H搭建所需要的硬件配置
最大值:所有组件不能超过160个cpu
按安装H需要2G内存+若干个guest(不明确多大),最大支持2个TB内存
最小磁盘2G
一个千兆网卡
lscpu信息
# 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
  $ ssh root@classroom.example.com
# cd /var/www/html/
# ls
contentmaterialspubrh_survey
# cd content/
boot/      ks/      rhel6.6/   rhel7.1/   rhtops/
courses/   manifests/ rhel7.0/   rhev3.5/   slides/
# cd content/rhev3.5/
# ls
x86_64
# cd x86_64/
# ls
dvdextrasisosvms
# cd 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-rpmsrhel-7-server-rpms
# cd rhel-7-server-rhevh-rpms/
# ls
20150429Packagesrepodata
# cd Packages/   下面的前2个包为驱动,后面一个为镜像包
# 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
# mkdir /zlm
# cp rhev-hypervisor7-7.1-20150420.0.el7ev.noarch.rpm/zlm/
# cd /zlm/
# ls
rhev-hypervisor7-7.1-20150420.0.el7ev.noarch.rpm
# rpm2cpio rhev-hypervisor7-7.1-20150420.0.el7ev.noarch.rpm| cpio -imd   解压安装包并非安装
493570 blocks
# ls
rhev-hypervisor7-7.1-20150420.0.el7ev.noarch.rpmusr
# cd usr/
# ls
share
# cd share/
# ls
rhev-hypervisor
# cd 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
# cp rhevh-7.1-20150420.0.el7ev.iso /root/
c# cd /root/
# ls
anaconda-ks.cfgcacert.p12               ldap
bin            classroom-config-post.logrhevh-7.1-20150420.0.el7ev.iso
ca-agent.p12   DHCP-ranges.txt            selinux_modules
# mkdir /zzz
# mount -o loop rhevh-7.1-20150420.0.el7ev.iso /zzz/
mount: /dev/loop0 is write-protected, mounting read-only   将镜像文件挂在到/zzz
# df -h
Filesystem                                  SizeUsed Avail Use% Mounted on
/dev/vda1                                    10G4.6G5.5G46% /
devtmpfs                                    904M   0904M   0% /dev
tmpfs                                       921M   84K921M   1% /dev/shm
tmpfs                                       921M   17M904M   2% /run
tmpfs                                       921M   0921M   0% /sys/fs/cgroup
172.25.254.250:/content                     494G   29G466G   6% /content
172.25.254.250:/content/rhev3.5/x86_64/dvd4.3G4.3G   0 100% /content/rhev3.5/x86_64/dvd
/dev/loop0                                  241M241M   0 100% /zzz
# cd /zzz/
# ls
EFIisolinuxLiveOS
# cd LiveOS/
# ls
livecd-iso-to-disklivecd-iso-to-pxebootosmin.imgsquashfs.img
# cp livecd-iso-to-* /root/
# cd /root/
# ls
anaconda-ks.cfgclassroom-config-post.loglivecd-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
# ./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.png
1、创建虚拟机
2、选择EXP模式
Forward



2.png  1、Linux
2、选择7.0版本
Forward




3.png
1、4096内存
2、双核
Forward



4.png
1、硬盘50G
Forward  下面的配置对应serverb做参照




5.png
1、H机host主机名
2、勾选
3、选择vnet0
4、make地址
finish



6.png
1、虚拟化的真机



7.png
1、物理接口
Begin installation



8.png
1、选择Install RHEV Hypervisor 7.1启动  启动后:




9.png
回车



10.png  回车




11.png  1、在本行空格下,前面就会出现一个X说明勾选
Continue




12.png
Continue



13.png
Continue



14.png
1、验证admin用户的密码
Install
过后就会加载硬盘并会重启机器  重启后:




15.png
1、输入admin用户和密码



16.png
1、选到Network
2、主机名为:servera.pod0.example.com
3、DNS:172.25.254.254
4、NTP:172.25.254.254
Save



17.png
加载完成后就
Close



18.png
1、选中eth0回车



19.png
1、选择static静态地址
2、IP地址:172.25.0.10
3、子网:255.255.255.0
4、网关:172.25.0.254



20.png
加载完成后
Close



21.png
1、选择RHEU-M
2、将rhevm.pod0.example.com发布给M就进行管理
3、输入root用户密码
Save & Register
Accept



22.png
加载完成后
Close



23.png
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用户,并重启起虚拟化
# 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
# /etc/init.d/ovirt-engine restart
Stopping oVirt Engine:                                    
Starting oVirt Engine:                                    
  进网页访问rhevm.pod0.example.com就可以登陆查看
首先rhcevadmin登陆是没有权限的,是先要用admin管理员用户管理登陆在右上角有个设置下系统权限内添加以域搜索勾上RHEV用户分配SuperUser权限确定就可以登陆了




24.png  1、添加后就会有一个RHEV Admin用户




25.png  1、登陆rhevadmin用户
2、选择example.com域登陆




26.png  1、登陆成功后就会在机主下多一个刚刚做的PC
  以上实验只是对一个PC,以后在企业会面对多个PC,就可以上须方法对应M,就可以在M上批量管理每一台PC。
页: [1]
查看完整版本: 虚拟化H搭建