设为首页 收藏本站
查看: 1483|回复: 0

[经验分享] 虚拟化M搭建及基本操作

[复制链接]

尚未签到

发表于 2017-6-25 07:15:52 | 显示全部楼层 |阅读模式
  虚拟化MH搭建
  虚拟化概念:

虚拟机安装分为2块:RHEVM 、RHEVH

RHEVM:负责管理角色

RHEVH:负责运算角色


DSC0000.png

2016-09-23_0-52-54.png  hypervisor:

提供运算的机器,对应VMware ESXI的角色


DSC0001.png

2016-09-23_0-53-19.png

DSC0002.png

2016-09-23_0-51-35.png  虚拟化概念:单独能在单一的计算机上,能虚拟出多台虚拟机,且每台虚拟机能运行独立的操作系统,相互之间都是隔离的。
  系统虚拟化:单独能在单一的计算机上,能虚拟出多台虚拟机,且每台虚拟机能运行独立的操作系统,相互之间都是隔离的。

系统虚拟化分为:重量级虚拟化、轻量级虚拟化

重量级虚拟化:在底层都是消耗硬件及CPU、内存

轻量级虚拟化:应用程序虚拟化(docker)
  hypervisor:负责提供运算的机器,在实际生产环境中,这台机器是独立的,且应该拥有很多台机器,提供统一运算。

RHEV-M也可以是RHEV-H中的一台机器,同时能管理其他的H(host)。
  guest:运行在hypervisor中的虚拟机角色叫guest,真机叫host。
  virtualization type:

1.全虚拟化:

在物理机上直接部署虚拟化,且不需要修改内核的方式,叫完全虚拟化。

kernel-based virtual machine (KVM)

OS > rhel5.4 bit cpu full virtualzation

2.半虚拟化(paravirtualized)

需要修改操作系统内核,使其支持虚拟化,所以windows无法支持半虚拟化

3.本地虚拟化

通过软件厂商拦截内核发送的19条敏感指令集进行对操作系统的执行,达到         实现虚拟化效果的做法叫本地虚拟化。
  CPU架构图:


DSC0003.png

2016-09-23_0-53-41.png  MMU:内存管理单元,CPU中分层一个单元,负责把虚拟内存映射到物理内存。

inter中叫EPT

AMD中叫RVI
  VT-d直接虚拟化:很多时候我们的真实机8196的网卡被虚拟成e1000的网卡,如果有VT-d,那么虚拟化可以直接让虚拟机调用真实
  SR-IOV:多个虚拟化设备可以同时调用一个真实的硬件设备
  KVM:Qumranet(now part of Redhat),是从Ovirt开发形成的。
  Thick vs thin virtualization host:Thick,没有被定制过的虚拟化;thin,被定制过的虚拟化
  nx:防止缓冲区溢出的指令集
  ksm:相同内存页整合,当通过模板创建的虚拟机,调用同样的内存。(/sys/kernel/mm/ksm/pages_shared)
  VirtIO:在全虚拟化中添加半虚拟化驱动。

  虚拟化M安装

M的安装对硬件的需求:

最低配置:双核CPU、4G内存、25G硬盘、一根千兆网卡

标配配置:多个CPU、16G内存、50G 硬盘、一根千兆网卡
  在搭建M环境内[iyunv@foundation0 ~]为真实机,[iyunv@rhevm ~]为M机

[iyunv@rhevm ~]# wget http://classroom.example.com/materials/rhevm.repo -P /etc/yum.repos.d/        在真机下下载一个yum配置文件放在本地
  --2016-09-23 06:56:18--  http://classroom.example.com/materials/rhevm.repo

Resolving classroom.example.com... 172.25.254.254

Connecting to classroom.example.com|172.25.254.254|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 846

Saving to: “/etc/yum.repos.d/rhevm.repo”
  100%[======================================>] 846         --.-K/s   in 0s
  2016-09-23 06:56:18 (105 MB/s) - “/etc/yum.repos.d/rhevm.repo” saved [846/846]
  [iyunv@rhevm ~]# yum repolist      查看您拥有的仓库

[iyunv@rhevm ~]# yum -y update     升级所有包同时也升级软件和系统内核

