虚拟化M搭建及基本操作

虚拟化MH搭建

虚拟化概念:

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

RHEVM:负责管理角色

RHEVH:负责运算角色

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

hypervisor:

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

2016-09-23_0-53-19.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架构图:

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环境内[[email protected] ~]为真实机,[[email protected] ~]为M机

[[email protected] ~]# 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]

[[email protected] ~]# yum repolist 查看您拥有的仓库

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

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

[[email protected] ~]# 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条命令

[[email protected] ~]# engine-

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

engine-cleanup engine-iso-uploader engine-setup

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

[[email protected] ~]# rhevm-

rhevm-cleanup rhevm-iso-uploader rhevm-setup

rhevm-config rhevm-log-collector rhevm-shell

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



登陆admin管理员用户和日记查看

****在图形化配置后不需要重新启动

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

查看admin的信息

[[email protected] ~]# 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

[[email protected] ~]# engine-config -g AdminPassword

AdminPassword: Set version: general

上面2条都可以查看admin信息

修改admin用户的密码

[[email protected] ~]# engine-config -s(修改密码) AdminPassword=interactive(本地)

[[email protected] ~]# /etc/init.d/ovirt-engine restart 重启服务

Stopping oVirt Engine: [ OK ]

Starting oVirt Engine: [ OK ]

同步时间服务

[[email protected] ~]# service ntpd stop

Shutting down ntpd: [ OK ]

[[email protected] ~]# ntpdate classroom.example.com

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

[[email protected] ~]# /etc/init.d/ovirt-engine restart

Stopping oVirt Engine: [ OK ]

Starting oVirt Engine: [ OK ]

[[email protected] ~]# service ntpd restart

Shutting down ntpd: [FAILED]

Starting ntpd: [ OK ]

[[email protected] ~]# hwclock --systohc 将时间跟bios时间同步及更新内核

日记查询

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

[[email protected] 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

[[email protected] 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 [email protected] 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 文件发送给官方帮助解决,前提你需要购买红帽的服务



用户管理与添加

[[email protected] ~]#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 [email protected] 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

[[email protected] ~]# /etc/init.d/ovirt-engine restart

Stopping oVirt Engine: [ OK ]

Starting oVirt Engine: [ OK ]

1.png

1、刚创建的rhevadmin用户

2、rhevadmin密码

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

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

2.png

1、admin管理员用户登陆

2、选择interactive本地登陆

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

3.png

1、已经添加了rhevadmin用户

2、给用户分配SuperUse

在用rhevadmin用户登陆就可以登陆成功

4.png

1、成功登陆rhevadmin用户

时间: 2024-08-29 17:49:54

虚拟化M搭建及基本操作的相关文章

exsi5.5上KVM二次虚拟化环境搭建

exsi5.5上KVM二次虚拟化环境搭建 1)  在exsi5.5上创建虚拟机centos(具体步骤省略) 2)  开启exsi5.5的ssh功能 ①  用exsi5.5的客户端连接exsi5.5服务器端.点击exsi5.5物理机->配置选项卡->安全配置文件->服务的"属性". ②  选中ssh服务,点击"选项"->选择"手动启动或停止"->启动->确定->确定. 3)  ssh登录exsi5.5 4)

V-1-1 Vmware桌面虚拟化环境搭建之ESXi安装与配置

