Function: vRA Machine Snapshot Revert

by Simon Sparks · 3 April 2026

To use this function add it to the class library file named PluginVRAService.ts

GitHub Repository: https://github.com/SimonSparksUK/Orchestrator

Filename: PluginVRAService.ts

Description: Orchestrator Function to Revert To a Machine Snapshot

Public Function: MachineSnapshotRevert

publicMachineSnapshotRevert(objVraSnapshot:VraSnapshot):VraRequestTracker{

letstrInternalId:string=objVraSnapshot.internalIdString;
letarrInternalId:string[]=strInternalId.split(",");

letstrMachineKey:string=arrInternalId[1];
letstrSnapshotKey:string=arrInternalId[2];

letstrVraMachineId:string=strMachineKey.split(":")[1];
letstrVraSnapshotId:string=strSnapshotKey.split(":")[1];

letobjVraHost:VraHost=objVraSnapshot.host;

letobjVraInfrastructureClient:VraInfrastructureClient=objVraHost.createInfrastructureClient();

// @ts-ignore
letobjVraMachineService:VraMachineService=objVraInfrastructureClient.createMachineService();

letobjVraRequestTracker:VraRequestTracker=objVraMachineService.revertMachineSnapshot(strVraMachineId,strVraSnapshotId);

returnobjVraRequestTracker;
}
TypeScript

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like