| Local Properties | Local Methods | |
Managed Object Types | Data Object Types | All Properties | All Methods |
A datastore is platform-independent and host-independent. Therefore, datastores do not change when the virtual machines they contain are moved between hosts. The scope of a datastore is a datacenter; the datastore is uniquely named within the datacenter.
Any reference to a virtual machine or file accessed by any host within the datacenter must use a datastore path. A datastore path has the form "[<datastore>] <path>", where <datastore> is the datastore name, and <path> is a slash-delimited path from the root of the datastore. An example datastore path is "[storage] path/to/config.vmx".
You may use the following characters in a path, but not in a datastore name: slash (/), backslash (\), and percent (%).
All references to files in the VIM API are implicitly done using datastore paths.
When a client creates a virtual machine, it may specify the name of the datastore, omitting the path; the system, meaning VirtualCenter or the host, automatically assigns filenames and creates directories on the given datastore. For example, specifying My_Datastore as a location for a virtual machine called MyVm results in a datastore location of My_Datastore\MyVm\MyVm.vmx.
Datastores are configured per host. As part of host configuration, a HostSystem can be configured to mount a set of network drives. Multiple hosts may be configured to point to the same storage location. There exists only one Datastore object per Datacenter, for each such shared location. Each Datastore object keeps a reference to the set of hosts that have mounted the datastore. A Datastore object can be removed only if no hosts currently have the datastore mounted.
Thus, managing datastores is done both at the host level and the datacenter level. Each host is configured explicitly with the set of datastores it can access. At the datacenter, a view of the datastores across the datacenter is shown.
Properties
Name | Type | Description |
---|---|---|
browser | ManagedObjectReference
to a HostDatastoreBrowser |
DatastoreBrowser used to browse this datastore.
|
capability | DatastoreCapability |
Capabilities of this datastore.
|
host* | DatastoreHostMount[] |
Hosts attached to this datastore.
|
info | DatastoreInfo |
Specific information about the datastore.
|
iormConfiguration* | StorageIORMInfo |
Configuration of storage I/O resource management for the datastore.
Currently we only support storage I/O resource management on VMFS volumes
of a datastore.
This configuration may not be available if the datastore is not accessible from any host, or if the datastore does not have VMFS volume. The configuration can be modified using the method ConfigureDatastoreIORM_Task Since vSphere API 4.1 |
summary | DatastoreSummary |
Global properties of the datastore.
|
vm* | ManagedObjectReference[]
to a VirtualMachine[] |
Virtual machines stored on this datastore.
|
Properties inherited from ManagedEntity | ||
alarmActionsEnabled, configIssue, configStatus, customValue, declaredAlarmState, disabledMethod, effectiveRole, name, overallStatus, parent, permission, recentTask, tag, triggeredAlarmState | ||
Properties inherited from ExtensibleManagedObject | ||
availableField, value |
Methods
Methods defined in this Managed Object |
---|
DatastoreEnterMaintenanceMode, DatastoreExitMaintenanceMode_Task, DestroyDatastore, RefreshDatastore, RefreshDatastoreStorageInfo, RenameDatastore, UpdateVirtualMachineFiles_Task |
Methods inherited from ManagedEntity |
Destroy_Task, Reload, Rename_Task |
Methods inherited from ExtensibleManagedObject |
setCustomValue |
The task completes once there are no virtual machines on the datastore and no provisioning operations in progress on the datastore. The operation does not directly initiate any operations to evacuate or power-down powered-on virtual machines. However, if the datastore is part of a storage pod with VMware Storage DRS enabled, Storage DRS provides migration recommendations to evacuate the virtual machines. If Storage DRS is in fully-automatic mode, these are automatically scheduled. The task is cancellable. This method returns a StoragePlacementResult object, which includes a Task object with which to monitor the operation, and a list of recommendations and faults generated by Storage DRS when it tries to evacuate the virtual machines on the datastore. The recommendations and faults fields are set only if the datastore is a part of a storage pod with Storage DRS enabled. NOTE: This interface is experimental in this version of the API and might change in future versions.
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the Datastore used to make the method call. |
Return Value
Type | Description |
---|---|
StoragePlacementResult |
Faults
Type | Description |
---|---|
InvalidState | Thrown if the datastore is already in maintenance mode. |
RequestCanceled | Thrown if the operation is canceled. |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
The task is cancellable.
NOTE: This interface is experimental in this version of the API and might change in future versions.
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the Datastore used to make the method call. |
Return Value
Type | Description |
---|---|
ManagedObjectReference
to a Task | This method returns a Task object with which to monitor the operation. |
Faults
Type | Description |
---|---|
InvalidState | Thrown if the datastore 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. |
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the Datastore used to make the method call. |
Return Value
Type | Description |
---|---|
None |
Faults
Type | Description |
---|---|
ResourceInUse | Thrown if one or more hosts or virtual machines are configured to use the datastore. |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the Datastore used to make the method call. |
Return Value
Type | Description |
---|---|
None |
Faults
Type | Description |
---|---|
HostConfigFault | Thrown if unable to get the current system information for the datastore. |
NotFound | Thrown if the datastore or its underlying volume 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. |
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the Datastore used to make the method call. |
Return Value
Type | Description |
---|---|
None |
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. |
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the Datastore used to make the method call. |
newName | xsd:string |
The new name to assign to the datastore.
|
Return Value
Type | Description |
---|---|
None |
Faults
Type | Description |
---|---|
DuplicateName | Thrown if another datastore in this datacenter already has the same name. |
InvalidName | Thrown if the name is not a 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. |
This method is only supported by vCenter server. Also, this method requires that the datastore is accessible from at least one host (ESX version 4.1 or above) in vCenter server.
While this operation is in progress, it is important that users do not initiate any operations that might read or write to any files on the datastore, such as registering a virtual machine with files residing on the datastore, or performing any virtual disk operations on any files in the datastore. These operations can potentially cause spurious file update failures, while at the same time they can prevent virtual machine files from being updated correctly.
If users intend to update multiple datastores using this method, it is strongly advised that the users do not initiate any operations that might read or write to files on any of the datastores, until all of them have been updated. The files of a single virtual machine can reside on multiple datastores, and thus all the involved datastores should be updated, before the virtual machine is considered updated completely.
Parameters
Name | Type | Description |
---|---|---|
_this | ManagedObjectReference | A reference to the Datastore used to make the method call. |
mountPathDatastoreMapping | DatastoreMountPathDatastorePair[] |
Old mount path to datastore mapping.
|
Return Value
Type | Description |
---|---|
ManagedObjectReference
to a Task | This method returns a Task object with which to monitor the operation. The result property in the Task contains an UpdateVirtualMachineFilesResult object, upon success, which is a list of virtual machines files the server has attempted to update but failed to update. When there are too many failed files, only a subset of failed files will be returned. |
Faults
Type | Description |
---|---|
InvalidArgument | Thrown if old mount path is mapped to more than one datastores, or if any of the datastore being mapped can not be found. |
InvalidDatastore | Thrown if the operation cannot be performed due to some error with the datastore; typically a specific subclass of the fault is reported. |
NotSupported | Thrown if all hosts attached to this datastore do not support updating virtual machine files. |
PlatformConfigFault | Thrown if any error related to platform occurs during the operation. |
ResourceInUse | Thrown if there exists a registered virtual machine in the volume. |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
TaskInProgress | Thrown if the datastore is busy, for example, while another task is updating the datastore after volume resignaturing or remounting. |
Top of page | Local Properties | Local Methods | |
Managed Object Types | Data Object Types | All Properties | All Methods |