» vsphere_vmfs_disks
The vsphere_vmfs_disks
data source can be used to discover the storage
devices available on an ESXi host. This data source can be combined with the
vsphere_vmfs_datastore
resource to create VMFS
datastores based off a set of discovered disks.
» Example Usage
data "vsphere_datacenter" "datacenter" {
name = "dc1"
}
data "vsphere_host" "host" {
name = "esxi1"
datacenter_id = "${data.vsphere_datacenter.datacenter.id}"
}
data "vsphere_vmfs_disks" "available" {
host_system_id = "${data.vsphere_host.host.id}"
rescan = true
filter = "mpx.vmhba1:C0:T[12]:L0"
}
» Argument Reference
The following arguments are supported:
-
host_system_id
- (Required) The managed object ID of the host to look for disks on. -
rescan
- (Optional) Whether or not to rescan storage adapters before searching for disks. This may lengthen the time it takes to perform the search. Default:false
. -
filter
- (Optional) A regular expression to filter the disks against. Only disks with canonical names that match will be included.
NOTE: Using a filter
is recommended if there is any chance the host
will have any specific storage devices added to it that may affect the order of
the output disks
attribute below, which is lexicographically sorted.
» Attribute Reference
-
disks
- A lexicographically sorted list of devices discovered by the operation, matching the suppliedfilter
, if provided.