Technology
Back to Technology
MSSQL Script To List All VMWare Snapshots

By: Gordon Rankine
Published: 24 Apr 2014 22:45

This is a simple MSSQL script to list all snapshots in your VMWare environment. Just copy the code below into SQL Server Management Studio (SSMS) and run against your VMware virtual infrastructure database.


SELECT
vpx_entity.name,
vpx_snapshot.snapshot_name,
vpx_snapshot.snapshot_desc,
vpx_snapshot.is_current_snapshot,
vpx_snapshot.create_time
FROM vpx_snapshot
INNER JOIN vpx_entity
ON vpx_snapshot.vm_id=vpx_entity.id
ORDER BY name, snapshot_name



The column is_current_snapshot will either have a value of 1 (current snapshot) or 0 (not the current snapshot).

Please note: This has only been tested against vSphere version 4. Other versions may be different.

The results will look similar to the screenshot below:

VMWare Snapshot Results

Disclaimer: This script is provided as is without any warranty. You are responsible for running this script and I will not be held accountable for any data loss or issues arising from this script.


Add Comment

VMWare   SQL Queries   Snapshots   Scripts   MSSQL

Back to Technology