Managed Object - HostDatastoreSystem

Property of
HostConfigManager
See also
Datastore, HostDatastoreSystemCapabilities, HostNasVolumeSpec, HostResignatureRescanResult, HostScsiDisk, HostUnresolvedVmfsResignatureSpec, HostUnresolvedVmfsVolume, VmfsDatastoreCreateSpec, VmfsDatastoreExpandSpec, VmfsDatastoreExtendSpec, VmfsDatastoreOption


Managed Object Description

This managed object creates and removes datastores from the host.

To a host, a datastore is a storage abstraction that is backed by one of several types of storage volumes:

Local file system
A datastore that is backed by a local file system volume uses a host native local file system such as NTFS or ext3. The datastore is created by identifying a file path for a directory in which virtual machine data will be stored. When the datastore is deleted, the mapping from the datastore to the file is deleted. The contents of the directory are not deleted.

NAS Volume
A datastore that is backed by a network-attached storage device is created by specifying the required data needed to attach the volume to the host. Destroying the datastore detaches the volume from the host.

VMFS
A datastore that is backed by a VMware File System (VMFS) is created by specifying a disk with unpartitioned space, the desired disk partition format on the disk, and some VMFS attributes.

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.

Datastores are never automatically removed because transient storage connection outages may occur. They must be removed from the host using this interface.
See Datastore

Properties

Name Type Description
capabilitiesHostDatastoreSystemCapabilities

Capability vector indicating the available product features.

Since VI API 2.5
datastore* PManagedObjectReference[]
to a Datastore[]

List of datastores on this host.
*May not be presentP Required privilege: System.View

Methods

Methods defined in this Managed Object
ConfigureDatastorePrincipal, CreateLocalDatastore, CreateNasDatastore, CreateVmfsDatastore, ExpandVmfsDatastore, ExtendVmfsDatastore, QueryAvailableDisksForVmfs, QueryUnresolvedVmfsVolumes, QueryVmfsDatastoreCreateOptions, QueryVmfsDatastoreExpandOptions, QueryVmfsDatastoreExtendOptions, RemoveDatastore, ResignatureUnresolvedVmfsVolume_Task, UpdateLocalSwapDatastore

ConfigureDatastorePrincipal

Configures datastore principal user for the host.

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.

Required Privileges
Host.Config.Maintenance

Parameters

NameTypeDescription
_thisManagedObjectReference A reference to the HostDatastoreSystem used to make the method call.
userNamexsd:string

Datastore principal user name.
password*xsd:string

Optional password for systems that require password for user impersonation.
*Need not be set

Return Value

Type Description
None

Faults

Type Description
HostConfigFaultThrown if unable to configure the datastore principal.
InvalidArgumentThrown if userName or password is not valid.
InvalidStateThrown if the host is not in maintenance mode.
NotSupportedThrown if this feature is not supported on the host.
RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Show WSDL type definition



CreateLocalDatastore

Creates a new local datastore.
Required Privileges
Host.Config.Storage

Parameters

NameTypeDescription
_thisManagedObjectReference A reference to the HostDatastoreSystem used to make the method call.
namexsd:string

The name of a datastore to create on the local host.
pathxsd:string

The file path for a directory in which the virtual machine data will be stored.

Return Value

Type Description
ManagedObjectReference
to a Datastore

Faults

Type Description
DuplicateNameThrown if a datastore with the same name already exists.
FileNotFoundThrown if path doesn't exist
HostConfigFaultThrown if unable to create the datastore on host.
InvalidNameThrown if name is not valid datastore name
RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Show WSDL type definition



CreateNasDatastore

Creates a new network-attached storage datastore.
Required Privileges
Host.Config.Storage

Parameters

NameTypeDescription
_thisManagedObjectReference A reference to the HostDatastoreSystem used to make the method call.
specHostNasVolumeSpec

The specification for creating a network-attached storage volume.

Return Value

Type Description
ManagedObjectReference
to a Datastore
The newly created datastore.

Faults

Type Description
AlreadyExistsThrown if the local path already exists on the host, or the remote path is already mounted on the host.
DuplicateNameThrown if a datastore with the same name already exists.
HostConfigFaultThrown if unable to mount the NAS volume.
InvalidArgumentThrown if the datastore name is invalid, or the spec is invalid.
NoGatewayThrown if VMkernel gateway is not configured.
NoVirtualNicThrown if VMkernel TCPIP stack is not configured.
RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Show WSDL type definition



CreateVmfsDatastore

