Skip to main content
Versa Networks

Expand Disk Storage for Analytics Nodes

Versa-logo-release-icon.png For supported software information, click here.

This article describes how to manage the disk space used by Versa Analytics nodes running on virtual machines (VMs) for Azure, ESXi, and KVM virtual environments. The procedures apply to both Analytics standalone deployments and cluster deployments. For cluster deployments, you repeat the procedures on each of the nodes in the Analytics cluster.

If you install the software on an Analytics node using a qcow image, by default, the node is allocated an 80-GB partition for the root filesystem, and all files are stored in this filesystem. Typically, 80 GB is enough to perform lab testing for a pilot deployment. However, to use the Analytics nodes in a network deployment, increasing the allocated storage is critical, because the Analytics nodes require large amounts of disk space to store incoming logs from Versa Operating SystemTM (VOSTM) and Controller nodes, archived logs, search engine indexes, and database files. Note that the maximum disk size recommended for an Analytics cluster node is 2 TB. For more information, see Hardware and Software Requirements for Headend.

Compare Allocated and Available Disk Storage

You can view the amount of disk space currently allocated to the root filesystem and compare it to the amount of disk available from the VM. (Note that the available disk space is all the space contained in the VM's disk and the allocated disk space is the space assigned to filesystems, here, to the root filesystem.)

If the VM does not contain enough available storage, you can reconfigure the VM to include more. For more information, see Increase Available VM Storage, below.

If the VM contains available storage that is not allocated to a filesystem, you can reconfigure components of the disk and the operating system so that the root filesystem can use the available storage. For more information, see Allocate Disk Storage, below.

Display Analytics Cluster Disk Usage

You can display the disk usage for the analytics-type (database) and search-type (search engine) nodes in an Analytics cluster from the Director GUI, on the Analytics > Administration > System Status > Status screen. This screen displays information about the filesystems on the node, but it does not display information about available but unallocated disk space. You can view the disk usage for multiple nodes in an Analytics cluster on a single screen. If your Director instance has connectors to multiple Analytics clusters, in the horizontal menu bar, select a node from the appropriate cluster to display information for the nodes in that cluster.

Analytics_cluster_status_22.1.1_before_increase.png

Display Allocated Disk for an Individual Analytics Node

To display the current filesystem disk usage (that is, the allocated disk space) for an individual node, issue the df –kh shell command. 

In the following example, the root filesystem is stored in logical volume dm-0, which is accessible through device file /dev/dm-0. The output shows that 71 GB of this logical volume is available to the root filesystem, which currently uses 4.3 GB of this space.

admin@Analytics$ df -kh
Filesystem      Size  Used Avail Use% Mounted on
udev            7.9G   12K  7.9G   1% /dev
tmpfs           1.6G  344K  1.6G   1% /run
/dev/dm-0        71G  4.3G   63G   7% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
none            5.0M     0  5.0M   0% /run/lock
none            7.9G   32K  7.9G   1% /run/shm
none            100M     0  100M   0% /run/user
/dev/sda1       236M   79M  145M  36% /boot

The df –kh command may display a link to the logical volume device file instead of displaying the device file directly. In this case, to determine the logical volume name, issue the ls –l command. For example, if the df –kh command shows device file /dev/mapper/system-root, the ls –l command reveals that /dev/mapper/system-root is a link to device file /dev/dm-0, so therefore the root filesystem is stored on logical volume dm-0.

admin@Analytics$ ls -l /dev/mapper/system-root
lrwxrwxrwx 1 root root 7 Mar 29  2021 /dev/mapper/system-root -> ../dm-0

Display Partitions and Logical Volumes

The root filesystem is stored on a logical volume, which maps to one or more portions of partitions on the VM's disk.

To display information about the disk partition and logical volume, issue the lsblk shell command. This command displays the disks by name, the amount of storage assigned to each disk's partitions, and any logical volumes that map to the partitions. This command does not display VM disk space that has not yet been assigned to a partition.

The following example shows that the VM is using the hard disk sda and that a total of 80 GB is assigned to to this disk. The sda disk has three partitions: partition 1 (sda1), partition 2 (sda2), and partition 5 (sda5). Only a small amount of disk space is assigned to partitions sda1 and sda2, and 79.8 GB is assigned to partition 5 (sda5), with 71.7 GB of partition 5 mapped to logical volume dm-0, which contains the root filesystem.

admin@Analytics$ lsblk
NAME                     MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                        8:0    0    80G  0 disk
├─sda1                     8:1    0   243M  0 part /boot
├─sda2                     8:2    0     1K  0 part
└─sda5                     8:5    0  79.8G  0 part
  ├─system-root (dm-0)   252:0    0  71.7G  0 lvm  /
  └─system-swap_1 (dm-1) 252:1    0     8G  0 lvm
sr0                       11:0    1  1024M  0 rom

Display Total Available VM Disk Storage

To display information about storage available to the VM, issue the sudo fdisk –l shell command. The first line of the command output displays the disk device filename and the size of the disk. The example output below shows that the VM uses disk sda (/dev/sda), which is about 1.1 TB in size. The example lsblk command above shows that approximately 80 GB of this disk space is allocated, and therefore most of this VM's disk storage is not being used.

admin@Analytics$ sudo fdisk -l
[sudo] password for versa:
 
Disk /dev/sda: 1134.5 GB, 1134475345920 bytes
255 heads, 63 sectors/track, 137925 cylinders, total 2215772160 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 identifier: 0x00054b19
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758   167770111    83634177    5  Extended
/dev/sda5          501760   167770111    83634176   8e  Linux LVM
 
Disk /dev/mapper/system-root: 77.0 GB, 77007421440 bytes
255 heads, 63 sectors/track, 9362 cylinders, total 150405120 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 identifier: 0x00000000
 
Disk /dev/mapper/system-root doesn't contain a valid partition table
 
Disk /dev/mapper/system-swap_1: 8585 MB, 8585740288 bytes

Increase Available VM Storage

If your VM does not contain enough available disk space, you can add storage using either the VM's hypervisor UI or the command line on the host VM.

To increase VM storage from the hypervisor UI, consult your UI documentation.

To increase VM storage from the command line on the host VM:

  1. Shut down the VM for the Analytics node.
  2. To increase the disk size of the VM, issue the following command from the host VM:
sudo qemu-img resize /home/versa/image-name +size

For example, to increase the disk size for an Analytics qemu image by 10 GB, issue the following command:

sudo qemu-img resize /home/versa/versa-analytics-0e43394-21.1R4.qemu +10G
  1. Restart the VM for the Analytics node.
  2. Log in to the VM and issue the sudo fdisk –l command, which displays the larger disk size.

Allocate Disk Storage

To allocate available storage from your VM to the root filesystem, you add a new partition to the logical volume on which the root filesystem is stored. To do this, you perform the following operations:

  • Increase the amount of disk space included in the volume group used by the root filesystem:
    • Configure a new partition using the available disk space.
    • Initialize the new partition.
    • Add the new partition to the volume group used by the root filesystem's logical volume.
  • Resize the root filesystem:
    • Extend the root filesystem's logical volume.
    • Update the root filesystem's data structures so that the filesystem can access the added space.

Disks can have a master boot record (MBR) or GUID partition table (GPT) partition style. There are separate procedures for MBR and GPT format disks.

Allocate Disk Storage for MBR Format Disks

This section describes how to configure and initialize a new partition on an MBR format disk, incorporate it into a logical volume, and then add it to the root filesystem's available space.

Configure a New Partition for an MBR Format Disk

To create a new partition from unassigned sectors on an existing MBR disk using the available disk space:

  1. To edit the partition table for your disk, use the Linux cfdisk utility. Use this utility on the disk device file listed in the output of the fdisk command, as described in Display Total Available VM Disk Storage, above. The utility copies the partition table from the disk into memory so that you can edit it. The utility displays the following screen, which includes a partition-editing menu and information about the disk, such as its current partitions and free space. In the following example, the screens shows that the disk has is approximately 1 TB of free space (1048577.05 MB) after partition 5 (sda5). You can use this space to create a new partition.
admin@versa-vm$ sudo cfdisk /dev/sda
cfdisk_main_screen11.png
  1. Use the up and down arrow keys to highlight the Free space to assign to the new partition. A new menu displays at the bottom of the screen.

    cfdisk_new_menu.png
  2. Use the right and left arrow keys to highlight New in the menu at the bottom of the screen.
  3. Press the Enter key. You are prompted to select a partition type.

    cfdisk_primary_partition_menu.png
     
  4. Use the arrow keys to highlight Primary, and then press the Enter key. The Size prompt displays.

    ​​​​​cfdisk_partition_size_prompt3.png
     
  5. Enter a size for the new partition, in megabytes, and then press the Enter key. The cfdisk utility selects a partition number and then adds the partition to the in-memory partition table. In the following example, cfdisk has created partition 3 (sda3), which is 1048577.05 MB (1 TB) in size.

    cfdisk_change_type_of_partition.png
     
  6. By default, the cfdisk utility creates the new partition with filesystem type Linux. To change this to the Linux LVM type, use the arrow keys to highlight Type in the menu at the bottom of the screen, and then press Enter.
  7. When you are prompted to enter the filesystem type, enter 8e and then press Enter.

    cfdisk_file_system_type_8e.png

    The filesystem type changes to Linux LVM:

    cfdisk_write_partition_table.png
  8. Use the arrow keys to highlight Write, and then press Enter.
  9. When prompted to save your changes, type yes and then press Enter. The edited partition table is saved to the disk.
  10. Use the arrows keys to highlight Quit, and then press Enter to exit the cfdisk utility.
  11. Reboot the node. Note that a reboot is not required for nodes running Ubuntu 18.04 (Bionic).
  12. When the reboot completes, log in to a shell on the node, and then issue the lsblk command. The output includes the new partition. Make a note of the device filename for the partition, which is the /dev directory prepended to the partition name. In the example here, the new partition is sda3 and its device filename is /dev/sda3.
admin@Analytics$ lsblk
NAME                     MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                        8:0    0     1T  0 disk
├─sda1                     8:1    0   243M  0 part /boot
├─sda2                     8:2    0     1K  0 part
├─sda3                     8:3    0 976.6G  0 part
└─sda5                     8:5    0  79.8G  0 part
  ├─system-root (dm-0)   252:0    0  71.7G  0 lvm  /
  └─system-swap_1 (dm-1) 252:1    0     8G  0 lvm
sr0                       11:0    1  1024M  0 rom

Initialize the New MBR Partition

To initialize the new partition, issue the sudo pvcreate device-filename command. Use the device filename for the partition you created in the previous section. For example:

admin@Analytics$ sudo pvcreate /dev/sda3
  Physical volume "/dev/sda3" successfully created

Add the MBR Partition to a Volume Group

Before you can extend the root filesystem, you must add the new partition to a volume group.

To add the new partition to the root filesystem's volume group:

  1. To display the existing volume group configuration, issue the sudo vgdisplay command. Typically, the node contains only the volume group named "system".
 admin@Analytics$ sudo vgdisplay
  --- Volume group ---
  VG Name               system
  System ID
  
  (Output omitted for brevity.)
  1. To add the partition to an existing volume group, issue the sudo vgextend volume-group partition-name command. For volume-group, use the volume group name from Step 1. For partition-name, use the device filename you used in the sudo pvcreate command. For example:
admin@Analytics$ sudo vgextend system /dev/sda3
  Volume group "system" successfully extended 

Additional storage is now included in the volume group, although the storage is not yet mapped to any logical volumes.

Extend the Logical Volume Using an MBR Partition

To extend the logical volume:

  1. To increase the size of the logical volume for the root filesystem, issue the lvextend command. The command uses the device file /dev/system/root, which is a link to the device file for the root filesystem, which, in this example, is /dev/dm-0. The –l+100%FREE argument adds all available free disk space to the logical volume. In the example here, the lvextend command adds the disk space from partition 3 to logical volume dm-0, so that dm-0 now contains most of partition 5 and all of partition 3.

    admin@Analytics$ sudo lvextend -l+100%FREE /dev/system/root
  2. To display which partitions are now included in the logical volume, issue the lsblk command. In the following example output, the command verifies that dm-0 now includes the new partition.

admin@Analytics$ lsblk
NAME                     MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                        8:0    0     1T  0 disk
├─sda1                     8:1    0   243M  0 part /boot
├─sda2                     8:2    0     1K  0 part
├─sda3                     8:3    0 976.6G  0 part
│ └─system-root (dm-0)   252:0    0     1T  0 lvm  /
└─sda5                     8:5    0  79.8G  0 part
  ├─system-root (dm-0)   252:0    0     1T  0 lvm  /
  └─system-swap_1 (dm-1) 252:1    0     8G  0 lvm
sr0                       11:0    1  1024M  0 rom

Extend the Root Filesystem

To have the root filesystem use the additional storage, you update data structures to resize the filesystem.

To resize the root filesystem:

  1. Issue the resize2fs command. This command uses the device file /dev/mapper/system-root, which is a link to the device file for the root filesystem, in this example, /dev/dm-0.
admin@Analytics$ sudo resize2fs /dev/mapper/system-root
  1. To verify that the root filesystem has been allocated additional disk space, issue the df –kh command.
admin@Analytics$ df -kh
Filesystem      Size  Used Avail Use% Mounted on
udev            7.9G   12K  7.9G   1% /dev
tmpfs           1.6G  348K  1.6G   1% /run
/dev/dm-0       1.1T  4.3G  985G   1% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
none            5.0M     0  5.0M   0% /run/lock
none            7.9G   32K  7.9G   1% /run/shm
none            100M     0  100M   0% /run/user
/dev/sda1       236M   79M  145M  36% /boot

The Analytics > Administration > System Status > Status screen in the Director GUI also displays the increased storage. In the following example, steps were performed on both nodes of the cluster so that they both display an increase in the Disk Free column.

Analytics_cluster_status_22.1.1_after_increase.png
 

Allocate Disk Storage for GPT Format Disks

This section describes how to configure and initialize a new partition on a GPT format disk, incorporate it into a logical volume, and then add it to the root filesystem's available space.

Configure a New Partition for a GPT Format Disk

To create a new partition from unassigned sectors on an existing GPT disk using the available disk space:

  1. To edit the partition table for your disk, use the Linux gdisk utility. Use this utility on the disk device file listed in the output of the fdisk command, as described in Display Total Available VM Disk Storage, above. The utility copies the partition table from the disk into memory so that you can edit it.
admin@Analytics$ sudo gdisk /dev/sde
GPT fdisk (gdisk) version 0.8.8
Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): n
  1. Enter n to create a new partition.
