Increasing the disk space available to a virtual appliance using Logical Volume Management (LVM) in API Gateway version 8.x and later

Document ID : KB000042624
Last Modified Date : 15/03/2018
Show Technical Document Details
Introduction:

Introduction:

The amount of space allocated to a virtual API Gateway appliance is pre-configured upon deployment. Disk space is utilized by components of the host operating system, the MySQL database, or flat log files. Version 8.x and later of the API Gateway leverages Logical Volume Management to structure and partition the storage space available to the host operating system. The scope of this articles focuses on increasing the storage available to the partition and logical volume used by the MySQL server to store the database tablespace. These instructions are ordered as such but can be modified to add additional storage to any existing logical volume.

Background:

This article assumes that API Gateway version 8.x or later is currently running and that the appliance form factor is virtual or a software-based install running on a VMware-based hypervisor. This article does not apply to hardware appliances of any version or virtual appliances older than version 8.x

Environment:

The API Gateway appliance comes with a structured disk partitioning scheme using a collection of logical volumes within a volume group on a physical volume. The current logical volume deployment can be printed and inspected via lvscan. An example output would be as follows (with the applicable information in bold):
ACTIVE            '/dev/vg00/lv_swap' [2.00 GiB] inherit
ACTIVE            '/dev/vg00/lv_root' [8.00 GiB] inherit
...
ACTIVE            '/dev/vg00/lv_reserved' [2.00 GiB] inherit
ACTIVE            '/dev/vg00/lv_db' [20.97 GiB] inherit

The logical volume name (lv_db) and its current size (20.97 GiB) should be noted and retained in order to ensure the process completed without issues.

Instructions:

It is imperative that an administrator takes a virtual machine snapshot before beginning this procedure. Executing a full API Gateway installation backup is also recommended. Executing a snapshot is documented here. API Gateway backup procedures are documented within the Installation and Maintenance Manual for the applicable version of the Gateway.

  1. Create and install a new virtual disk on to the virtual appliance. A document from VMware describing this process can be found here. Please consult the vendor of the applicable virtualization platform for more specific instructions.
  2. Restart the Gateway appliance
  3. Print the list of currently installed storage devices: fdisk -l

?NOTE: The following output is an example with an existing partitioned disk (/dev/sda) and a new unpartitioned disk (/dev/sdb). Some data has been removed for brevity and other data may be different based on your deployment.

Disk /dev/sda: 53.7 GB, 53687091200 bytes
...
Disk identifier: 0x00085c3a
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         131     1048576   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2             131        6528    51379200   8e  Linux LVM
 
Disk /dev/sdb: 42.9 GB, 42949672960 bytes
...
Disk identifier: 0x00046a21

   Device Boot      Start         End      Blocks   Id  System

  1. Start the disk partitioning tool and target the newly installed disk: fdisk /dev/sdb
NOTEThis command will open up a new command shell. Options are selected by choosing the appropriate alphanumeric option and pressing <Enter>
  1. Select Option N to add a new partition
  2. Select Option P to set the new partition as the primary
  3. Specify "1" to set the partition number
  4. Press <Enter> to accept the default starting cylinder
  5. Press <Enter> to accept the default ending cylinder
  6. Select Option T to change the partition type
  7. Specify "8e" to change the type to "Linux LVM"
  8. Select Option W to write the changes to disk.
  9. Initialize the new disk partition: pvcreate /dev/sdb1
  10. Add a physical volume to an existing volume group: vgextend vg00 /dev/sdb1
  11. Expand the size of the database tablespace partition: lvextend -r -l +100%FREE /dev/mapper/vg00-lv_db /dev/sdb1
  12. If you need to distribute the free space among different drives you can specify the size you need to add to one specific drive for example if you want to add only 40GB to root out of the 100 GB space you have added to the server you can use the command:

    lvextend -L +40G -r /dev/mapper/vg00-lv_root

Additional Information:

Executing lvscan should show a large storage allocation for the lv_db logical volume. If this value has increased then the operation was successful. An example output is documented below:
ACTIVE            '/dev/vg00/lv_swap' [2.00 GiB] inherit
ACTIVE            '/dev/vg00/lv_root' [8.00 GiB] inherit
..
ACTIVE            '/dev/vg00/lv_reserved' [2.00 GiB] inherit
ACTIVE            '/dev/vg00/lv_db' [36.94 GiB] inherit

Instructions:
Please Update This Required Field