Function: vRA Machine 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

Public Function: MachineCreate

public MachineCreate(objVraProject: VraProject, intMachineCount: number, strName: string, strDescription: string, strFlavor: string, strImage: string, strFlavorRef: string, strImageRef: string, arrTag: string[], arrConstraint: string[], objPropertiesCustom: Properties, strMachineBootConfig: string, strAuthentication: "usernamePassword" | "publicPrivateKey" | "generatedPublicPrivateKey" | "keyPairName", strUsername: string, strPassword: string, strSSHKey: string, strKeyPair: string, blnPhoneHomeShouldWait: boolean = false, blnPhoneHomeFailOnTimeout: boolean = false, intPhoneHomeTimeoutSeconds: number = 600): VraMachine {

    let objVraHost: VraHost = objVraProject.host;

    let objVraInfrastructureClient: VraInfrastructureClient = objVraHost.createInfrastructureClient();

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

    let objVraMachineSpecification: VraMachineSpecification = this.buildVraMachineSpecification(objVraProject, intMachineCount, strName, strDescription, strFlavor, strImage, strFlavorRef, strImageRef, arrTag, arrConstraint, objPropertiesCustom, strMachineBootConfig, strAuthentication, strUsername, strPassword, strSSHKey, strKeyPair, blnPhoneHomeShouldWait, blnPhoneHomeFailOnTimeout, intPhoneHomeTimeoutSeconds);

    let objVraMachine: VraMachine = objVraMachineService.createMachine(objVraMachineSpecification);

    return objVraMachine;
}
TypeScript

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like