How to identify which VMs in a Tanzu deployment were most recently recreated
search cancel

How to identify which VMs in a Tanzu deployment were most recently recreated

book

Article ID: 372558

calendar_today

Updated On:

Products

VMware Tanzu Application Service VMware Tanzu Application Service for VMs VMware NSX-T Advanced for VMware Tanzu Application Service Term License (50 pack Application Instance) Ops Manager

Issue/Introduction

During troubleshooting of issues on the Tanzu platform, VMs may be recreated. It may be helpful to quickly list which VMs were recreated. 

Environment

Tanzu platform

Ubuntu Linux VMs

The following command line utilities are needed:

bosh

jq

sort (should be included in any Linux distribution)

Resolution

bosh vms --vitals --json | jq '.Tables[].Rows[] | "\(.vm_created_at)',' \(.instance)"' --raw-output | sort -k6n -k2M -k3n -k4n

This lists the VMs under bosh control, in JSON format. The output is parsed using jq and selects just the values for VM creation time and instance name, then sorts numerically on the fields of the creation time (first year, then month, then day, then time).

If desired, you can also use the -d option to restrict the output to a single deployment, such as TAS.