Orchestrator Function: vCenter Virtual Machine Check Compatibility with Destination

by Simon Sparks · 21 February 2026

To use this function add it to the class library file named PluginVCVirtualMachineService.ts

GitHub Repository: https://github.com/SimonSparksUK/Orchestrator

Filename: PluginVCVirtualMachineService.ts

Description: Orchestrator Function to check the compatibility of a vCenter Virtual Machine with the destination before executing a vMotion operation.

Private Function: CheckCompatibility

privateCheckCompatibility(objVcVirtualMachine:VcVirtualMachine,objVcHostSystem:VcHostSystem,objVcResourcePool:VcResourcePool):void{

letobjVcSdkConnection:VcSdkConnection=objVcVirtualMachine.sdkConnection;

letobjVcVirtualMachineCompatibilityChecker:VcVirtualMachineCompatibilityChecker=objVcSdkConnection.vmCompatibilityChecker;

letarrTestType:string[]= ["datastoreTests","hostTests","networkTests","resourcePoolTests","sourceTests"];

letobjVcTask:VcTask=objVcVirtualMachineCompatibilityChecker.checkCompatibility_Task(objVcVirtualMachine,objVcHostSystem,objVcResourcePool,arrTestType);

objVcTask=this.WaitForVcTaskEnd(objVcTask,1);

letobjVcTaskInfo:VcTaskInfo=objVcTask.info;

letobjVcTaskInfoState:VcTaskInfoState=objVcTaskInfo.state;

letobjVcLocalizedMethodFault:VcLocalizedMethodFault=objVcTaskInfo.error;

letobjVcMethodFault:VcMethodFault=objVcLocalizedMethodFault.fault;

if (objVcTaskInfoState===VcTaskInfoState["error"]&&objVcMethodFault){
this.objLogger.info(`${objVcTaskInfoState.name}`);
this.objLogger.info(`${objVcTaskInfoState.value}`);

this.objLogger.info(`${objVcLocalizedMethodFault.localizedMessage}`);
this.objLogger.info(`${objVcLocalizedMethodFault.message}`);

this.objLogger.info(`${objVcMethodFault.localizedMessage}`);
this.objLogger.info(`${objVcMethodFault.message}`);
}
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like