How to resize VIDM or Workspace ONE Access Disks
As a follow up to a [previous article] where I described how to resize the disk for VIDM, my co-blogger came up with another (better) solution that does not require the installation of gparted. Note that resizing sda has a different procedure than resizing sdb/sdc (traditional partition vs [LVM]). This blogpost is based on Photon based Workspace ONE Access 2108. -> Make sure you have a valid backup before taking these steps. Try the procedure in a dev/test environment first.
Part 1: Resize the disks in vCenter.
This is probably a task you are familiar with. In this case the disks are resized from 60/20/20 GB to 80/40/30 GB. The difference in size between 30 and 40 GB and has been chosen to make it easier to differentiate between disks.
Part 2: Resize traditional sda4 partition
After resizing the disks in vCenter, run the command rescan-scsi-bus.sh -s:
root@access2108 [ ~ ]# rescan-scsi-bus.sh -s
which: no multipath in (/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/vmware/vpostgres/current/bin:/usr/java/jre-vmware/bin:/opt/vmware/bin)
Scanning SCSI subsystem for new devices
Searching for resized LUNs
RESIZED: Host: scsi2 Channel: 00 Id: 01 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 2.0
Type: Direct-Access ANSI SCSI revision: 06
RESIZED: Host: scsi2 Channel: 00 Id: 02 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 2.0
Type: Direct-Access ANSI SCSI revision: 06
0 new or changed device(s) found.
3 remapped or resized device(s) found.
[2:0:1:0]
[2:0:2:0]
0 device(s) removed.
As you can see from the output 3 resized devices have been found. You can check the resized disks with the commands df -f; lsblk; lsscsi
root@access2108 [ ~ ]# df -h; lsblk; lsscsi
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 12K 3.9G 1% /dev/shm
tmpfs 3.9G 792K 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda4 12G 4.8G 6.5G 43% /
tmpfs 3.9G 180K 3.9G 1% /tmp
/dev/sda2 120M 36M 79M 32% /boot
/dev/mapper/tomcat_vg-horizon 20G 1.9G 17G 10% /opt/vmware/horizon
/dev/mapper/db_vg-db 20G 1.1G 18G 6% /db
...
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 80G 0 disk
├─sda1 8:1 0 2M 0 part
├─sda2 8:2 0 128M 0 part /boot
├─sda3 8:3 0 10G 0 part [SWAP]
└─sda4 8:4 0 12G 0 part /
sdb 8:16 0 40G 0 disk
└─db_vg-db 254:0 0 20G 0 lvm /db
sdc 8:32 0 30G 0 disk
└─tomcat_vg-horizon 254:1 0 20G 0 lvm /opt/vmware/horizon
...
Note the new file sizes 80, 40, 30 G.
After resizing the disks, the next step is to resize the sda4 partition with the command cfdisk (instead of gparted). Running cfdisk will bring up the “graphical user interface”. Choose the following steps:
root@access2108 [ ~ ]# cfdisk
1. select /dev/sda4
2. Resize > maximum size (69G)
3. Write > yes
Syncing disks.
4. Quit
To complete the resize for sda4 use the command resize2fs to extend the filesystem:
root@access2108 [ ~ ]# resize2fs /dev/sda4
resize2fs 1.45.5 (07-Jan-2020)
Filesystem at /dev/sda4 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 5
The filesystem on /dev/sda4 is now 18316539 (4k) blocks long.
root@access2108 [ ~ ]# df -h; lsblk; lsscsi
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 12K 3.9G 1% /dev/shm
tmpfs 3.9G 800K 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda4 69G 4.8G 62G 8% /
tmpfs 3.9G 180K 3.9G 1% /tmp
/dev/sda2 120M 36M 79M 32% /boot
....
You can check the results with the df -h command stated above.
Part 3: Resize Linux Volumes
The first step in part 3 is to resize the “physical” volumes sdb and sdc with the pvresize command
root@access2108 [ ~ ]# pvresize /dev/sdc /dev/sdb
Physical volume "/dev/sdc" changed
Physical volume "/dev/sdb" changed
2 physical volume(s) resized or updated / 0 physical volume(s) not resized
you can check the new sizes with the pvdisplay command and notice the new sizes:
root@access2108 [ ~ ]# pvdisplay /dev/sdc /dev/sdb
--- Physical volume ---
PV Name /dev/sdc
VG Name tomcat_vg
PV Size <30.00 GiB / not usable 0
Allocatable yes
PE Size 4.00 MiB
Total PE 7679
Free PE 2560
Allocated PE 5119
PV UUID yO1z2E-f6d3-SyWd-IE50-htwc-3gDt-JRaONB
--- Physical volume ---
PV Name /dev/sdb
VG Name db_vg
PV Size <40.00 GiB / not usable 0
Allocatable yes
PE Size 4.00 MiB
Total PE 10239
Free PE 5120
Allocated PE 5119
PV UUID 2OMcNV-Z4xY-hCFM-jks0-vNCJ-QGW4-xPYAHJ
Extend the logical volumes with the lvextend command:
root@access2108 [ ~ ]# lvextend -l +100%FREE /dev/tomcat_vg/horizon
Size of logical volume tomcat_vg/horizon changed from <20.00 GiB (5119 extents) to <30.00 GiB (7679 extents).
Logical volume tomcat_vg/horizon successfully resized.
root@access2108 [ ~ ]# lvextend -l +100%FREE /dev/db_vg/db
Size of logical volume db_vg/db changed from <20.00 GiB (5119 extents) to <40.00 GiB (10239 extents).
Logical volume db_vg/db successfully resized.
Extend the filesystem with the resize2fs command;
root@access2108 [ ~ ]# resize2fs /dev/tomcat_vg/horizon
resize2fs 1.45.5 (07-Jan-2020)
Filesystem at /dev/tomcat_vg/horizon is mounted on /opt/vmware/horizon; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 2
The filesystem on /dev/tomcat_vg/horizon is now 7863296 (4k) blocks long.
root@access2108 [ ~ ]# resize2fs /dev/db_vg/db
resize2fs 1.45.5 (07-Jan-2020)
Filesystem at /dev/db_vg/db is mounted on /db; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 3
The filesystem on /dev/db_vg/db is now 10484736 (4k) blocks long.
Run the df -h, lsblk and lsscsi commands to your liking to see the final results.
root@access2108 [ ~ ]# df -h; lsblk
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 12K 3.9G 1% /dev/shm
tmpfs 3.9G 800K 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda4 69G 4.8G 62G 8% /
tmpfs 3.9G 180K 3.9G 1% /tmp
/dev/sda2 120M 36M 79M 32% /boot
/dev/mapper/tomcat_vg-horizon 30G 1.9G 27G 7% /opt/vmware/horizon
/dev/mapper/db_vg-db 40G 1.1G 37G 3% /db
...
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 80G 0 disk
├─sda1 8:1 0 2M 0 part
├─sda2 8:2 0 128M 0 part /boot
├─sda3 8:3 0 10G 0 part [SWAP]
└─sda4 8:4 0 69.9G 0 part /
sdb 8:16 0 40G 0 disk
└─db_vg-db 254:0 0 40G 0 lvm /db
sdc 8:32 0 30G 0 disk
└─tomcat_vg-horizon 254:1 0 30G 0 lvm /opt/vmware/horizon
Thank you for this!