转载于:https://blog.csdn.net/lpwmm/article/details/80021968
前两份笔记中记录的过程已经实现Engine和Node的初始环境准备及互联的工作,接下来就要开始在Engine的管理平台中对oVirt的各项资源进行配置,还得翻翻以前考RHCVA时候做的笔记,套路应该还是一样的,接着记录吧:
配置数据存储域
先放上来官方文档中对存储类型的介绍
Introduction to Storage
A storage domain is a collection of images that have a common storage
interface. A storage domain contains complete images of templates and
virtual machines (including snapshots), ISO files, and metadata about
themselves. A storage domain can be made of either block devices (SAN
- iSCSI or FCP) or a file system (NAS - NFS, GlusterFS, or other POSIX compliant file systems).There are three types of storage domain:
Data Domain: A data domain holds the virtual hard disks and OVF files
of all the virtual machines and templates in a data center, and cannot
be shared across data centers. Data domains of multiple types (iSCSI,
NFS, FC, POSIX, and Gluster) can be added to the same data center,
provided they are all shared, rather than local, domains.Important: You must have one host with the status of Up and have
attached a data domain to a data center before you can attach an ISO
domain and an export domain.ISO Domain: ISO domains store ISO files (or logical CDs) used to
install and boot operating systems and applications for the virtual
machines, and can be shared across different data centers. An ISO
domain removes the data center’s need for physical media. ISO domains
can only be NFS-based. Only one ISO domain can be added to a data
center.Export Domain: Export domains are temporary storage repositories that
are used to copy and move images between data centers and oVirt
environments. Export domains can be used to backup virtual machines.
An export domain can be moved between data centers, however, it can
only be active in one data center at a time. Export domains can only
be NFS-based. Only one export domain can be added to a data center.See the next section to attach existing FCP storage as a data domain.
More storage options are available in the Administration Guide.
主要就三种存储类型:Data Domain用来存放虚拟机的虚拟硬盘数据(可以使用iSCSI,NFS,FC等类型协议),ISO Domain用来存放虚拟机可以挂载的光盘镜像,Export Domain这个存储域主要是虚拟机在不同的数据中心或者oVirt环境中进行迁移,还有做虚机备份的时候才会用到(这个域只能用NFS协议)
因为这次实验用的环境是一台i3的PC当node,同时Engine是安装在VMware里面的一台虚机,手头暂时没法添加iSCSI之类的存储协议,所以决定用node上的本地硬盘跑NFS服务做Data Domain
SSH连接到node服务器上开始配置NFS服务
# yum install -y nfs-utils //安装nfs相关程序包
# mkdir /home/vmStorage //新建文件夹用来共享
# chown 36:36 /home/vmStorage //重要!!!必须将该文件夹所有者修改为vdsm和其对应的组kvm,默认编号都是36,否则在oVirt后台中将无法添加该存储域
chmod 755 /home/vmStorage //重要!!!权限设置同样至关重要,否则无法添加# vi /etc/exports //编辑配置文件,定义哪些目录需要通过NFS服务访问
# vi /etc/exports //编辑配置文件,定义哪些目录需要通过NFS服务访问
/home/vmStorage 0.0.0.0/0.0.0.0(rw,sync) //0.0.0.0/0.0.0.0不限制允许连接的客户端IP地址</pre><pre class="cpp prettyprint" name="code"># exportfs -a //使上面写的配置生效
service rpcbind start //启动NFS服务前必须先启动rpcbind服务
service nfs-server start //启动NFS服务
systemctl enable rpcbind nfs-server //设置服务开机自动启动
进入存储-域-新建域
配置ISO镜像存储域
同上面过程
# mkdir /home/ISO
chown 36:36 /home/ISO
chmod 755 /home/ISO
vi /etc/exports
/home/ISO 0.0.0.0/0.0.0.0(rw,sync,no_root_squash)
exportfs -a![](https://img-blog.csdn.net/20180420185615860?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xwd21t/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70)
添加成功后,用WinSCP向NFS服务器端/home/ISO/5d56c384-5e1c-46ee-a2aa-d4bedda4b6a2/images/11111111-1111-1111-1111-111111111111路径上传个ISO文件试一下,传完之后不需要再修改ISO文件的权限就可以用
网络配置
因为实验环境只有单网卡,并且本身node就已经在VLAN下面了,没办法模拟真实的生产环境设置VLAN逻辑网络,暂时先不做这块了,就使用默认的ovirtmgmt网络
创建虚拟机
激动人心的时刻终于到来了,刚才上传了一个Lubuntu的镜像,现在创建个虚拟机试一下
吐槽一下,这里的操作系统列表中对Ubuntu版本支持的好老啊,最新的也才Trusty Tahr(14.04),随便选一个就得了,nic用默认的ovirtmgmt网络,记得添加实例镜像(虚拟硬盘),这里需要注意的一个选项是图形界面协议,因为准备尝试一下noVNC管理,所以创建虚拟机的时候这里用VNC协议,其他设置看着自己弄
结果悲剧还是发生了…已确认websocket proxy服务运行正常,firewall关掉了,CA证书应该不至于,剩下的可能性应该就是hostname了,看来之前图省事没做DNS解析一直用localhost问题很多啊,算了先,换SPICE再试试吧
SPICE妥妥的~安装一下
安装Guest Agents
CentOS下安装:
# yum install -y ovirt-engine-guest-agent-common
systemctl start ovirt-guest-agent.service qemu-guest-agent.service
systemctl enable ovirt-guest-agent.service qemu-guest-agent.service
Ubuntu下安装
# apt install -y ovirt-guest-agent
systemctl start ovirt-guest-agent.service qemu-guest-agent.service
systemctl enable ovirt-guest-agent.service qemu-guest-agent.service
Windows下安装:
需要先下载virtio-win.vdf驱动
方法一:SSH连oVirt-Engine服务器后用yum安装
# yum install -y virtio-win ovirt-guest-tools-iso
//安装完成后,ISO文件存放在/usr/share/oVirt-guest-tools-iso/oVirt-tools-setup.iso,根据官方文档说的意思是还会自动复制到默认的ISO存储域路径下
这个iso文件是在Engine服务器上的,还需要手工把它再复制到ISO Domain所在的存储路径
方法二:fedora项目里面有编译好的文件
https://docs.fedoraproject.org/quick-docs/en-US/creating-windows-virtual-machines-using-virtio-drivers.html
直达地址:
下载好后用WinSCP上传到ISO存储域的文件夹里面
至此,本次安装oVirt已全部完成,感觉屌屌哒~回头有机会了去服务器上搞一下!