To use this function add it to the class library file named vRealizeAutomation.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: vRealizeAutomation.ts
Function registerVCACVirtualMachine
Description: The following code Registers a VCAC Virtual Machine.
public registerVCACVirtualMachine (strOwner: string, objVCACEntityHostReservationToStorage: VCACEntity, objVCACEntityVirtualMachine: VCACEntity, objVCACEntitySystemBlueprint: VCACEntity, objVCACEntityHostReservation: VCACEntity, objVCACVirtualMachine: vCACVirtualMachine): void
{
let strTemplateID: string = objVCACEntitySystemBlueprint.getProperty("VirtualMachineTemplateID");
let strHostReservationID: string = objVCACEntityHostReservation.getProperty("HostReservationID");
let strHostStorageReservationID: string = objVCACEntityHostReservationToStorage.getProperty("HostReservationToStorageID");
System.log("===== Template ID '" + strTemplateID + "'.");
System.log("===== Host Reservation ID '" + strHostReservationID + "'.");
System.log("===== Host Storage Reservation ID '" + strHostStorageReservationID + "'.");
let objPropertiesArguments: Properties = new Properties();
objPropertiesArguments.put("user", strOwner);
objPropertiesArguments.put("identityUser", strOwner);
objPropertiesArguments.put("templateId", strTemplateID);
objPropertiesArguments.put("hostReservationId", strHostReservationID);
objPropertiesArguments.put("hostStorageReservationId", strHostStorageReservationID);
objVCACVirtualMachine.registerVm(objPropertiesArguments, null);
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