Partition number (1-128, default 1):
First sector (34-6476005342, default = 40) or {+-}size{KMGTP}:
Last sector (40-6476005342, default = 6476005342) or {+-}size{KMGTP}:
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): 8e00
Changed type of partition to 'Linux LVM'
Command (? for help): w
  1. Enter values for the partition number, first sector, and last sector. In the above example, the user presses Enter three times to accept the default values.
  2. Enter 8e00 for the Hex code or GUID value. This marks the partition as type Linux LVM.
  3. Enter w to save your changes to the in-memory copy of the partition table.
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/sde.
The operation has completed successfully.
  1. Enter Y to save your changes to the partition table on disk.
  2. Issue the lsblk command to display the new partition. In the example here, the new partition is sde1 and its device filename is /dev/sde1.
admin@Analytics$ lsblk
sda                        8:0    0    80G  0 disk
├─sda1                     8:1    0   243M  0 part /boot
├─sda2                     8:2    0     1K  0 part
└─sda5                     8:5    0  79.8G  0 part
  ├─system-root (dm-0)   252:0    0  71.7G  0 lvm  /
  └─system-swap_1 (dm-1) 252:1    0     8G  0 lvm
sde                        8:64   0     3T  0 disk
`-sde1                     8:65   0     3T  0 part
sr0                       11:0    1  1024M  0 rom

Initialize the New GPT Partition

To initialize the new partition, issue the sudo pvcreate device-filename command. Use the device filename for the partition you created in the previous section. For example:

admin@Analytics$ sudo pvcreate /dev/sde1
  Physical volume "/dev/sde1" successfully created

Add the GPT Partition to a Volume Group

  1. To display the existing volume group configuration, issue the sudo vgdisplay command. Typically, the node contains only the volume group named "system".
 admin@Analytics$ sudo vgdisplay
  --- Volume group ---
  VG Name               system
  System ID
  
  (Output omitted for brevity.)
  1. To add the partition to an existing volume group, issue the sudo vgextend volume-group partition-name –An command. For volume-group, use the volume group name from the previous step. For partition-name, use the device filename you used in the sudo pvcreate command. For example:
admin@Analytics$ sudo vgextend system /dev/sde1 -An
  Volume group "system" successfully extended

Extend the Logical Volume Using a GPT Partition

To extend the logical volume:

  1. To increase the size of the logical volume for the root filesystem, issue the lvextend command with the -An option. The command uses the device file /dev/system/root, which is a link to the device file for the root filesystem. The –l+100%FREE argument adds all available free disk space to the logical volume. In the example here, the lvextend command adds the disk space from partition sde1.

admin@Analytics$ sudo lvextend -l+100%FREE /dev/system/root -An
Extending logical volume root to 3.92 TiB
WARNING: This metadata update is NOT backed up
Logical volume root successfully resized
  1. To display which partitions are now included in the logical volume, issue the lsblk command.
admin@Analytics$ lsblk

Extend the Root Filesystem

To have the root filesystem use the additional storage, you update data structures to resize the filesystem.

To resize the root filesystem:

  1. Issue the resize2fs command. This command uses the device file /dev/mapper/system-root, which is a link to the device file for the root filesystem.
admin@Analytics$ sudo resize2fs /dev/mapper/system-root
resize2fs 1.42.9 (4-Feb-2014)
Filesystem at /dev/mapper/system-root is mounted on /; on-line resizing required
old_desc_blocks = 58, new_desc_blocks = 252
The filesystem on /dev/mapper/system-root is now 1052965888 blocks long.
  1. To verify that the root filesystem has been allocated additional disk space, issue the df –kh command.
admin@Analytics$ df -kh
Filesystem                 Size  Used Avail Use% Mounted on
/dev/mapper/system-root    3.9T  694G  3.1T  19% /
none                       4.0K     0  4.0K   0% /sys/fs/cgroup
udev                        32G   12K   32G   1% /dev

(Output omitted for brevity.)

Supported Software Information

Releases 20.2 and later support all content described in this article.

  • Was this article helpful?