[iyunv@rhevm ~]# yum -y install rhevm rhevm-dwh rhevm-reports   安装并配置RHEV-M,并长生报表页面使用。

[iyunv@rhevm ~]# engine-setup --generate answer=/root/answers.txt      配置RHEV-M的文件

[ INFO  ] Stage: Initializing

[ INFO  ] Stage: Environment setup

--== PRODUCT OPTIONS --

Configure Engine on this host (Yes, No) [Yes]: //回车

Configure Data Warehouse on this host (Yes, No) [Yes]: //回车

Configure Reports on this host (Yes, No) [Yes]://回车

Configure WebSocket Proxy on this host (Yes, No) [Yes]: //回车

Do you want Setup to configure the firewall? (Yes, No) [Yes]: no     不考虑防火墙

Host fully qualified DNS name of this server [rhevm.pod0.example.com]: //回车

-- DATABASE CONFIGURATION --

Where is the Reports database located? (Local, Remote) [Local]:

Setup can configure the local postgresql server automatically for the Reports to run. This may conflict with existing applications.

Would you like Setup to automatically configure postgresql and create Reports database, or prefer to perform that manually? (Automatic, Manual) [Automatic]:

Where is the DWH database located? (Local, Remote) [Local]:

Setup can configure the local postgresql server automatically for the DWH to run. This may conflict with existing applications.

Would you like Setup to automatically configure postgresql and create DWH database, or prefer to perform that manually? (Automatic, Manual) [Automatic]:

Where is the Engine database located? (Local, Remote) [Local]:

Setup can configure the local postgresql server automatically for the engine to run. This may conflict with existing applications.

Would you like Setup to automatically configure postgresql and create Engine database, or prefer to perform that manually? (Automatic, Manual) [Automatic]:

-- OVIRT ENGINE CONFIGURATION ==--

Engine admin password:   这里使用admin用户的密码为redhat

Confirm engine admin password:     重复上面密码

[WARNING] Password is weak: it is based on a dictionary word

Use weak password? (Yes, No) [No]: yes   提示密码为弱口令

Application mode (Virt, Gluster, Both) [Both]:

      --== SYSTEM CONFIGURATION ==--
Configure an NFS share on this server to be used as an ISO Domain? (Yes, No) [Yes]:        ISO域配置,这里使用rhevm本机作为ISO域
Local ISO domain path [/var/lib/exports/iso]: /exports/rhevisos
Local ISO domain ACL - note that the default will restrict access to rhevm.pod0.example.com only, for security reasons [rhevm.pod0.example.com(rw)]:
Local ISO domain name [ISO_DOMAIN]: iso0
--== MISS CONFIGURATION ==--
Reports power users password:             报表的密码
Confirm engine admin password:     重复上面密码

  [WARNING] Password is weak: it is based on a dictionary word

Use weak password? (Yes, No) [No]: yes   提示密码为弱口令

Would you like transactions from the Red Hat Access Plugin sent from the RHEV Manager to be brokered through a proxy server?(Yes,No) [No]:

Please confirm installation settings(OK,Cancel) [OK]:

当上面的配置完成后,会跳出配置确认信息,确认完成后,会进行安装。
  在安装完成后就可以Tab出一下2条命令

[iyunv@rhevm ~]# engine-

engine-backup          engine-image-uploader  engine-manage-domains

engine-cleanup         engine-iso-uploader    engine-setup

engine-config          engine-log-collector   engine-upgrade-check

[iyunv@rhevm ~]# rhevm-

rhevm-cleanup         rhevm-iso-uploader    rhevm-setup

rhevm-config          rhevm-log-collector   rhevm-shell
  [iyunv@rhevm ~]# engine-setup --config-append=/root/answers.txt   调用answer进行配置做自动化(answer文件在制作engine-appliance时已经放到appliance中),采用离线模式rpm包已安装

  登陆admin管理员用户和日记查看
  ****在图形化配置后不需要重新启动

****在命令行每做一条命令都需要/etc/init.d/ovirt-engine restart重启

查看admin的信息

[iyunv@rhevm ~]# engine-config -a | grep -i(不区分大小写) admin

LocalAdminPassword: Set version: general

