Managed Object - HostDatastoreSystem

Property of
HostConfigManager
See also
Datastore, HostNasVolumeSpec, HostScsiDisk, VmfsDatastoreCreateSpec, 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
datastore*ManagedObjectReference[]
to a Datastore[]
List of datastores on this host.
*May not be present

Methods

Methods defined in this Managed Object
ConfigureDatastorePrincipal, CreateLocalDatastore, CreateNasDatastore, CreateVmfsDatastore, ExtendVmfsDatastore, QueryAvailableDisksForVmfs, QueryVmfsDatastoreCreateOptions, QueryVmfsDatastoreExtendOptions, RemoveDatastore

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.
HostConfigFaultThrown if unable to create the datastore on 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



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



ExtendVmfsDatastore

Extends an existing VMFS 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 to be extended.
specVmfsDatastoreExtendSpec The specification to extend 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 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



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

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



QueryVmfsDatastoreExtendOptions

Queries options for extending an existing 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.
datastoreManagedObjectReference
to a Datastore
The datastore to be extended.
See devicePath
devicePathxsd:string The devicePath of the disk on which datastore creation options are generated.
See devicePath

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