首先将刻录好的优盘(光盘)插入服务器,并且在启动选项中选中对应的设备. 如何刻录请参考文档:O-4 ISO的刻录 如图所示,将会自动进入安装进度条 当进度条读取完毕后,可以看到黑黄相间的画面,其中会显示安装的版本,如图为5.5版本. 在加载界面加载完毕后会出现如下画面,根据提示按回车键"继续". (HP的服务器将会询问你是否同意EULA,选择同意,不同意将退出安装.) 接下来进入安装区域的选项,(如图我会将系统安装在阵列中,选择第二个,而不是U盘中.) 下一步将询问所需安装的语言,(这

部署KVM虚拟化平台------搭建

一 .部署KVM虚拟化平台 hyper-v是windows中的虚拟化1.KVM模块直接整合在Linux内核中,kvm是内核模块,虚拟机与kvm模块之间为管理工具2.KVM组成1.KVM Driver---虚拟机创建---虚拟机内存分配---虚拟CPU寄存器读写---虚拟CPU运行 2.QEMU (经过简化与修改)---模拟PC硬件的用户控件组件---提供I/O设备模型及访问外设的途径 二.虚拟化的三种模式 **1.客户模式:典型的虚拟机环境(虚拟网卡.内存.硬盘): 2.用户模式:工具层,下面是

kvm虚拟化平台搭建入门

KVM虚拟化有两种网络模式:1)Bridge网桥模式2)NAT网络地址转换模式Bridge方式适用于服务器主机的虚拟化.NAT方式适用于桌面主机的虚拟化. 环境: 本次实验要开启VMWare中对应CentOS6.5虚拟机的虚拟化功能--在虚拟机设置--处理器--虚拟化引擎--勾选虚拟化Intel VT-x/EPT 或 AMD-V/RVI(V) 1.安装方式图形化安装CentOS6.5--采用最小化安装系统--选择桌面安装--选择虚拟化选项 2,安装kvm所需软件 [[email protecte

redhat 6.4 虚拟化平台搭建千万PV架构

前段通过HAproxy做反向代理,实现内部网站数据的访问 内部使用varnish做缓存服务器实现动静分离,将动态数据负载到2台tomcat,静态数据代理到nginx服务器处理 对于2台tomcat服务器实现基于session的共享集群 tomcat服务器的数据存储到mysql集群中 nginx用于处理静态文件,反代用户图片的请求道MFS 架构集群运行在redhat 6.4 企业版 KVM虚拟化平台上

kvm虚拟化平台搭建

一.虚拟化 虚拟化是指计算机元件在虚拟的基础上而不是真实的基础上运行.虚拟化技术可以扩大硬件的容量,简化软件的重新配置过程.CPU的虚拟化技术可以单CPU模 拟多CPU并行,允许一个平台同时运行多个操作系统,并且应用程序都可以在相互独立的空间内运行而互不影响,从而显著提高计算机的工作效率. 物理机我们一般称为宿主机(Host),宿主机上面的虚拟机称为客户机(Guest).那么 Host 是如何将自己的硬件资源虚拟化,并提供给 Guest 使用的呢?这个主要是通过一个叫做 Hypervisor 的

Kvm虚拟化——基础搭建

1.物理机的系统安装(硬盘为300G+300G): centos6.5 64位,不安装桌面环境,默认运行级别为3 分区: /boot 128M swap 8G / 20G /data1  第一块硬盘剩余空间 /data2  第二块硬盘全部空间 采用最小化安装+以下软件包: BaseSystem -- Base Development-- Development tools 要配置好dns 确定系统时间与北京时间同步 服务器要允许命令重启(自动完成),若需要自检,人手按F1,请去掉机器自检) bi

SVN服务器环境搭建和基本操作(ubuntu版)

1.首先安装SVN这个软件 apt-get install subversion 2.在home目录下创建一个名为svn的文件夹(文件夹的名字随便起) mkdir /home/svn 3.创建数据仓库(可以根据需要创建多个) svnadmin create /home/svn/test 4.启动svn网络服务 svnserve -d -r /home/svn 其中 -d 参数让 svnserve 运行在后台,-r 参数限定了数据仓库,在网络上可以访问的地址. /home/svn指定svn数据仓库

虚拟化之容器docker基本操作

docker 是一个开源的应用容器引擎,主要利用 linux 内核 namespace 实现沙盒隔离,用cgroup 实现资源限制. Docker 支持三种不同的镜像层次存储的 drivers: aufs.devicemapper.btrfs ; Aufs: AUFS (AnotherUnionFS) 是一种 Union FS, 简单来说就是支持将不同目录挂载到同一个虚 拟 文 件 系 统 下 (unite several directories into a single virtual fi