VmGracefulShutdownMessage: System Administrator has initiated shutdown of this Virtual Machine. Virtual Machine is shutting down. version: general

AdminPassword: Set version: general

[iyunv@rhevm ~]# engine-config -g AdminPassword

AdminPassword: Set version: general

上面2条都可以查看admin信息
  修改admin用户的密码

[iyunv@rhevm ~]# engine-config -s(修改密码) AdminPassword=interactive(本地)

[iyunv@rhevm ~]# /etc/init.d/ovirt-engine restart     重启服务

Stopping oVirt Engine:                                     [  OK  ]

Starting oVirt Engine:                                     [  OK  ]
  同步时间服务

[iyunv@rhevm ~]# service ntpd stop

Shutting down ntpd:                                        [  OK  ]

[iyunv@rhevm ~]# ntpdate classroom.example.com

22 Sep 19:54:13 ntpdate[2699]: adjust time server 172.25.254.254 offset 0.000242 sec

[iyunv@rhevm ~]# /etc/init.d/ovirt-engine restart

Stopping oVirt Engine:                                     [  OK  ]

Starting oVirt Engine:                                     [  OK  ]

[iyunv@rhevm ~]# service ntpd restart

Shutting down ntpd:                                        [FAILED]

Starting ntpd:                                             [  OK  ]

[iyunv@rhevm ~]# hwclock --systohc   将时间跟bios时间同步及更新内核
  日记查询

[iyunv@rhevm ~]# cd /var/log/ovirt-engine     目录下属于虚拟化的所有日记记录

[iyunv@rhevm ovirt-engine]# ls

boot.log     engine.log   ovirt-image-uploader  redhat-support-plugin-rhev.log

console.log  host-deploy  ovirt-iso-uploader    server.log

dump         notifier     ovirt-log-collector   setup

[iyunv@rhevm ovirt-engine]# engine-log-collector collect     虚拟化工具

This command will collect system configuration and diagnostic

information from this system.

The generated archive may contain data considered sensitive and its

content should be reviewed by the originating organization before

being passed to any third party.

No changes will be made to system configuration.

Please provide the REST API password for the admin@internal oVirt Engine user (CTRL+D to skip):    管理员密码

INFO: Gathering oVirt Engine information...

INFO: Gathering PostgreSQL the oVirt Engine database and log files from localhost...

INFO: No hypervisors were selected, therefore no hypervisor data will be collected.

Creating compressed archive...

INFO: Log files have been collected and placed in /tmp/sosreport-LogCollector-20160922200120.tar.xz.

The MD5 for this file is 3018b47832488ca60eb611d037f0dd08 and its size is 6.8M

当收集完后就会在/tmp/下生成一个sosrepot-LogCollector-当时时间编号.tar.xz   文件发送给官方帮助解决,前提你需要购买红帽的服务

  用户管理与添加

[iyunv@rhevm ~]#engine-manage-domains add --domain=example.com(添加到域) --user=rhevadmin (用户加入到域) --provider=IPA(指定文件)      添加一个域并将rhevadmin加入其中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  添加成功

You have mail in /var/spool/mail/root

[iyunv@rhevm ~]# /etc/init.d/ovirt-engine restart

Stopping oVirt Engine:                                     [  OK  ]

Starting oVirt Engine:                                     [  OK  ]


DSC0004.png

1.png  1、刚创建的rhevadmin用户

2、rhevadmin密码

3、刚才是以example.com这个域内创建的用户应该选择域模式

**当用户第一次登陆时后会提示权限不够,之后我们需要先用admin管理员登陆将这个用户加入其中并给与权限就可以登陆了。


DSC0005.png

2.png

1、admin管理员用户登陆

2、选择interactive本地登陆  先要用admin管理员用户管理登陆在右上角有个设置下系统权限内添加以域搜索勾上RHEV用户分配SuperUser权限确定


DSC0006.png

3.png  1、已经添加了rhevadmin用户

2、给用户分配SuperUse
  在用rhevadmin用户登陆就可以登陆成功


DSC0007.png

4.png  1、成功登陆rhevadmin用户

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-387805-1-1.html 上篇帖子: OpenStack虚拟云桌面在携程呼叫中心的应用 下篇帖子: Docker探索系列1之docker入门安装与操作
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表