Function: Build a vCenter Virtual PCI Passthrough

by Simon Sparks · 20 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: Build a vCenter Virtual PCI Passthrough

Private Function: buildVcVirtualPCIPassthrough

private buildVcVirtualPCIPassthrough(strVendorID: string, strDeviceID: string): VcVirtualPCIPassthrough {
    // @ts-ignore
    let objVcVirtualPCIPassthroughAllowedDevice: VcVirtualPCIPassthroughAllowedDevice = new VcVirtualPCIPassthroughAllowedDevice();
    objVcVirtualPCIPassthroughAllowedDevice.vendorId = strVendorID;
    objVcVirtualPCIPassthroughAllowedDevice.deviceId = strDeviceID;

    // @ts-ignore
    let arrVcVirtualPCIPassthroughAllowedDevice: VcVirtualPCIPassthroughAllowedDevice[] = [];
    arrVcVirtualPCIPassthroughAllowedDevice.push(objVcVirtualPCIPassthroughAllowedDevice);

    // @ts-ignore
    let objVcVirtualPCIPassthroughDynamicBackingInfo: VcVirtualPCIPassthroughDynamicBackingInfo = new VcVirtualPCIPassthroughDynamicBackingInfo();
    objVcVirtualPCIPassthroughDynamicBackingInfo.deviceName = '';
    objVcVirtualPCIPassthroughDynamicBackingInfo.allowedDevice = arrVcVirtualPCIPassthroughAllowedDevice;

    let objVcDescription: VcDescription = new VcDescription();
    objVcDescription.summary = 'New PCI device';
    objVcDescription.label = 'New PCI device';

    let objVcVirtualPCIPassthrough: VcVirtualPCIPassthrough = new VcVirtualPCIPassthrough();
    objVcVirtualPCIPassthrough.backing = objVcVirtualPCIPassthroughDynamicBackingInfo;
    objVcVirtualPCIPassthrough.deviceInfo = objVcDescription;
    objVcVirtualPCIPassthrough.key = -102;

    return objVcVirtualPCIPassthrough;
}
TypeScript

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like