To use this function add it to the class library file named vCenterServerService.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: vCenterServerService.ts
Function: SnapshotCreate
publicSnapshotCreate(objVcVirtualMachine:VcVirtualMachine,strName:string,blnMemory:boolean=false,blnQuiesce:boolean=false):VcTask{
letobjDate:Date=newDate();
letstrTimestamp:string=System.formatDate(objDate,"YYYY-MM-dd HH:mm:ss");
letstrDescription:string=`Snapshot taken on${strTimestamp} with Memory${blnMemory?"On":"Off"}) and Quiesce${blnQuiesce?"On":"Off"}`;
letobjVcTask:VcTask=objVcVirtualMachine.createSnapshot_Task(strName,strDescription,blnMemory,blnQuiesce);
returnobjVcTask;
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
