vSphere

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

getVmfsDisks

The vsphere.getVmfsDisks data source can be used to discover the storage devices available on an ESXi host. This data source can be combined with the vsphere.VmfsDatastore resource to create VMFS datastores based off a set of discovered disks.

Example Usage

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
        {
            DatacenterId = datacenter.Id,
            Name = "esxi1",
        })));
        var available = host.Apply(host => Output.Create(VSphere.GetVmfsDisks.InvokeAsync(new VSphere.GetVmfsDisksArgs
        {
            Filter = "mpx.vmhba1:C0:T[12]:L0",
            HostSystemId = host.Id,
            Rescan = true,
        })));
    }

}
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{
			DatacenterId: datacenter.Id,
			Name:         &opt1,
		}, nil)
		if err != nil {
			return err
		}
		opt2 := "mpx.vmhba1:C0:T[12]:L0"
		opt3 := true
		_, err = vsphere.GetVmfsDisks(ctx, &GetVmfsDisksArgs{
			Filter:       &opt2,
			HostSystemId: host.Id,
			Rescan:       &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(datacenter_id=datacenter.id,
    name="esxi1")
available = vsphere.get_vmfs_disks(filter="mpx.vmhba1:C0:T[12]:L0",
    host_system_id=host.id,
    rescan=True)
import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const datacenter = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}));
const host = datacenter.apply(datacenter => vsphere.getHost({
    datacenterId: datacenter.id,
    name: "esxi1",
}));
const available = host.apply(host => vsphere.getVmfsDisks({
    filter: "mpx.vmhba1:C0:T[12]:L0",
    hostSystemId: host.id,
    rescan: true,
}));

Coming soon!

Using getVmfsDisks

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 getVmfsDisks(args: GetVmfsDisksArgs, opts?: InvokeOptions): Promise<GetVmfsDisksResult>
function getVmfsDisksOutput(args: GetVmfsDisksOutputArgs, opts?: InvokeOptions): Output<GetVmfsDisksResult>
def get_vmfs_disks(filter: Optional[str] = None,
                   host_system_id: Optional[str] = None,
                   rescan: Optional[bool] = None,
                   opts: Optional[InvokeOptions] = None) -> GetVmfsDisksResult
def get_vmfs_disks_output(filter: Optional[pulumi.Input[str]] = None,
                   host_system_id: Optional[pulumi.Input[str]] = None,
                   rescan: Optional[pulumi.Input[bool]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetVmfsDisksResult]
func GetVmfsDisks(ctx *Context, args *GetVmfsDisksArgs, opts ...InvokeOption) (*GetVmfsDisksResult, error)
func GetVmfsDisksOutput(ctx *Context, args *GetVmfsDisksOutputArgs, opts ...InvokeOption) GetVmfsDisksResultOutput

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

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

The following arguments are supported:

HostSystemId string

The managed object ID of the host to look for disks on.

Filter string

A regular expression to filter the disks against. Only disks with canonical names that match will be included.

Rescan bool

Whether or not to rescan storage adapters before searching for disks. This may lengthen the time it takes to perform the search. Default: false.

HostSystemId string

The managed object ID of the host to look for disks on.

Filter string

A regular expression to filter the disks against. Only disks with canonical names that match will be included.

Rescan bool

Whether or not to rescan storage adapters before searching for disks. This may lengthen the time it takes to perform the search. Default: false.

hostSystemId String

The managed object ID of the host to look for disks on.

filter String

A regular expression to filter the disks against. Only disks with canonical names that match will be included.

rescan Boolean

Whether or not to rescan storage adapters before searching for disks. This may lengthen the time it takes to perform the search. Default: false.

hostSystemId string

The managed object ID of the host to look for disks on.

filter string

A regular expression to filter the disks against. Only disks with canonical names that match will be included.

rescan boolean

Whether or not to rescan storage adapters before searching for disks. This may lengthen the time it takes to perform the search. Default: false.

host_system_id str

The managed object ID of the host to look for disks on.

filter str

A regular expression to filter the disks against. Only disks with canonical names that match will be included.

rescan bool

Whether or not to rescan storage adapters before searching for disks. This may lengthen the time it takes to perform the search. Default: false.

hostSystemId String

The managed object ID of the host to look for disks on.

filter String

A regular expression to filter the disks against. Only disks with canonical names that match will be included.

rescan Boolean

Whether or not to rescan storage adapters before searching for disks. This may lengthen the time it takes to perform the search. Default: false.

getVmfsDisks Result

The following output properties are available:

Disks List<string>

A lexicographically sorted list of devices discovered by the operation, matching the supplied filter, if provided.

HostSystemId string
Id string

The provider-assigned unique ID for this managed resource.

Filter string
Rescan bool
Disks []string

A lexicographically sorted list of devices discovered by the operation, matching the supplied filter, if provided.

HostSystemId string
Id string

The provider-assigned unique ID for this managed resource.

Filter string
Rescan bool
disks List

A lexicographically sorted list of devices discovered by the operation, matching the supplied filter, if provided.

hostSystemId String
id String

The provider-assigned unique ID for this managed resource.

filter String
rescan Boolean
disks string[]

A lexicographically sorted list of devices discovered by the operation, matching the supplied filter, if provided.

hostSystemId string
id string

The provider-assigned unique ID for this managed resource.

filter string
rescan boolean
disks Sequence[str]

A lexicographically sorted list of devices discovered by the operation, matching the supplied filter, if provided.

host_system_id str
id str

The provider-assigned unique ID for this managed resource.

filter str
rescan bool
disks List

A lexicographically sorted list of devices discovered by the operation, matching the supplied filter, if provided.

hostSystemId String
id String

The provider-assigned unique ID for this managed resource.

filter String
rescan Boolean

Package Details

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

This Pulumi package is based on the vsphere Terraform Provider.