VMware Orchestrator Tips: Dynamically Viewing Snapshots Based on Selected VMs

Kinney Group’s own Troy Wiegand hosts this video blog series, which will outline some helpful VMware Orchestrator tips. Join Troy as he applies his automation engineering expertise to shed some light on VMware! 

One of the impressive capabilities of VMware vRealize Orchestrator (vRO), a tool that creates workflows to automate IT operations, is the snapshot feature. Have you ever had to manipulate or manage multiple snapshots on different Virtual Machines (VMs), all at the same time? It may seem like the only option is to revert or delete multiple snapshots. Maybe this has led you to revert VMs to snapshots with the same name, or to delete more than you intended. Kinney Group engineers use this simple method to view various snapshots using selected VMs. 

The Secret Menu

Begin with an array input by clicking “Run.” Populate the array with your selected VMs using the dropdown list and click “apply.” When the window closes, hover your cursor over the field just below the list of VMs, and you’ll see a gray dropdown bar appear. This subtle menu feature identifies snapshots attached to each VM! Select one from the dropdown and click “Run.”  

Figure 1 – The gray menu appears as a dropdown when the user hovers over it

The resulting schema populates with a script that reveals the snapshots. From this script, users can delete or revert all snapshots.  

Return to the Input Form to see how we populated these VM names. The “Appearance” tab on the left indicates that the display type we used is a DropDown. Our value options came from an external source, the action specifying “get all snapshots of all VMs.” 

Figure 2 – select “DropDown” as the Display type in the Appearance tab and “external source” in the Values tab

Branching off with Trees

Snapshots are done through trees. For example, you could perform x, y, and z action, then take a snapshot to preserve the state of that VM. This will be saved in a tree structure, with the snapshot containing x, y, and z actions taken. The snapshot you take after performing another action will capture the updated workflow. Working with multiple snapshots allows you to track various changes in the environment, and presents the opportunity to revert to a previous state.

Figure 3 – The action exhausts all snapshot trees

Let’s revisit the action. We’ve fed in the VM array as an input. For all VMs, we ask, “Do we have any snapshots?” If so, we can go through the snapshot tree and run the function on all trees. To get all of our snapshots by name, we must go recursively through the tree structure. A function to do just that is included in the array. This function will loop through the array until it exhausts all trees, after which the resultant snapshots will be captured within the array. A string array will return the snapshots back to our workflow execution input form.

What’s in a Name?

You may be asking: why are we looking at the name rather than the actual snapshot object? The reason for this is that despite the items sharing a name, there will be many different objects. The only way to perform mass operations on our selected VM based off of one snapshot name would be to feed it a singular snapshot. This workaround also allows you to have different behavior based on the names. For instance, if all VMs and questions have a specified baseline snapshot, and you wanted to revert all snapshots to that standard, you could invoke different behavior. You could specify whether you wanted the first snapshot that fit the baseline or the last one. In the scheme of the workflow, the snapshots could go either way.

If your aim is to delete snapshots, you could ask the same question: why look at the name rather than the snapshot object? This method allows you to specify if you want to keep or delete multiple snapshots or only ones with certain properties. You may be in a situation where you’ve given multiple snapshots the same name, and you may only want the first few or most recent few snapshots. Pruning like this will save more space in the data store. (Note: This utility can also be combined with a dual list picker to select the VMs differently than in a standard array.)

A Snapshot is Worth a Thousand Data Points

Applying this KGI utility for VMware Orchestrator in your own workflows makes snapshot management and manipulation a breeze!

We hope you got some inspiration for your own workflows. Stay tuned for more VMware Orchestrator tips! There’s plenty more to come from the blog and on our YouTube channel. In the meantime, fill out the form below to get in touch with automation experts like Troy:

Author

Start typing and press Enter to search