VAST API EXAMPLE: Connecting to the VMS

Hey everyone! :waving_hand:

I’m excited to share that we’ve got a bunch of new example scripts ready for you to try out. I’ll go over what we have in the Cosmos Labs GitHub repo, and we’ll start with Example 1 which is all about getting connected to your VAST Management System - and honestly, it’s pretty slick how much info you can pull with just a few lines of code.

What’s it do?

The script does a simple connection test to verify you can reach your VAST cluster, and then it goes ahead and dumps a ton of useful capacity information such as:

  • Data reduction ratios (always fun to see how much space you’re saving!)

  • Physical vs usable vs logical capacity breakdowns

  • Usage percentages with both usable and logical data views

  • Auxiliary space (snapshots, pending deletes, etc.)

  • Metadata and inode usage stats

The cool part?

It automatically handles the connection details from your config files, so you just run it and get a nice dashboard-style view of your cluster health. No more manually checking the UI for basic capacity info!

Try it out

First, clone the repo:

git clone https://github.com/vast-data/cosmos-labs/

Then copy and edit the config.yaml.example and secrets.yaml.example files to contain your connection info.

Make sure you have all requirements

pip install -r requirements.txt

And finally run the script!

python3 examples/01_connect_to_vast.py

The script uses our vastpy client under the hood, so it’s a great way to see how the Python SDK works in practice. Plus, it’s got some nice error handling if your connection isn’t quite right.

Anyone else find themselves constantly checking cluster capacity? This might save you a few clicks! :grinning_face_with_smiling_eyes:

Let me know if you run into any issues or if you’d like to see other examples. We’ve got a few more in the pipeline that should be pretty useful for day-to-day VAST management.


P.S. - The script is part of our self-hosted labs collection, so you can run it against your own VAST cluster without any external dependencies.