Sometime you may see a warning on your Versa Director's screen about the disk utilization. Warning will be shown if any of the Director partitions are utilized for more than 70%.


To clean up some disk space you can use any of the following steps:


- Clean up logs under the /var/log/vnms folder.

You can either selectively delete logs which you don't use (if you know what you're doing) or just delete old logs, which were archived. To delete all archived logs, please run following command: sudo find /var/log/vnms -name "*.gz" -delete



- Delete old packages which you don't need anymore.

You may have some old upgrade packages from Versa Director and/or VOS remaining on the Director.

Images uploaded through the GUI can be deleted from Administration->Inventory->Images in the Versa Director's GUI.

Images manually uploaded through the CLI can be selectively deleted from the /var/versa/packages/vnms and /var/versa/packages/device/



- Delete old SPACKs and OSSPacks.

You may delete old SPACKs and OSSPacks to free up some space on your Versa Director. You can delete them from the Director's GUI in the Administration->Inventory->Security Packages and Administration->Inventory->OS Security Packages.

If the GUI is not available due to high disk utilization (100%) you can manually delete those unnecessary SPACKs and OSSPacks from /var/versa/packages folder.



- Delete everything under /var/tmp and /tmp.

To remove content of the above folders please use following commands: rm -rf /var/tmp/* /tmp/*



- Copy the backup files outside of versa director and delete all backup files older than 2 days. Backup are stored in the /var/versa/backups.


- Check which directories are taking a lot of disk space.

To do this you can use command sudo du -hd 1 <PATH> 2>/dev/null

Example:



- Clean up postgres database.

To check how much disk space is consumed by PostgreSQL you can use following command: sudo du -kh -d1 /var/lib/postgresql/9.5/main/

After you identified that postgres is taking too much space on your hard drive you can use following procedure to cleanup the DB:

- Run command sudo su - postgres

- Execute following command: /usr/lib/postgresql/9.5/bin/pg_controldata /var/lib/postgresql/9.5/main | grep "REDO WAL file"


Example:


- The output from the previous command should be used in the following command: pg_archivecleanup -d /var/lib/postgresql/9.5/main/pg_xlog 000000010000000000000012



Permanent solution to decrease the amount of archives generated (restart of director is needed after below steps):
In /etc/postgresql/9.5/main/postgresql.streaming.conf and /opt/versa/vnms/etc/conf/postgre/postgresql.streaming.conf please modify the following lines.

archive_mode = on >>>>>>>> existing entry (line 35)
archive_mode = off >>>>>>>> modified entry (line 35)

archive_command = '/bin/true' >>>>>>>> existing entry (line 41)
archive_command = '' >>>>>>>> modified entry (line 41)


Another permanent solution can be to increase disk space.

Please refer to the following article to learn how to increase the size of the disk on Versa Director: https://docs.versa-networks.com/Management_and_Orchestration/Versa_Analytics/Configuration/Manage_Versa_Analytics_VM_Storage#Expand_Disk_Space