Creates a new VMFS datastore.
Required Privileges
Host.Config.Storage

Parameters

NameTypeDescription
_thisManagedObjectReference A reference to the HostDatastoreSystem used to make the method call.
specVmfsDatastoreCreateSpec

The specification for creating a datastore backed by a VMFS.

Return Value

Type Description
ManagedObjectReference
to a Datastore
The newly created datastore.

Faults

Type Description
DuplicateNameThrown if a datastore with the same name already exists.
HostConfigFaultThrown if unable to format the VMFS volume or gather information about the created volume.
InvalidArgumentThrown if the datastore name is invalid, or the spec is invalid.
NotSupportedThrown if the host is not an ESX Server system.
RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Show WSDL type definition



ExpandVmfsDatastore

Increases the capacity of an existing VMFS datastore by expanding (increasing the size of) an existing extent of the datastore.
Required Privileges
Host.Config.Storage
Since
vSphere API 4.0

Parameters

NameTypeDescription
_thisManagedObjectReference A reference to the HostDatastoreSystem used to make the method call.
datastoreManagedObjectReference
to a Datastore

The datastore whose capacity should be increased.
specVmfsDatastoreExpandSpec

The specification describing which extent of the VMFS datastore to expand.

Return Value

Type Description
ManagedObjectReference
to a Datastore
The expanded datastore.

Faults

Type Description
HostConfigFaultThrown if unable to expand the VMFS volume.
NotFoundThrown if a datastore with the name could not be found.
NotSupportedThrown if the host is not an ESX Server.
RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Show WSDL type definition



ExtendVmfsDatastore

Increases the capacity of an existing VMFS datastore by adding new extents to the datastore.
Required Privileges
Host.Config.Storage

Parameters

NameTypeDescription
_thisManagedObjectReference A reference to the HostDatastoreSystem used to make the method call.
datastoreManagedObjectReference
to a Datastore

The datastore whose capacity should be increased.
specVmfsDatastoreExtendSpec

The specification describing what extents to add to a VMFS datastore.

Return Value

Type Description
ManagedObjectReference
to a Datastore
The extended datastore.

Faults

Type Description
HostConfigFaultThrown if unable to extend the VMFS volume.
NotFoundThrown if a datastore with the name could not be found.
NotSupportedThrown if the host is not an ESX Server.
RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Show WSDL type definition



QueryAvailableDisksForVmfs

Query to list disks that can be used to contain VMFS datastore extents. If the optional parameter name is supplied, queries for disks that can be used to contain extents for a VMFS datastore identified by the supplied name. Otherwise, the method retrieves disks that can be used to contain new VMFS datastores.

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.

Required Privileges
Host.Config.Storage

Parameters

NameTypeDescription
_thisManagedObjectReference A reference to the HostDatastoreSystem used to make the method call.
datastore*ManagedObjectReference
to a Datastore

The managed object reference of the VMFS datastore you want extents for.
*Need not be set

Return Value

Type Description
HostScsiDisk[]An array of data objects describing SCSI disks.

Faults

Type Description
HostConfigFaultThrown if unable to query disk information.
InvalidArgumentThrown if named VMFS datastore is not a VMFS datastore.
NotFoundThrown if the named VMFS datastore is not found.
NotSupportedThrown if the host is not an ESX Server.
RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Show WSDL type definition



QueryUnresolvedVmfsVolumes

Get the list of unbound VMFS volumes. For sharing a volume across hosts, a VMFS volume is bound to its underlying block device storage. When a low level block copy is performed to copy or move the VMFS volume, the copied volume will be unbound.
Required Privileges
System.Read
Since
vSphere API 4.0

Parameters

NameTypeDescription
_thisManagedObjectReference 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
RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Show WSDL type definition



QueryVmfsDatastoreCreateOptions

Queries options for creating a new VMFS datastore for a disk.
See devicePath
Required Privileges
Host.Config.Storage

Parameters

NameTypeDescription
_thisManagedObjectReference A reference to the HostDatastoreSystem used to make the method call.
devicePathxsd:string

The devicePath of the disk on which datastore creation options are generated.
See devicePath

vmfsMajorVersion*xsd:int

major version of VMFS to be used for formatting the datastore. If this parameter is not specified, then the default VMFS version for the host is used.
See devicePath

Since vSphere API 5.0
*Need not be set

Return Value

Type Description
VmfsDatastoreOption[]An array of VMFS datastore provisioning options that can be applied on a disk.

Faults

