Note: this article describes how to extend disk space in Apstra versions *prior* to 4.1.2. From 4.1.2 onward the aos_extend_disk utility can be used. Refer to the Installation and Upgrade guide for details.When using any supported version of Juniper Apstra, you may be filling up the available space in the default Juniper Apstra server "root" disk partition by uploading several OS images to it. The uploaded OS images will then share the Juniper Apstra server "root" disk partition along with other functions. However, filling up the disk partition may have an impact on the operation of the server.
This article details how to check for issues with the Juniper Apstra server "root" disk partition utilization, and provides methods to resolve any problems thus identified, including adding space to the Juniper Apstra server "root" disk partition.
In general, the Juniper Apstra server manages the utilization of disk partitions on the Juniper Apstra server virtual machine (VM). The VM's disk partitions are sized for normal operations but not sized to hold too many uploaded OS images. Depending on the size of the image, as few as four uploaded images may cause disk utilization issues.
Therefore, if you are unable to upload an OS image, you can check the status of the disk partitions.
From the Apstra UI, go to Platform > AOS/Apstra Cluster and click the controller node. Any errors will be shown. Then check the disk usage for the aos--server--vg-root partition.
From the Juniper Apstra server Linux CLI, use the df -m command and check the Use percentage for the /dev/mapper/aos--server--vg-root partition.
admin@aos-server:~$ df -mFilesystem 1M-blocks Used Available Use% Mounted onudev 7997 0 7997 0% /devtmpfs 1604 10 1595 1% /run/dev/mapper/aos--server--vg-root 11224 10319 316 98% /tmpfs 8020 0 8020 0% /dev/shmtmpfs 5 0 5 0% /run/locktmpfs 8020 0 8020 0% /sys/fs/cgroup/dev/mapper/aos--server--vg-var 27153 2527 23225 10% /var/dev/sda1 1890 118 1659 7% /boot/dev/mapper/aos--server--vg-var+log 13150 204 12258 2% /var/log/dev/mapper/aos--server--vg-var+lib+aos+db 22940 52 21701 1% /var/lib/aos/db/dev/sr0 1 1 0 100% /media/cdromtmpfs 1604 0 1604 0% /run/user/1001admin@aos-server:~$
We see many cases where the VM has multiple backup files. Those should be copied to external server then deleted to reduce the disk utilization.
admin@aos-server:~$ sudo du /var/lib/aos/snapshot/1387520 /var/lib/aos/snapshot/2024-10-21_00_01_231387526 /var/lib/aos/snapshot/2024-10-22_00_01_181387531 /var/lib/aos/snapshot/2024-10-23_00_01_221387538 /var/lib/aos/snapshot/2024-10-24_00_01_191387546 /var/lib/aos/snapshot/2024-10-25_00_01_236937670 /var/lib/aos/snapshot/admin@aos-server:~$
To verify that OS images are the reason for disk utilization, use the du command and check that the disk space used by the /opt/aos/frontend/www/dos_images/ directory corresponds to the increased partition utilization.
admin@aos-server:~$ sudo du /opt/aos/frontend/www/dos_images/5496996 /opt/aos/frontend/www/dos_images/admin@aos-server:~$
You can also use the ncdu command to explore filesystem utilization. e.g. You may have some files saved under /home/admin directory.
If you are experiencing high disk utilization but have not uploaded any OS images to your Juniper Apstra server, contact Juniper Support for assistance.
If you are experiencing high disk utilization on your Juniper Apstra server due to multiple uploaded OS images, it is recommended that you immediately correct this by deleting one or more OS images and freeing up disk space. Alternatively, you can register an OS image URL instead of uploading the OS image to the Juniper Apstra server.
If you wish to add available disk space to the Juniper Apstra server "root" disk partition, you can use the following procedure. Note that it is assumed here that your Juniper Apstra server VM is running on a VMware ESXi server managed by vSphere. The procedure for a Linux KVM will be similar. Contact Juniper Support for more information.
This procedure can be carried out while the Juniper Apstra server VM is running, without any impact to the Juniper Apstra server or the managed network.
In VMware vSphere, edit the setting for the Juniper Apstra server VM. Under Virtual Hardware, add a new Hard Disk device.
For KVM follow thebelow steps to add disk space to the Apstra VM
a. virsh list ( to check the Apstra server name ) b. virsh dumpxml <server-name> | more ( to check the source file installed path ) c. qemu-img create -f qcow2 /var/lib/libvert/images/aos-server-v412-disk-extend 30G d. Go to 4.1.2 & 4.2.2 server and check "lsblk" output e. virsh attach-disk aos-server-v412 /var/lib/libvirt/images/aos-server-v412-disk-extend vdb --driver=qemu --subdriver=qcow2 --persistent ( execute this for both 4.1.2 and 4.2.2 ) f. Go to 4.1.2 & 4.2.2 server and check "lsblk" output
g. Now follow the below steps as given below to mount/add the space to the partition
After vCenter has completed the VM change, use the Juniper Apstra server Linux CLI dmesg command to verify that the new disk is available. Note the disk device (for example sdb).
admin@aos-server:~$ sudo dmesg | tail[673451.645443] scsi target2:0:0: FAST-40 WIDE SCSI 80.0 MB/s ST (25 ns, offset 127)[673451.646392] sd 2:0:0:0: [sdb] 83886080 512-byte logical blocks: (42.9 GB/40.0 GiB)[673451.646412] sd 2:0:0:0: [sdb] Write Protect is off[673451.646413] sd 2:0:0:0: [sdb] Mode Sense: 61 00 00 00[673451.646425] sd 2:0:0:0: [sdb] Cache data unavailable[673451.646426] sd 2:0:0:0: [sdb] Assuming drive cache: write through[673451.646758] sd 2:0:0:0: Attached scsi generic sg2 type 0[673451.648034] sd 2:0:0:0: [sdb] Attached SCSI diskadmin@aos-server:~$
Verify that the new disk is empty by using the fdisk command and ensure that no disk device partitions (for example /dev/sdb1) are listed.
admin@aos-server:~$ sudo fdisk -l /dev/sdbDisk /dev/sdb: 40 GiB, 42949672960 bytes, 83886080 sectorsUnits: sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesadmin@aos-server:~$
Partition the new disk (for example sdb) with a single Linux LVM partition by using the fdisk command.
admin@aos-server:~$ sudo fdisk /dev/sdbWelcome to fdisk (util-linux 2.31.1).Changes will remain in memory only, until you decide to write them.Be careful before using the write command.Device does not contain a recognized partition table.Created a new DOS disklabel with disk identifier 0xfb2af457.Command (m for help): nPartition typep primary (0 primary, 0 extended, 4 free)e extended (container for logical partitions)Select (default p): pPartition number (1-4, default 1): [ENTER]First sector (2048-83886079, default 2048): [ENTER]Last sector, +sectors or +size{K,M,G,T,P} (2048-83886079, default 83886079): [ENTER]Created a new partition 1 of type 'Linux' and of size 40 GiB.Command (m for help): tSelected partition 1Hex code (type L to list all codes): 8eChanged type of partition 'Linux' to 'Linux LVM'.Command (m for help): wThe partition table has been altered.Calling ioctl() to re-read partition table.Syncing disksadmin@aos-server:~$
Use the vgextend command to add the new partition to the aos-server-vg LVM Volume Group.
admin@aos-server:~$ sudo vgextend aos-server-vg /dev/sdb1Physical volume "/dev/sdb1" successfully created.Volume group "aos-server-vg" successfully extendedadmin@aos-server:~$
Use the vgdisplay command to verify that the new space is made available in the Volume Group. Note the available "Free PE" (for example 10239).
admin@aos-server:~$ sudo vgdisplay--- Volume group ---VG Name aos-server-vgSystem IDFormat lvm2Metadata Areas 2Metadata Sequence No 7VG Access read/writeVG Status resizableMAX LV 0Cur LV 5Open LV 5Max PV 0Cur PV 2Act PV 2VG Size 118.08 GiBPE Size 4.00 MiBTotal PE 30229Alloc PE / Size 19990 / <78.09 GiBFree PE / Size 10239 / <40.00 GiB VG UUID Hu46hG-tjKZ-9T4i-pL2w-UI20-SuRb-XUVXFradmin@aos-server:~$
Use the lvextend command with the "Free PE" value to add the new space to the "root" LVM Logical Volume.
admin@aos-server:~$ sudo lvextend -l +10239 /dev/aos-server-vg/rootSize of logical volume aos-server-vg/root changed from <11.20 GiB (2867 extents) to <51.20 GiB (13106 extents).Logical volume aos-server-vg/root successfully resized.admin@aos-server:~$
Use the resize2fs command to resize the filesystem.
admin@aos-server:~$ sudo resize2fs /dev/aos-server-vg/rootresize2fs 1.44.1 (24-Mar-2018)Filesystem at /dev/aos-server-vg/root is mounted on /; on-line resizing requiredold_desc_blocks = 2, new_desc_blocks = 7The filesystem on /dev/aos-server-vg/root is now 13420544 (4k) blocks long.admin@aos-server:~$
Finally, use the df -m command to verify that the new space is available on the Juniper Apstra server "root" disk partition.
admin@aos-server:~$ df -mFilesystem 1M-blocks Used Available Use% Mounted onudev 7997 0 7997 0% /devtmpfs 1604 10 1595 1% /run/dev/mapper/aos--server--vg-root 51540 8989 40326 19% /tmpfs 8020 0 8020 0% /dev/shmtmpfs 5 0 5 0% /run/locktmpfs 8020 0 8020 0% /sys/fs/cgroup/dev/mapper/aos--server--vg-var 27153 2527 23225 10% /var/dev/sda1 1890 118 1659 7% /boot/dev/mapper/aos--server--vg-var+log 13150 208 12254 2% /var/log/dev/mapper/aos--server--vg-var+lib+aos+db 22940 52 21701 1% /var/lib/aos/db/dev/sr0 1 1 0 100% /media/cdromtmpfs 1604 0 1604 0% /run/user/1001admin@aos-server:~$
Note: This same procedure can be used to increase the disk space on the other LVM partitions on the Juniper Apstra server (for example var).
Note: Other methods such as https://kb.vmware.com/s/article/1006371 [(Extending a logical volume in a virtual machine running Red Hat or Cent OS (1006371)] might be possible. Please contact VMWARE for detail and support.
2023-02-03: Added a note about another method to extend a logical volume2024-02-26: adding a note about the 'aos_extend_disk' utility and Apstra version
2025-10-17 : Adding KVM section to add space to Apstra-VM