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,
})));
}
}
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",
}, { 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>function get_vmfs_disks(filter=None, host_system_id=None, rescan=None, opts=None)func GetVmfsDisks(ctx *Context, args *GetVmfsDisksArgs, opts ...InvokeOption) (*GetVmfsDisksResult, error)public static class GetVmfsDisks {
public static Task<GetVmfsDisksResult> InvokeAsync(GetVmfsDisksArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Host
System stringId 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.
- Host
System stringId 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.
- host
System stringId 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_ strid 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.- Host
System stringId - Id string
The provider-assigned unique ID for this managed resource.
- Filter string
- Rescan bool
Package Details
- Repository
- https://github.com/pulumi/pulumi-vsphere
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vsphereTerraform Provider.