VMware Cloud Community
rwk1982
Enthusiast
Enthusiast

[HowTo] vRLI Disk Consolidation

Our vRLI Installation is now running since years and was extended several times with new harddisks. The size of the disks was between 100 GB and 256 GB and there where a lot disks. So we decided to consolidate the small disks to bigger ones. The target configuration of the appliance should ultimately be 4x1Tib disks, which is the maximum supported configuration. I should probably mention that the following HowTo is not even remotely supported by VMware 🙂

First I added a temporary single disk which was slightly bigger then the sum of the existing disks. Sum of the old disks: 1650 GB; Size of the single temporary new disk: 1666 GB

You can get the Sizes of the existing disks with:

pvs -o+pv_used

The new disk will probably not show up automatically so you need to rescan the scsi bus: Check which scsi hosts exits with:

ls /sys/class/scsi_host

In Our Case it was "host2" and the rescan for this looks like:

echo "- - -" >/sys/class/scsi_host/host2/scan

Now the new Disk should be found by the OS (I will use /dev/sdX as example for the new disk):

fdisk -l | grep "Disk /dev/"

Next step is to create partitions on the disk:

parted -s /dev/sdX mklabel msdos
parted -s /dev/sdX mkpart extended -- 1 -0
parted -s /dev/sdX mkpart logical -- 2 -0
partprobe --summary /dev/sdX

These commands are extracted from the script "/opt/vmware/bin/li-disk-utils.sh"

Now the partition /dev/sdX5 will be initialized as physical volume (PV):

pvcreate /dev/sdX5

This new PV can now be added to volume group (VG) "data":

vgextend data /dev/sdX5

At this point you can move the data from the old disks (I will use sdc5, sdd5, sde5 and sdf5 as examples):

pvmove /dev/sdc5 /dev/sdX5
pvmove /dev/sdd5 /dev/sdX5
pvmove /dev/sde5 /dev/sdX5
pvmove /dev/sdf5 /dev/sdX5

After the move is complete you can check the disk utilization with:

pvs -o+pv_used

The "Used" row should be 0 at all disks except "/dev/sdX5"

Next step is to remove the old disks from the VG "data":

vgreduce data /dev/sdc5
vgreduce data /dev/sdd5
vgreduce data /dev/sde5
vgreduce data /dev/sdf5

...and remove the PV from the partitions:

pvremove /dev/sdc5
pvremove /dev/sdd5
pvremove /dev/sde5
pvremove /dev/sdf5

Now shutdown the appliance

shutdown -h now

...and delete the old disk from the VM. The appliance should now have just the 20 GiB OS disk and the temporary data disk which you added at the first step.

! ! ! Do not add new disks at this point just start the VM ! ! !

When the appliance finished booting add the new disks to it (in our case the 4 x 1 Tib) and do the scsi bus scan again:

echo "- - -" >/sys/class/scsi_host/host2/scan

The device enumeration has most likely changed so the temp disk /dev/sdX could now be /dev/sdY. Just check with:

fdisk -l | grep "Disk /dev/"

I will use sdY as the temp disk and sdb, sdc, sdd and sde as the new 1 TiB disks in the examples.

The steps for the new disks are the same as before:

Create partitions on each disk:

parted -s /dev/sdb mklabel msdos
parted -s /dev/sdb mkpart extended -- 1 -0
parted -s /dev/sdb mkpart logical -- 2 -0
partprobe --summary /dev/sdb

parted -s /dev/sdc mklabel msdos
parted -s /dev/sdc mkpart extended -- 1 -0
parted -s /dev/sdc mkpart logical -- 2 -0
partprobe --summary /dev/sdc

parted -s /dev/sdd mklabel msdos
parted -s /dev/sdd mkpart extended -- 1 -0
parted -s /dev/sdd mkpart logical -- 2 -0
partprobe --summary /dev/sdd

parted -s /dev/sde mklabel msdos
parted -s /dev/sde mkpart extended -- 1 -0
parted -s /dev/sde mkpart logical -- 2 -0
partprobe --summary /dev/sde

Initialize the PV on each disk:

pvcreate /dev/sdb5
pvcreate /dev/sdc5
pvcreate /dev/sdd5
pvcreate /dev/sde5

and add the new PVs to the VG "data":

vgextend data /dev/sdb5
vgextend data /dev/sdc5
vgextend data /dev/sdd5
vgextend data /dev/sde5

Now move the data from the temp disk:

pvmove /dev/sdY5

After the move is complete you can check the disk utilization with:

pvs -o+pv_used

...and the "Used" row should be 0 at "/dev/sdY5"

Remove the temp disk from the VG "data":

vgreduce data /dev/sdY5

...and remove the PV from the partition:

pvremove /dev/sdY5

Now shutdown the appliance

shutdown -h now

...and delete the temp disk from the VM. The appliance should now have the 20 GiB OS disk and the four 1 TiB disks.

Start the VM and wait for the boot to complete. This could take a while because the start script "/opt/vmware/bin/li-disk-utils.sh" will automatically extend the file system. You can check the size with:

df -h | grep "/storage/core"

 

That's all Folks! 🙂

Drink coffee.. Do stupid things faster with more energy...
0 Replies