GetHostPciDevice
The vsphere..getHostPciDevice data source can be used to discover the DeviceID
of a vSphere host’s PCI device. This can then be used with
vsphere..VirtualMachine’s pci_device_id.
Example Usage With Vendor ID and Class ID
import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";
const datacenter = vsphere.getDatacenter({
name: "dc1",
});
const host = datacenter.then(datacenter => vsphere.getHost({
name: "esxi1",
datacenterId: datacenter.id,
}));
const dev = host.then(host => vsphere.getHostPciDevice({
hostId: host.id,
classId: 123,
vendorId: 456,
}));import pulumi
import pulumi_vsphere as vsphere
datacenter = vsphere.get_datacenter(name="dc1")
host = vsphere.get_host(name="esxi1",
datacenter_id=datacenter.id)
dev = vsphere.get_host_pci_device(host_id=host.id,
class_id=123,
vendor_id=456)using Pulumi;
using VSphere = Pulumi.VSphere;
class MyStack : Stack
{
public MyStack()
{
var datacenter = Output.Create(VSphere.GetDatacenter.InvokeAsync(new VSphere.GetDatacenterArgs
{
Name = "dc1",
}));
var host = datacenter.Apply(datacenter => Output.Create(VSphere.GetHost.InvokeAsync(new VSphere.GetHostArgs
{
Name = "esxi1",
DatacenterId = datacenter.Id,
})));
var dev = host.Apply(host => Output.Create(VSphere.GetHostPciDevice.InvokeAsync(new VSphere.GetHostPciDeviceArgs
{
HostId = host.Id,
ClassId = "123",
VendorId = "456",
})));
}
}
Example Usage With Name Regular Expression
data "vsphere..Datacenter" "datacenter" {
name = "dc1"
}
data "vsphere..Host" "host" {
name = "esxi1"
datacenter_id = data.vsphere_datacenter.datacenter.id
}
data "vsphere..getHostPciDevice" "dev" {
host_id = data.vsphere_host.host.id
name_regex = "MMC"
}Using GetHostPciDevice
function getHostPciDevice(args: GetHostPciDeviceArgs, opts?: InvokeOptions): Promise<GetHostPciDeviceResult>function get_host_pci_device(class_id=None, host_id=None, name_regex=None, vendor_id=None, opts=None)func GetHostPciDevice(ctx *Context, args *GetHostPciDeviceArgs, opts ...InvokeOption) (*GetHostPciDeviceResult, error)public static class GetHostPciDevice {
public static Task<GetHostPciDeviceResult> InvokeAsync(GetHostPciDeviceArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
GetHostPciDevice Result
The following output properties are available:
Package Details
- Repository
- https://github.com/pulumi/pulumi-vsphere
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vsphereTerraform Provider.