Use at your own risk
Please Note:
This is a Suggestion on how to increase Swap Disk Space in your eDMS OVA with the Help of LVM (Logical Volume Manager)
The following instruction are common and basic Linux System and LVM Administration and not proprietary to the eDMS nor its developers.
Always ensure a proper backup is in place prior to any such administrative work is started.
Client takes on full responsibility for the execution of this task. This should not be attempted unless you are qualified.
This being said, there are a number of huge advantages to extend your Diskspace via LVM over other means (e.G. you do not have to split up your storage over several logical mountpoints) and this has proven to be reliable, scalable and fast.
Should you have the need for increasing your Swap Diskspace and are not feeling comfortable with this procedure, please feel free to contact Patrix, Serviva or Pace-Ip for assistance.
Add Swap Space in your Hypervisor Environment
Regardless of your Usage of VMWare, Xen, Hyper V or other, when you grow the Amout of RAM, you should also intend to grow the Swap-Diskspace of the eDMS OVA. In order to do that it is neccesary to assign Diskspace to your VM
Please refer to the Manual of your Virtualization Platform for this.
Swap Space is added to a Computer to substitute disk space for RAM memory. So when RAM fills up, Memory is moved to disk.
While your Computer may have a lot of RAM, individual Docker containers and tasks may have less RAM assigned to them.
This may lead to "swapping" before your physical Ram fills up.
So you might have a number of processes using Swap Space. And when these Numbers grow, your Swap Space needs to grow as well.
We cannot give a general Recommendation as to how large your extension should become, since this may be dependent on individual scenarios.
Nonetheless we have had satisfactory experiences with assigning 0.5 times the amount of RAM as Swap Space.
Your mileage may vary on this, but usually it can be said that growing Swap Space larger than the actual amount of RAM will not increase performance, in some instances will even slow things down.
Make Disk visible to the OVA
- Prior to proceeding, you must identify the current LVM configuration and number of existing primary partitions.
- If you already have 4 primary partitions (sda1, sda2, sda3, sda4), you will need to add the additional space as a new disk (sdb X).
- If you don't have 4 primary partitions, you may add a new partition to the existing.
SSH into the CentOS OVA and sudo to root (unless you are already root)
sudo su -
List the block device to see the newly assigned vSphere hard disk.
lsblk
If you do not see the vSphere hard disk, force a rescan (or reboot which is less elegant but just as effective)
for host in $(ls -1d /sys/class/scsi_host/*); do echo "- - -" > ${host}/scan ; done for device in $(ls -1d /sys/class/scsi_disk/*); do echo "1" > ${device}/device/rescan ; done
create a new Partition that is compatible to LVM Swap
Format the disk partition. Get the device name from the previous lsblk output
fdisk /dev/sdb n (new partition) p (primary) (Press ENTER) (Use default partition number) (Press ENTER) (Use default first sector) (Press ENTER) (Use default last sector) w (write)
in order to see this partition, read the partition table with "partprobe" (or reboot which is less elegant but just as effective)
Activate the new Partition
partprobe
Verify the new partition is available
[root@cltdemo005 dev]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 1000G 0 disk ├─sda1 8:1 0 500M 0 part /boot ├─sda2 8:2 0 39.5G 0 part │ ├─centos-root 253:0 0 995.6G 0 lvm / │ └─centos-swap 253:1 0 34.9G 0 lvm [SWAP] ├─sda3 8:3 0 60G 0 part │ └─centos-root 253:0 0 995.6G 0 lvm / └─sda4 8:4 0 900G 0 part └─centos-root 253:0 0 995.6G 0 lvm / sdb 8:16 0 32G 0 disk └─sdb1 8:17 0 32G 0 part
Create the Physical Volume for LVM Swap
and check afterwards with pvs
pvcreate /dev/sdb1
Extend the Volumegroup (vg).
first check for the group with "vgs" then "vgextend centos" then check again:
vgextend centos /dev/sdb1
Disable swapping
first check for the group with "vgs" then "vgextend centos" then check again:
swapoff -v /dev/centos/swap
now extend the Logical Volume
Insteaf of the 31G here insert the size of your new swap disk:
lvresize /dev/centos/swap -L +31G
format the extended swap volume
mkswap /dev/centos/swap
enable the logical volume
swapon -va
check the newly extended swap space
htop