| Local Properties | Local Methods | |
Managed Object Types | Data Object Types | All Properties | All Methods |
To a host, a datastore is a storage abstraction that is backed by one of several types of storage volumes:
An ESX Server system automatically discovers the VMFS volume on attached Logical Unit Numbers (LUNs) on startup and after re-scanning the host bus adapter. Datastores are automatically created. The datastore label is based on the VMFS volume label. If there is a conflict with an existing datastore, it is made unique by appending a suffix. The VMFS volume label will be unchanged.
Destroying the datastore removes the partitions that compose the VMFS volume.
Properties
Name | Type | Description |
---|---|---|
capabilities | HostDatastoreSystemCapabilities |
Capability vector indicating the available product features.
Since VI API 2.5 |
datastore* P | ManagedObjectReference[]
to a Datastore[] |
List of datastores on this host.
|
Methods
All virtual machine-related file I/O is performed under this user. Configuring datastore principal user will result in all virtual machine files (configuration, disk, and so on) being checked for proper access. If necessary, ownership and permissions are modified. Note that in some environments, file ownership and permissions modification may not be possible. For example, virtual machine files stored on NFS cannot be modified for ownership and permissions if root squashing is enabled. Ownership and permissions for these files must be manually changed by a system administrator. In general, if server process does not have rights to change ownership and file permissions of virtual machine files, they must be modified manually. If a virtual machine files are not read/writeable by this user, virtual machine related operations such as power on/off, configuration, and so on will fail. This operation must be performed while in maintenance mode and requires host reboot.
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the HostDatastoreSystem used to make the method call. |
userName P | xsd:string |
Datastore principal user name.
Since 2.0 |
password* P | xsd:string |
Optional password for systems that require password for
user impersonation.
Since 2.0 |
Return Value
Type | Description |
---|---|
None |
Faults
Type | Description |
---|---|
HostConfigFault | Thrown if unable to configure the datastore principal. |
InvalidState | Thrown if the host is not in maintenance mode. |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Events
Type | |
---|---|
None |
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the HostDatastoreSystem used to make the method call. |
name P | xsd:string |
The name of a datastore to create on the local host.
Since 2.0 |
path P | xsd:string |
The file path for a directory in which the virtual machine data
will be stored.
Since 2.0 |
Return Value
Type | Description |
---|---|
ManagedObjectReference
to a Datastore |
Faults
Type | Description |
---|---|
DuplicateName | Thrown if a datastore with the same name already exists. |
FileNotFound | Thrown if path doesn't exist |
HostConfigFault | Thrown if unable to create the datastore on host. |
InvalidName | Thrown if name is not valid datastore name |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Events
Type | |
---|---|
None |
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the HostDatastoreSystem used to make the method call. |
spec P | HostNasVolumeSpec |
The specification for creating a network-attached storage volume.
Since 2.0 |
Return Value
Type | Description |
---|---|
ManagedObjectReference
to a Datastore | The newly created datastore. |
Faults
Type | Description |
---|---|
AlreadyExists | Thrown if the local path already exists on the host, or the remote path is already mounted on the host. |
DuplicateName | Thrown if a datastore with the same name already exists. |
HostConfigFault | Thrown if unable to mount the NAS volume. |
NoGateway | Thrown if VMkernel gateway is not configured. |
NoVirtualNic | Thrown if VMkernel TCPIP stack is not configured. |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Events
Type | |
---|---|
None |
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the HostDatastoreSystem used to make the method call. |
spec P | VmfsDatastoreCreateSpec |
The specification for creating a datastore backed by a VMFS.
Since 2.0 |
Return Value
Type | Description |
---|---|
ManagedObjectReference
to a Datastore | The newly created datastore. |
Faults
Type | Description |
---|---|
DuplicateName | Thrown if a datastore with the same name already exists. |
HostConfigFault | Thrown if unable to format the VMFS volume or gather information about the created volume. |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Events
Type | |
---|---|
None |
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the HostDatastoreSystem used to make the method call. |
spec P | HostDatastoreSystemVvolDatastoreSpec |
Specification for creating a Virtual-Volume based datastore.
Since vSphere API 6.0 |
Return Value
Type | Description |
---|---|
ManagedObjectReference
to a Datastore | The newly created datastore. |
Faults
Type | Description |
---|---|
DuplicateName | Thrown if a datastore with the same name already exists. |
HostConfigFault | Thrown if unable to create the datastore on host. |
InvalidName | Thrown if name is not valid datastore name |
NotFound | Thrown if the storage container could not be found. |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Events
Type | |
---|---|
None |
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the HostDatastoreSystem used to make the method call. |
datastore P | ManagedObjectReference
to a Datastore |
Datastore on which clustered vmdk should be
disabled.
Since vSphere API 7.0 |
Return Value
Type | Description |
---|---|
None |
Faults
Type | Description |
---|---|
HostConfigFault | Thrown if unable to disable clustered vmdk support. |
NotFound | Thrown if a datastore with the name could not be found. |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Events
Type | |
---|---|
None |
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the HostDatastoreSystem used to make the method call. |
datastore P | ManagedObjectReference
to a Datastore |
Datastore on which clustered vmdk should be
enabled
Since vSphere API 7.0 |
Return Value
Type | Description |
---|---|
None |
Faults
Type | Description |
---|---|
HostConfigFault | Thrown if unable to enable clustered vmdk support. |
NotFound | Thrown if a datastore with the name could not be found. |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Events
Type | |
---|---|
None |
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the HostDatastoreSystem used to make the method call. |
datastore P | ManagedObjectReference
to a Datastore |
The datastore whose capacity should be increased.
Since vSphere API 4.0 |
spec P | VmfsDatastoreExpandSpec |
The specification describing which extent of the VMFS
datastore to expand.
Since vSphere API 4.0 |
Return Value
Type | Description |
---|---|
ManagedObjectReference
to a Datastore | The expanded datastore. |
Faults
Type | Description |
---|---|
HostConfigFault | Thrown if unable to expand the VMFS volume. |
NotFound | Thrown if a datastore with the name could not be found. |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Events
Type | |
---|---|
None |
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the HostDatastoreSystem used to make the method call. |
datastore P | ManagedObjectReference
to a Datastore |
The datastore whose capacity should be increased.
Since 2.0 |
spec P | VmfsDatastoreExtendSpec |
The specification describing what extents to add to a
VMFS datastore.
Since 2.0 |
Return Value
Type | Description |
---|---|
ManagedObjectReference
to a Datastore | The extended datastore. |
Faults
Type | Description |
---|---|
HostConfigFault | Thrown if unable to extend the VMFS volume. |
NotFound | Thrown if a datastore with the name could not be found. |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Events
Type | |
---|---|
None |
This operation will filter out disks that are currently in use by an existing VMFS unless the VMFS using the disk is one being extended. It will also filter out management LUNs and disks that are referenced by RDMs. These disk LUNs are also unsuited for use by a VMFS.
Disk LUNs referenced by RDMs are found by examining all virtual machines known to the system and visiting their virtual disk backends. If a virtual disk backend uses an RDM that is referencing a disk LUN, the disk LUN becomes ineligible for use by a VMFS datastore.
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the HostDatastoreSystem used to make the method call. |
datastore* P | ManagedObjectReference
to a Datastore |
The managed object reference of the VMFS datastore
you want extents for.
Since 2.0 |
Return Value
Type | Description |
---|---|
HostScsiDisk[] | An array of data objects describing SCSI disks. |
Faults
Type | Description |
---|---|
HostConfigFault | Thrown if unable to query disk information. |
NotFound | Thrown if the named VMFS datastore is not found. |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Events
Type | |
---|---|
None |
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the HostDatastoreSystem used to make the method call. |
Return Value
Type | Description |
---|---|
HostUnresolvedVmfsVolume[] | An array of unbound VMFS datastore |
Faults
Type | Description |
---|---|
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Events
Type | |
---|---|
None |
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the HostDatastoreSystem used to make the method call. |
devicePath P | xsd:string |
The devicePath of the disk on which datastore creation
options are generated. See devicePath Since 2.0 |
vmfsMajorVersion* P | xsd:int |
major version of VMFS to be used for
formatting the datastore. If this
parameter is not specified, then the highest
supportedVmfsMajorVersion for the host
is used. See devicePath Since 2.0 |
Return Value
Type | Description |
---|---|
VmfsDatastoreOption[] | An array of VMFS datastore provisioning options that can be applied on a disk. |
Faults
Type | Description |
---|---|
HostConfigFault | Thrown if unable to get the current partition information for the device. See devicePath |
NotFound | Thrown if the device is not found. See devicePath |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Events
Type | |
---|---|
None |
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the HostDatastoreSystem used to make the method call. |
datastore P | ManagedObjectReference
to a Datastore |
The datastore to be expanded.
Since vSphere API 4.0 |
Return Value
Type | Description |
---|---|
VmfsDatastoreOption[] | An array of VMFS datastore expansion options that can be applied. |
Faults
Type | Description |
---|---|
HostConfigFault | Thrown if unable to get partition information for the devices on which the extents reside |
NotFound | Thrown if the specified datastore could not be found or is unmounted. |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Events
Type | |
---|---|
None |
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the HostDatastoreSystem used to make the method call. |
datastore P | ManagedObjectReference
to a Datastore |
The datastore to be extended. See devicePath Since 2.0 |
devicePath P | xsd:string |
The devicePath of the disk on which datastore extension
options are generated. See devicePath Since 2.0 |
suppressExpandCandidates* P | xsd:boolean |
Indicates whether to exclude options that can be
used for extent expansion also.
Free space can be used for adding an extent or expanding an existing
extent. If this parameter is set to true, the list of options
returned will not include free space that can be used for expansion. See devicePath Since 2.0 |
Return Value
Type | Description |
---|---|
VmfsDatastoreOption[] | An array of VMFS datastore provisioning options that can be applied on a disk. |
Faults
Type | Description |
---|---|
HostConfigFault | Thrown if unable to get the current partition information for the device. See devicePath |
NotFound | Thrown if a datastore or device with the given name could not be found or if the datastore is unmounted. See devicePath |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Events
Type | |
---|---|
None |
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the HostDatastoreSystem used to make the method call. |
datastore P | ManagedObjectReference
to a Datastore |
The datastore to be removed.
Since 2.0 |
Return Value
Type | Description |
---|---|
None |
Faults
Type | Description |
---|---|
HostConfigFault | Thrown if unable to umount the NAS volume for NAS datastore, or gather the existing volume information. |
NotFound | Thrown if the datastore could not be found. |
ResourceInUse | Thrown for a VMFS volume if there is any VM registered on any host attached to this datastore. |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Events
Type | |
---|---|
None |
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the HostDatastoreSystem used to make the method call. |
datastore P | ManagedObjectReference[]
to a Datastore[] |
each element specifies one datastore to be removed.
Since vSphere API 6.0 |
Return Value
Type | Description |
---|---|
ManagedObjectReference
to a Task |
Faults
Type | Description |
---|---|
HostConfigFault | Thrown for host configuration failures. |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Events
Type | |
---|---|
None |
With 'Resignature' operation, a new Vmfs Uuid is assigned to the volume but its contents are kept intact. Resignature results in a new Vmfs volume on the host. Users can specify a list of hosts on which the volume will be auto-mounted.
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the HostDatastoreSystem used to make the method call. |
resolutionSpec P | HostUnresolvedVmfsResignatureSpec |
A data object that describes what the disk
extents to be used for creating the new
VMFS volume.
Since vSphere API 4.0 |
Return Value
Type | Description |
---|---|
ManagedObjectReference
to a Task | This method returns a Task object with which to monitor the operation. The task result (Info.result) contains a HostResignatureRescanResult object that identifies the newly created VMFS datastore. |
Faults
Type | Description |
---|---|
HostConfigFault | Thrown for all other configuration failures. |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
VmfsAmbiguousMount | when ESX is unable to resolve the extents of a VMFS volume unambiguously. This is thrown only when a VMFS volume has multiple extents and multiple copies of non-head extents are detected, and the user has not specified one copy of every extent. Please note that some versions of ESX may not support resolving the situation where multiple copies of non-head extents are detected, even if one copy of every extent is specified in the method parameter. To resolve such a situation, the user is expected to change the configuration (for example, using array management tools) so that only one copy of each non-head extent is presented to ESX. |
Events
Type | |
---|---|
None |
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the HostDatastoreSystem used to make the method call. |
datastore* P | ManagedObjectReference
to a Datastore |
The selected datastore. If this argument is unset, then
the localSwapDatastore
property becomes unset. Otherwise, the host must have read/write
access to the indicated datastore.
Since VI API 2.5 |
Return Value
Type | Description |
---|---|
None |
Faults
Type | Description |
---|---|
DatastoreNotWritableOnHost | Thrown if the datastore argument is set and the host cannot write to the indicated datastore. |
InaccessibleDatastore | Thrown if the datastore argument is set and the host cannot access the indicated datastore. |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Events
Type | |
---|---|
None |
Top of page | Local Properties | Local Methods | |
Managed Object Types | Data Object Types | All Properties | All Methods |