ZABBIX虚拟化部署

一、安装ESXI系统并连接

安装过程百度ESXI安装

二、导入OVF模板

1在

vSphere

Client菜单栏中,在“文件”菜单中选择“部署OVF模板”

2此时将显示“部署OVF模板”向导,可浏览文件以查找OVF或OVA模板,或者指定一个位于Internet上的

OVF 模板的URL

3查看OVF模板详细信息界面,单击“下一步”按钮

4输入要部署的名称和选择清单位置,单击“下一步”按钮,

5选择要在其上部署OVF模板的主机或群集,然后单击“下一步”按钮,

6在“磁盘格式”界面中,选择用于存储虚拟磁盘的磁盘格式,然后单击“下一步”按钮,

7对于

OVF 模板中指定的各个网络,可在基础架构中右击“目标网络”列,通过弹出的快捷菜单设置网络映射,然后单击“下一步”按钮,

8查看设置,然后单击“完成”按钮。经过一段时间,一个OVF文件就部署完成了。

9

修改虚拟机的CPU 内存 及磁盘空间

虚拟机模板默认空间为40G 空间, CPU为单核心2G内存

虚拟导入后需要根据服务器的实际情况修改

选定虚拟机后 右键 选择 编辑设置

调整内存

调整CPU

修改磁盘空间(后续扩容分区使用)

10 开机运行

修改网卡地址

进行网卡配置目录查看网卡

cd

/etc/sysconfig/network-scripts/

查看网卡信息

vi

ifcfg-ens32

修改BOOTPROTO=static 为静态配置

添加

IPADDR=10.123.2.36

NETMASK=255.255.255.0

GATEWAY=10.123.2.3

执行

ifdown

ifcfg-ens32

ifup ifcfg-ens32

重启网卡

三、扩容监控系统硬盘

1、扩展虚拟机磁盘

关闭虚拟机

扩展磁盘大小

运机虚拟机

2、扩展虚拟机根分区

1.查看当前分区状况,可以看到磁盘/dev/sda

[root@localhost ~]#fdisk
-lDisk /dev/sda:16.1
GB, 16106127360 bytes
255 heads, 63 sectors/track,1958
cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes
Device
Boot Start End Blocks Id System
/dev/sda1 * 1 25 200781 83 Linux
/dev/sda2 26 156 1052257+ 82 Linux swap /
Solaris
/dev/sda3157 13059229342+ 83 Linux#注意这里起始cylinder 是157,起始cylinder 绝对不可以改,否则会破坏原分区的数据。
2.扩展根分区
[root@localhost ~]#fdisk
/dev/sdaThe number of cylinders for this disk is set to 1958.
There is nothing wrong with that, but this is larger than
1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of
LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2
FDISK)
Command (m for help):pDisk /dev/vda: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device
Boot Start End Blocks Id System
/dev/vda1 * 1 25 200781 83 Linux
/dev/vda2 26 156 1052257+ 82 Linux swap /
Solaris/dev/vda3 157 1305 9229342+ 83 LinuxCommand (m for help):dPartition number (1-4):3#根/分区是多少就输入几,这里是/dev/sda3Command (m for help):pDisk /dev/vda: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device
Boot Start End Blocks Id System
/dev/sda1 * 1 25 200781 83 Linux
/dev/sda2 26 156 1052257+ 82 Linux swap /
Solaris
Command (m for help):nCommand action
e extended
p primary partition
(1-4)pPartition number (1-4):3#之前是多少,这里还输入多少First cylinder (157-1958, default157):Using default value 157
Last cylinder or +size or +sizeM or +sizeK (157-1958,
default1958):#由之前1305,扩为1958Using default value 1958
Command (m for help): wThe partition table has been altered!
Calling ioctl() to re-read partition table.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
3、重启虚拟机,完成根分区扩容
执行如下命令,重启系统
[root@localhost ~]#reboot
重启后执行如下命令,完成根分区扩充
[root@localhost ~]#resize2fs
/dev/vda3
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/vda3 is mounted on /; on-line resizing
required
Performing an on-line resize of /dev/vda3 to 3618641 (4k)
blocks.
The filesystem on /dev/vda3 is now 3618641 blocks
long.
如报错
resize2fs: Bad magic number in super-block
当尝试打开 /dev/sda2 时
找不到有效的文件系统超级块.将resize2fs替换为xfs_growfs,重新执行一遍即可,如下:
4、验证
查看当前磁盘状态
[root@localhost ~]# df -h文件系统
容量 已用
可用 已用% 挂载点/dev/vda3 14G 1.3G 12G 11% //dev/vda1 190M 12M 169M 7% /boot
tmpfs 379M 0 379M 0%
/dev/shm