Managed Object - Datastore

Property of
ComputeResource, Datacenter, DatastoreEventArgument, DatastoreSummary, HostConfigInfo, HostDatastoreBrowser, HostDatastoreBrowserSearchResults, HostDatastoreSystem, HostSystem, InvalidDatastore, RDMNotSupportedOnDatastore, UnsupportedDatastore, VirtualDeviceFileBackingInfo, VirtualMachine, VirtualMachineRelocateSpec, VirtualMachineRelocateSpecDiskLocator
Parameter to
ExtendVmfsDatastore, QueryAvailableDisksForVmfs, QueryVmfsDatastoreExtendOptions, RemoveDatastore, UpdateLocalSwapDatastore
Returned by
CreateLocalDatastore, CreateNasDatastore, CreateVmfsDatastore, ExtendVmfsDatastore
Extends
ExtensibleManagedObject
See also
DatastoreCapability, DatastoreHostMount, DatastoreInfo, DatastoreSummary, HostDatastoreBrowser, VirtualMachine


Managed Object Description

Represents a storage location for virtual machine files. A storage location can be a VMFS volume, a directory on Network Attached Storage, or a local file system path.

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

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
browserManagedObjectReference
to a HostDatastoreBrowser

DatastoreBrowser used to browse this datastore.
capabilityDatastoreCapability

Capabilities of this datastore.
host*DatastoreHostMount[]

Hosts attached to this datastore.
infoDatastoreInfo

Specific information about the datastore.
summaryDatastoreSummary

Global properties of the datastore.
vm*ManagedObjectReference[]
to a VirtualMachine[]

Virtual machines stored on this datastore.
Properties inherited from ExtensibleManagedObject
availableField, value
*May not be present

Methods

Methods defined in this Managed Object
DestroyDatastore, RefreshDatastore, RenameDatastore
Methods inherited from ExtensibleManagedObject
setCustomValue

DestroyDatastore

Deprecated. As of VI API 2.5 do not use this method. This method throws ResourceInUse. Datastores are automatically removed when no longer in use, so this method is unnecessary.

Removes a datastore. A datastore can be removed only if it is not currently used by any host or virtual machine.
Required Privileges
Datastore.Delete

Parameters

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

Return Value

Type Description
None

Faults

Type Description
ResourceInUseThrown if one or more hosts or virtual machines are configured to use the 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



RefreshDatastore

Explicitly refreshes the freeSpace and capacity values.
Required Privileges
System.Read

Parameters

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

Return Value

Type Description
None

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



RenameDatastore

Renames a datastore.
Required Privileges
Datastore.Rename

Parameters

NameTypeDescription
_thisManagedObjectReference A reference to the Datastore used to make the method call.
newNamexsd:string

The new name to assign to the datastore.

Return Value

Type Description
None

Faults

Type Description
DuplicateNameThrown if another datastore in this datacenter already has the same name.
InvalidNameThrown if the name is not a 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