Function: vRA Machine Snapshot Create

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 Create a Machine Snapshot

Public Function: MachineSnapshotCreate

publicMachineSnapshotCreate(objVraMachine:VraMachine,strName:string,strDescription:string,blnSnapshotMemory:boolean=false):VraRequestTracker{

letobjVraHref:VraHref=newVraHref();
objVraHref.addHrefsItem(objVraMachine.id);

letobjVraSnapshotSpecification:VraSnapshotSpecification=newVraSnapshotSpecification();
objVraSnapshotSpecification.name=strName;
objVraSnapshotSpecification.description=strDescription
objVraSnapshotSpecification.id=objVraMachine.id;
objVraSnapshotSpecification.snapshotMemory=blnSnapshotMemory;
objVraSnapshotSpecification.putLinksItem("snaphostHref",objVraHref);

letobjVraHost:VraHost=objVraMachine.host;

letobjVraInfrastructureClient:VraInfrastructureClient=objVraHost.createInfrastructureClient();

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

letobjVraRequestTracker:VraRequestTracker=objVraMachineService.createMachineSnapshot(objVraMachine.id,objVraSnapshotSpecification);

returnobjVraRequestTracker;
}
TypeScript

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like