Function: vRA Machine Snapshot Delete

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

Public Function: MachineSnapshotDelete

public MachineSnapshotDelete(objVraSnapshot: VraSnapshot): VraRequestTracker {

    let strInternalId: string = objVraSnapshot.internalIdString;
    let arrInternalId: string[] = strInternalId.split(",");

    let strMachineKey: string = arrInternalId[1];
    let strSnapshotKey: string = arrInternalId[2];

    let strVraMachineId: string = strMachineKey.split(":")[1];
    let strVraSnapshotId: string = strSnapshotKey.split(":")[1];

    let objVraHost: VraHost = objVraSnapshot.host;

    let objVraInfrastructureClient: VraInfrastructureClient = objVraHost.createInfrastructureClient();

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

    let objVraRequestTracker: VraRequestTracker = objVraMachineService.deleteMachineSnapshot(strVraMachineId, strVraSnapshotId);

    return objVraRequestTracker;
}
TypeScript

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like