vSphere

Pulumi Official
Package maintained by Pulumi
v4.1.0 published on Wednesday, Nov 24, 2021 by Pulumi

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

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",
        })));
    }

}
package main

import (
	"github.com/pulumi/pulumi-vsphere/sdk/v4/go/vsphere"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		opt0 := "dc1"
		datacenter, err := vsphere.LookupDatacenter(ctx, &GetDatacenterArgs{
			Name: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		opt1 := "esxi1"
		host, err := vsphere.LookupHost(ctx, &GetHostArgs{
			Name:         &opt1,
			DatacenterId: datacenter.Id,
		}, nil)
		if err != nil {
			return err
		}
		opt2 := "123"
		opt3 := "456"
		_, err = vsphere.GetHostPciDevice(ctx, &GetHostPciDeviceArgs{
			HostId:   host.Id,
			ClassId:  &opt2,
			VendorId: &opt3,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

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")
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,
}));

Coming soon!

Using getHostPciDevice

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getHostPciDevice(args: GetHostPciDeviceArgs, opts?: InvokeOptions): Promise<GetHostPciDeviceResult>
function getHostPciDeviceOutput(args: GetHostPciDeviceOutputArgs, opts?: InvokeOptions): Output<GetHostPciDeviceResult>
def get_host_pci_device(class_id: Optional[str] = None,
                        host_id: Optional[str] = None,
                        name_regex: Optional[str] = None,
                        vendor_id: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetHostPciDeviceResult
def get_host_pci_device_output(class_id: Optional[pulumi.Input[str]] = None,
                        host_id: Optional[pulumi.Input[str]] = None,
                        name_regex: Optional[pulumi.Input[str]] = None,
                        vendor_id: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetHostPciDeviceResult]
func GetHostPciDevice(ctx *Context, args *GetHostPciDeviceArgs, opts ...InvokeOption) (*GetHostPciDeviceResult, error)
func GetHostPciDeviceOutput(ctx *Context, args *GetHostPciDeviceOutputArgs, opts ...InvokeOption) GetHostPciDeviceResultOutput

> Note: This function is named GetHostPciDevice in the Go SDK.

public static class GetHostPciDevice 
{
    public static Task<GetHostPciDeviceResult> InvokeAsync(GetHostPciDeviceArgs args, InvokeOptions? opts = null)
    public static Output<GetHostPciDeviceResult> Invoke(GetHostPciDeviceInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetHostPciDeviceResult> getHostPciDevice(GetHostPciDeviceArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: vsphere:index/getHostPciDevice:getHostPciDevice
  Arguments:
    # Arguments dictionary

The following arguments are supported:

HostId string

The [managed object reference ID][docs-about-morefs] of a host.

ClassId string

The hexadecimal PCI device class ID

NameRegex string

A regular expression that will be used to match the host PCI device name.

VendorId string

The hexadecimal PCI device vendor ID.

HostId string

The [managed object reference ID][docs-about-morefs] of a host.

ClassId string

The hexadecimal PCI device class ID

NameRegex string

A regular expression that will be used to match the host PCI device name.

VendorId string

The hexadecimal PCI device vendor ID.

hostId String

The [managed object reference ID][docs-about-morefs] of a host.

classId String

The hexadecimal PCI device class ID

nameRegex String

A regular expression that will be used to match the host PCI device name.

vendorId String

The hexadecimal PCI device vendor ID.

hostId string

The [managed object reference ID][docs-about-morefs] of a host.

classId string

The hexadecimal PCI device class ID

nameRegex string

A regular expression that will be used to match the host PCI device name.

vendorId string

The hexadecimal PCI device vendor ID.

host_id str

The [managed object reference ID][docs-about-morefs] of a host.

class_id str

The hexadecimal PCI device class ID

name_regex str

A regular expression that will be used to match the host PCI device name.

vendor_id str

The hexadecimal PCI device vendor ID.

hostId String

The [managed object reference ID][docs-about-morefs] of a host.

classId String

The hexadecimal PCI device class ID

nameRegex String

A regular expression that will be used to match the host PCI device name.

vendorId String

The hexadecimal PCI device vendor ID.

getHostPciDevice Result

The following output properties are available:

HostId string
Id string

The provider-assigned unique ID for this managed resource.

Name string

The name of the PCI device.

ClassId string
NameRegex string
VendorId string
HostId string
Id string

The provider-assigned unique ID for this managed resource.

Name string

The name of the PCI device.

ClassId string
NameRegex string
VendorId string
hostId String
id String

The provider-assigned unique ID for this managed resource.

name String

The name of the PCI device.

classId String
nameRegex String
vendorId String
hostId string
id string

The provider-assigned unique ID for this managed resource.

name string

The name of the PCI device.

classId string
nameRegex string
vendorId string
host_id str
id str

The provider-assigned unique ID for this managed resource.

name str

The name of the PCI device.

class_id str
name_regex str
vendor_id str
hostId String
id String

The provider-assigned unique ID for this managed resource.

name String

The name of the PCI device.

classId String
nameRegex String
vendorId String

Package Details

Repository
https://github.com/pulumi/pulumi-vsphere
License
Apache-2.0
Notes

This Pulumi package is based on the vsphere Terraform Provider.