Type Description
HostConfigFaultThrown if unable to get the current partition information for the device.
See devicePath
NotFoundThrown if the device is not found.
See devicePath
NotSupportedThrown if the host is not an ESX Server.
See devicePath
RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Show WSDL type definition



QueryVmfsDatastoreExpandOptions

Queries for options for increasing the capacity of an existing VMFS datastore by expanding (increasing the size of) an existing extent of the datastore.
Required Privileges
Host.Config.Storage
Since
vSphere API 4.0

Parameters

NameTypeDescription
_thisManagedObjectReference A reference to the HostDatastoreSystem used to make the method call.
datastoreManagedObjectReference
to a Datastore

The datastore to be expanded.

Return Value

Type Description
VmfsDatastoreOption[]An array of VMFS datastore expansion options that can be applied.

Faults

Type Description
HostConfigFaultThrown if unable to get partition information for the devices on which the extents reside
NotFoundThrown if the specified datastore could not be found or is unmounted.
NotSupportedThrown if the host is not an ESX Server.
RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Show WSDL type definition



QueryVmfsDatastoreExtendOptions

Queries for options for increasing the capacity of an existing VMFS datastore by adding new extents using space from the specified disk.
See devicePath
Required Privileges
Host.Config.Storage

Parameters

NameTypeDescription
_thisManagedObjectReference A reference to the HostDatastoreSystem used to make the method call.
datastoreManagedObjectReference
to a Datastore

The datastore to be extended.
See devicePath

devicePathxsd:string

The devicePath of the disk on which datastore extension options are generated.
See devicePath

suppressExpandCandidates*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 vSphere API 4.0
*Need not be set

Return Value

Type Description
VmfsDatastoreOption[]An array of VMFS datastore provisioning options that can be applied on a disk.

Faults

Type Description
HostConfigFaultThrown if unable to get the current partition information for the device.
See devicePath
NotFoundThrown if a datastore or device with the given name could not be found or if the datastore is unmounted.
See devicePath
NotSupportedThrown if the host is not an ESX Server.
See devicePath
RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Show WSDL type definition



RemoveDatastore

Removes a datastore from a host.
Required Privileges
Host.Config.Storage

Parameters

NameTypeDescription
_thisManagedObjectReference A reference to the HostDatastoreSystem used to make the method call.
datastoreManagedObjectReference
to a Datastore

The datastore to be removed.

Return Value

Type Description
None

Faults

Type Description
HostConfigFaultThrown if unable to umount the NAS volume for NAS datastore, or gather the existing volume information.
NotFoundThrown if the datastore could not be found.
ResourceInUseThrown for a VMFS volume if there is any VM registered on any host attached to this datastore.
RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Show WSDL type definition



ResignatureUnresolvedVmfsVolume_Task

Resignature an unbound VMFS volume. To safely enable sharing of the volume across hosts, a VMFS volume is bound to its underlying block device storage. When a low level block copy is performed to copy or move the VMFS volume, the copied volume will be unbound. In order for the VMFS volume to be usable, a resolution operation is needed to determine whether the VMFS volume should be treated as a new volume or not and what extents compose that volume in the event there is more than one unbound volume.

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.

Required Privileges
Host.Config.Storage
Since
vSphere API 4.0

Parameters

NameTypeDescription
_thisManagedObjectReference A reference to the HostDatastoreSystem used to make the method call.
resolutionSpecHostUnresolvedVmfsResignatureSpec

A data object that describes what the disk extents to be used for creating the new VMFS volume.

Return Value

Type Description
ManagedObjectReference
to a Task

Faults

Type Description
HostConfigFaultThrown for all other configuration failures.
RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.
VmfsAmbiguousMountwhen 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.



UpdateLocalSwapDatastore

Choose the localSwapDatastore for this host. Any change to this setting will affect virtual machines that subsequently power on or resume from a suspended state at this host, or that migrate to this host while powered on; virtual machines that are currently powered on at this host will not yet be affected.
Required Privileges
Host.Config.Storage
Since
VI API 2.5

Parameters

NameTypeDescription
_thisManagedObjectReference A reference to the HostDatastoreSystem used to make the method call.
datastore*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.
*Need not be set

Return Value

Type Description
None

Faults

Type Description
DatastoreNotWritableOnHostThrown if the datastore argument is set and the host cannot write to the indicated datastore.
InaccessibleDatastoreThrown if the datastore argument is set and the host cannot access the indicated datastore.
NotSupportedThrown if the datastore argument is set and the localSwapDatastoreSupported capability is not true for the host.
RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Show WSDL type definition