Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

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/v2/go/vsphere"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        opt0 := "dc1"
        datacenter, err := vsphere.LookupDatacenter(ctx, &vsphere.LookupDatacenterArgs{
            Name: &opt0,
        }, nil)
        if err != nil {
            return err
        }
        opt1 := "esxi1"
        host, err := vsphere.LookupHost(ctx, &vsphere.LookupHostArgs{
            DatacenterId: datacenter.Id,
            Name:         &opt1,
        }, nil)
        if err != nil {
            return err
        }
        opt2 := "mpx.vmhba1:C0:T[12]:L0"
        opt3 := true
        _, err = vsphere.GetVmfsDisks(ctx, &vsphere.GetVmfsDisksArgs{
            Filter:       &opt2,
            HostSystemId: host.Id,
            Rescan:       &opt3,
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
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",
}, { async: true }));
const host = datacenter.apply(datacenter => vsphere.getHost({
    datacenterId: datacenter.id,
    name: "esxi1",
}, { async: true }));
const available = host.apply(host => vsphere.getVmfsDisks({
    filter: "mpx.vmhba1:C0:T[12]:L0",
    hostSystemId: host.id,
    rescan: true,
}, { async: true }));

Using getVmfsDisks

function getVmfsDisks(args: GetVmfsDisksArgs, opts?: InvokeOptions): Promise<GetVmfsDisksResult>
def get_vmfs_disks(filter: Optional[str] = None, host_system_id: Optional[str] = None, rescan: Optional[bool] = None, opts: Optional[InvokeOptions] = None) -> GetVmfsDisksResult
func GetVmfsDisks(ctx *Context, args *GetVmfsDisksArgs, opts ...InvokeOption) (*GetVmfsDisksResult, error)

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

public static class GetVmfsDisks {
    public static Task<GetVmfsDisksResult> InvokeAsync(GetVmfsDisksArgs args, InvokeOptions? opts = null)
}

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.

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.

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 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

Package Details

Repository
https://github.com/pulumi/pulumi-vsphere
License
Apache-2.0
Notes
This Pulumi package is based on the vsphere Terraform Provider.