


Zabbix applianceをVMware ESXi 6.7に導入してサーバ,ネットワーク機器の監視をはじめました。
一通りの設定を終えてHDDの空き容量を見たら1.8GBでした。
| 1 2 3 4 5 6 7 8 9 | appliance@zabbix:~$ df -h Filesystem                   Size  Used Avail Use% Mounted on udev                         2.0G     0  2.0G   0% /dev tmpfs                        396M  5.6M  390M   2% /run /dev/mapper/zabbix--vg-root  5.1G  3.1G  1.8G  63% / tmpfs                        2.0G     0  2.0G   0% /dev/shm tmpfs                        5.0M     0  5.0M   0% /run/lock tmpfs                        2.0G     0  2.0G   0% /sys/fs/cgroup /dev/sda1                    472M  111M  337M  25% /boot | 
監視端末が少ないとは言え、さすがにこれでは1年も持たないのは見えているので新規HDDを追加しました。
手順は下記の記事を参考にして下さい。
- 仮想HDDの新規追加
- fdiskでLVMパーティションを作成
- 物理ボリューム(pv)を作成
- ボリュームグループ(vg)に追加
- 論理ボリューム(lv)の拡張
- ファイルシステムを拡張
- サイズの確認
ESXi 6.7のWeb Clientにログインして仮想マシンの編集を行います。[ハードディスクの追加]から新規に50GBのディスクを追加しました。

追加後に仮想マシンを起動、あるいは再起動すると/dev/sdbとして認識します。
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | appliance@zabbix:~$ sudo fdisk -l Disk /dev/sda: 9.8 GiB, 10485760000 bytes, 20480000 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x84883a31 Device     Boot   Start      End  Sectors  Size Id Type /dev/sda1  *       2048   999423   997376  487M 83 Linux /dev/sda2       1001470 20477951 19476482  9.3G  5 Extended /dev/sda5       1001472 20477951 19476480  9.3G 8e Linux LVM Disk /dev/sdb: 50 GiB, 53687091200 bytes, 104857600 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/zabbix--vg-root: 5.3 GiB, 5674893312 bytes, 11083776 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/zabbix--vg-swap_1: 4 GiB, 4294967296 bytes, 8388608 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes | 
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | appliance@zabbix:~$ sudo fdisk /dev/sdb Welcome to fdisk (util-linux 2.27.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table. Created a new DOS disklabel with disk identifier 0x7c5e81e3. Command (m for help): n Partition type    p   primary (0 primary, 0 extended, 4 free)    e   extended (container for logical partitions) Select (default p): p Partition number (1-4, default 1): First sector (2048-104857599, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-104857599, default 104857599): Created a new partition 1 of type 'Linux' and of size 50 GiB. Command (m for help): t Selected partition 1 Partition type (type L to list all types): 8e Changed type of partition 'Linux' to 'Linux LVM'. Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. | 
| 1 2 3 4 5 6 7 8 9 10 | appliance@zabbix:~$ sudo pvcreate -v /dev/sdb1     Set up physical volume for "/dev/sdb1" with 104855552 available sectors     Zeroing start of device /dev/sdb1     Writing physical volume data to disk "/dev/sdb1"   Physical volume "/dev/sdb1" successfully created appliance@zabbix:~$ sudo pvscan   PV /dev/sda5   VG zabbix-vg       lvm2 [9.29 GiB / 0    free]   PV /dev/sdb1                      lvm2 [50.00 GiB]   Total: 2 [59.28 GiB] / in use: 1 [9.29 GiB] / in no VG: 1 [50.00 GiB] | 
zabbix-vgが59.28GBに拡張されました。
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | appliance@zabbix:~$ sudo vgextend zabbix-vg /dev/sdb1   Volume group "zabbix-vg" successfully extended appliance@zabbix:~$ sudo vgdisplay   --- Volume group ---   VG Name               zabbix-vg   System ID   Format                lvm2   Metadata Areas        2   Metadata Sequence No  4   VG Access             read/write   VG Status             resizable   MAX LV                0   Cur LV                2   Open LV               2   Max PV                0   Cur PV                2   Act PV                2   VG Size               59.28 GiB   PE Size               4.00 MiB   Total PE              15176   Alloc PE / Size       2377 / 9.29 GiB   Free  PE / Size       12799 / 50.00 GiB   VG UUID               jkf8e6-eJSN-G33L-4Y54-6KFg-kMdd-gITHfn | 
| 1 2 3 4 5 | appliance@zabbix:~$ sudo -l +100%FREE /dev/zabbix-vg/root sudo: +100%FREE: command not found appliance@zabbix:~$ sudo lvextend -l +100%FREE /dev/zabbix-vg/root   Size of logical volume zabbix-vg/root changed from 5.29 GiB (1353 extents) to 55.28 GiB (14152 extents).   Logical volume root successfully resized. | 
| 1 2 3 4 5 | appliance@zabbix:~$ sudo resize2fs /dev/zabbix-vg/root resize2fs 1.42.13 (17-May-2015) Filesystem at /dev/zabbix-vg/root is mounted on /; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 4 The filesystem on /dev/zabbix-vg/root is now 14491648 (4k) blocks long. | 
/ が55GBに拡張されました。
| 1 2 3 4 5 6 7 8 9 | appliance@zabbix:~$ df -h Filesystem                   Size  Used Avail Use% Mounted on udev                         2.0G     0  2.0G   0% /dev tmpfs                        396M  5.7M  390M   2% /run /dev/mapper/zabbix--vg-root   55G  3.1G   49G   6% / tmpfs                        2.0G     0  2.0G   0% /dev/shm tmpfs                        5.0M     0  5.0M   0% /run/lock tmpfs                        2.0G     0  2.0G   0% /sys/fs/cgroup /dev/sda1                    472M  111M  337M  25% /boot | 
これで暫くは大丈夫かな。