Expand Disk Storage for Director Nodes
For supported software information, click here.
This article describes how to manage the disk space used by Versa Director nodes running on virtual machines (VMs) for Azure, ESXi, and KVM virtual environments. It also describes how to increase the amount of storage available from your VM and how to allocate additional storage to a filesystem on a Director node, focusing on the /var filesystem.
If you install the software on a Director node using a qcow image, by default, the node is allocated approximately 120 GB of total disk space, which is divided among the root, /opt, and /var filesystems. Typically, the root and /opt filesystems do not require additional disk space, but the disk space usage in the /var filesystem increases over time and so you may need to allocate more storage to it.
The typical disk size recommendation for a Versa Director node is 200 GB. The maximum allowed disk size is 2 TB per Director node. 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 filesystems and compare it to the amount of disk available from the VM. In this article, the term allocated applies to disk that is assigned to filesystems or swap space. The term unallocated applies to disk sectors that are not assigned to a partition, partitions that are not assigned to a logical volume, and logical volumes that are not being used for filesystems or swap space. The term available disk storage is the combination of the allocated and unallocated disk space for the VM.
If the VM does not include enough available storage, you can reconfigure it to include more. For more information, see Increase Available VM Storage, below.
If the VM contains storage that is available but not allocated, you can reconfigure components of the disk and the operating system so that the /var filesystem can use the storage. For more information, see Allocate Disk Storage, below.
Display Allocated Disk Space
You can display a list of filesystem disk usage from the Director GUI or a shell on the Director node.
For Releases 22.1.1 and later, to display allocated disk space from the Director GUI, select the Monitor tab and then select Director in the Organization drop-down menu.
For Releases 21.2 and earlier, to display allocated disk space from the Director GUI, select Administration > System > Resource.
To display allocated disk space from a shell on the Director node, issue the Linux df –kh command.
admin@Director$ df -kh Filesystem Size Used Avail Use% Mounted on /dev/mapper/system-root 45G 4.8G 40.0G 8% / none 4.0K 0 4.0K 0% /sys/fs/cgroup udev 3.9G 12K 3.9G 1% /dev tmpfs 799M 692K 798M 1% /run none 5.0M 0 5.0M 0% /run/lock none 3.9G 4.0K 3.9G 1% /run/shm none 100M 0 100M 0% /run/user /dev/sda1 922M 104M 771M 12% /boot /dev/mapper/system-opt 30G 2.4G 26G 9% /opt /dev/mapper/system-var 76G 8G 68G 11% /var
The df –kh command may display a link to a logical volume device file instead of displaying the device file directly. In this case, you can find the logical volume name using the ls –l command. For example, if the df –kh command shows device file /dev/mapper/system-var (highlighted in the output above), the ls –l command shows that /dev/mapper/system-var is a link to device file /dev/dm-2, so therefore the /var filesystem is stored on logical volume dm-2.
admin@Director$ ls -l /dev/mapper/system-var
lrwxrwxrwx 1 root root 7 Mar 29 2021 /dev/mapper/system-var -> ../dm-2
Display Partitions and Logical Volumes
The /var filesystem is stored on a logical volume, which maps to one or more portions of partitions on VM 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 159.8 GB is assigned to this disk. Partition 3 (sda3) contains 9.8 GB of storage and stores a portion of the /var filesystem. Partition 5 (sda5) contains about 146.6 GB of storage and maps to four logical volumes: logical volume dm-0 holds system swap space, dm-1 holds the /opt filesystem, dm-2 holds part of the /var filesystem, and dm-3 holds the root filesystem. Logical volume dm-2 contains 76 GB of storage; 9.8 GB of this is stored on sda3 and the rest is stored on sda5.
admin@Director$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT fd0 2:0 1 4K 0 disk sda 8:0 0 159.8G 0 disk ├─sda1 8:1 0 1.5G 0 part /boot ├─sda2 8:2 0 1K 0 part ├─sda3 8:3 0 9.8G 0 part │ └─system-var (dm-2) 253:2 0 76.0G 0 lvm /var └─sda5 8:5 0 146.6G 0 part ├─system-swap_1 (dm-0) 253:0 0 4.6G 0 lvm [SWAP] ├─system-opt (dm-1) 253:1 0 30.3G 0 lvm /opt ├─system-var (dm-2) 253:2 0 76.0G 0 lvm /var └─system-root (dm-3) 253:3 0 45.5G 0 lvm /
Display Total Available VM Disk Storage
To display information about storage available to the VM, issue the sudo fdisk –l 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 257 GB in size. The example lsblk command, above, shows that approximately 159.8 GB of this disk space is allocated to filesystems and swap space, and therefore some of this VM's available storage is not being used.
admin@Director$ sudo fdisk -l Disk /dev/sda: 257.0 GB, 275951648768 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:
- Shut down the VM for the Director node.
- To increase the disk size on the VM for the Director node, 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 a Director qemu image by 10 GB, issue the following command:
sudo qemu-img resize /home/versa/versa-director-cc0012d-21.2.1.qcow2 +10G
- Restart the VM for the Director node.
- Log in to the VM and issue the sudo fdisk –l command to display the increased disk size.
Allocate Disk Storage
To allocate available storage from your VM to the /var filesystem, you add a new partition to the logical volume on which the /var 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 /var 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 /var filesystem's logical volume.
- Resize the /var filesystem:
- Extend the /var filesystem's logical volume.
- Update the /var filesystem's data structures so that they can access the extended space.
Configure a New Partition
To configure a new partition using the available disk space:
- 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, including its current partitions and free space.
admin@Director$ sudo cfdisk /dev/sda![]()
- 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.
- Use the right and left arrow keys to highlight New in the menu at the bottom of the screen.
- Press the Enter key. You are prompted to select a partition type.
- Use the arrow keys to highlight Primary, and then press the Enter key. The Partition Size prompt displays.
- Enter a size for the new partition and then press the Enter key. The cfdisk utility selects a partition number and then adds the partition to the in-memory partition table.
- By default, the cfdisk utility creates the new partition with filesystem type Linux. To change this to type Linux LVM, use the arrow keys to highlight Type in the menu at the bottom of the screen, then press Enter.
- When you are prompted to enter the filesystem type, enter 8e and then press Enter.
The filesystem type changes to Linux LVM.
- Use the arrow keys to highlight Write, and then press Enter.
- When prompted to save your changes, type yes and then press Enter. The edited partition table is saved to the disk.
- Use the arrows keys to highlight Quit, and then press Enter to exit the cfdisk utility.
- Reboot the node. Note that a reboot is not required for nodes running Ubuntu 18.04 (Bionic).
- 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 sda4 and its device filename is /dev/sda4.
admin@Director$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 257.4G 0 disk
├─sda1 8:1 0 1.5G 0 part /boot
├─sda2 8:2 0 1K 0 part
├─sda3 8:3 0 9.8G 0 part
│ └─system-var (dm-2) 253:2 0 76.0G 0 lvm /var
├─sda4 8:4 0 97.7G 0 part
└─sda5 8:5 0 138.5G 0 part
├─system-swap_1 (dm-0) 253:0 0 4.6G 0 lvm [SWAP]
├─system-opt (dm-1) 253:1 0 30.3G 0 lvm /opt
├─system-var (dm-2) 253:2 0 76.0G 0 lvm /var
└─system-root (dm-3) 253:3 0 45.5G 0 lvm /
Initialize the New Partition
To initialize the new partitions, issue the sudo pvcreate device-filename command. Use the device filename from Step 13 in Configure a New Partition, above. For example:
admin@Director$ sudo pvcreate /dev/sda4 Physical volume "/dev/sda4" successfully created
Add the Partition to a Volume Group
Before you can extend the /var filesystem, you must add the new partition to a volume group.
To add the new partition to the /var filesystem's volume group:
- To display the existing volume group configuration, issue the sudo vgdisplay command. Typically, the node contains only the volume group named "system".
admin@Director$ sudo vgdisplay
--- Volume group ---
VG Name system
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 79.76 GiB
PE Size 4.00 MiB
Total PE 20418
Alloc PE / Size 20407 / 79.71 GiB
Free PE / Size 11 / 44.00 MiB
VG UUID G0NpQi-25bT-KXjI-i31P-KQlp-neQT-jWxpBL
- 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@Director$ sudo vgextend system /dev/sda4 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
To extend the logical volume:
- To increase the size of the logical volume for the /var filesystem, issue the lvextend command. The command uses the device file /dev/system/var, which is a link to the logical volume device file for the /var filesystem, which, in this example, is /dev/dm-2. 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 4 to logical volume dm-2.
admin@Director$ sudo lvextend -l+100%FREE /dev/system/var
- 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-2 (system-var) now includes partition 4.
admin@Director$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT fd0 2:0 1 4K 0 disk sda 8:0 0 257.4G 0 disk ├─sda1 8:1 0 1.5G 0 part /boot ├─sda2 8:2 0 1K 0 part ├─sda3 8:3 0 9.8G 0 part │ └─system-var 253:2 0 175.6G 0 lvm /var ├─sda4 8:4 0 97.7G 0 part <--- New space │ └─system-var 253:2 0 175.6G 0 lvm /var └─sda5 8:5 0 148.5G 0 part ├─system-swap_1 253:0 0 4.6G 0 lvm [SWAP] ├─system-opt 253:1 0 30.3G 0 lvm /opt ├─system-var 253:2 0 175.6G 0 lvm /var └─system-root 253:3 0 45.5G 0 lvm /
Extend the /var Filesystem
To have the /var filesystem use the additional storage, you update data structures to resize the filesystem.
To resize the /var filesystem:
- Issue the resize2fs command. This command uses the device file /dev/mapper/system-var, which is a link to the device file for the /var filesystem, in this example, /dev/dm-2.
admin@Director$ sudo resize2fs /dev/mapper/system-var
- To verify that the /var filesystem has been allocated additional disk space, issue the df –kh command. In the example below, the /var filesystem size is now 173 GB.
admin@Director$ df -kh
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 797M 8.9M 788M 2% /run
/dev/mapper/system-root 45G 3.1G 40G 8% /
tmpfs 3.9G 40K 3.9G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda1 1.5G 116M 1.3G 9% /boot
/dev/mapper/system-opt 30G 2.4G 26G 9% /opt
/dev/mapper/system-var 173G 6.6G 159G 4% /var <--Increased storage
The Administration > System > Resource screen in the Director GUI also displays the increased storage. In the following example, the output verifies that the size of the /var filesystem has increased.
Supported Software Information
Releases 20.2 and later support all content described in this article, except:
- For Releases 22.1.1 and later, to display allocated disk space from the Director GUI, you select the Monitor tab and then select Director in the Organization field.