Search

Class VcDatastore

Extends com.vmware.vmo.plugin.vi4.model.VimManagedEntity
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".

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.

Attributes

Name Type Description
alarmActionsEnabled boolean Whether alarm actions are enabled for this entity. True if enabled; false otherwise.
availableField VcCustomFieldDef[] List of custom field definitions that are valid for the object's type. The fields are sorted by <a href="VcCustomFieldDef.html#name">VcCustomFieldDef</a>.
browser VcHostDatastoreBrowser DatastoreBrowser used to browse this datastore.
capability VcDatastoreCapability Capabilities of this datastore.
configIssue VcEvent[] Current configuration issues that have been detected for this entity. Typically, these issues have already been logged as events. The entity stores these events as long as they are still current. The <a href="VcManagedEntity.html#configStatus">VcManagedEntity</a> property provides an overall status based on these events.
configStatus VcManagedEntityStatus The configStatus indicates whether or not the system has detected a configuration issue involving this entity. For example, it might have detected a duplicate IP address or MAC address, or a host in a cluster might be out of compliance. The meanings of the configStatus values are: <ul> <li>red: A problem has been detected involving the entity. <li>yellow: A problem is about to occur or a transient condition has occurred (For example, reconfigure fail-over policy). <li>green: No configuration issues have been detected. <li>gray: The configuration status of the entity is not being monitored. </ul> A green status indicates only that a problem has not been detected; it is not a guarantee that the entity is problem-free. <p> The <a href="VcManagedEntity.html#configIssue">VcManagedEntity</a> property contains a list of the problems that have been detected. In releases after vSphere API 5.0, vSphere Servers might not generate property collector update notifications for this property. To obtain the latest value of the property, you can use PropertyCollector methods RetrievePropertiesEx or WaitForUpdatesEx. If you use the PropertyCollector.WaitForUpdatesEx method, specify an empty string for the version parameter. Any other version value will not produce any property values as no updates are generated.
customValue VcCustomFieldValue[] Custom field values.
declaredAlarmState VcAlarmState[] A set of alarm states for alarms that apply to this managed entity. The set includes alarms defined on this entity and alarms inherited from the parent entity, or from any ancestors in the inventory hierarchy. <p> Alarms are inherited if they can be triggered by this entity or its descendants. This set does not include alarms that are defined on descendants of this entity.
disabledMethod String[] List of operations that are disabled, given the current runtime state of the entity. For example, a power-on operation always fails if a virtual machine is already powered on. This list can be used by clients to enable or disable operations in a graphical user interface. <p> Note: This list is determined by the current runtime state of an entity, not by its permissions. <p> This list may include the following operations for a HostSystem: <ul> <li><a href="VcHostSystem.html#enterMaintenanceMode">VcHostSystem</a> <li><a href="VcHostSystem.html#exitMaintenanceMode">VcHostSystem</a> <li><a href="VcHostSystem.html#reboot">VcHostSystem</a> <li><a href="VcHostSystem.html#shutdown">VcHostSystem</a> <li><a href="VcHostSystem.html#reconnect">VcHostSystem</a> <li><a href="VcHostSystem.html#disconnect">VcHostSystem</a> </ul> <p> This list may include the following operations for a VirtualMachine: <ul> <li><a href="VcVirtualMachine.html#answer">VcVirtualMachine</a> <li><a href="VcManagedEntity.html#rename">VcManagedEntity</a> <li><a href="VcVirtualMachine.html#clone">VcVirtualMachine</a> <li><a href="VcVirtualMachine.html#powerOff">VcVirtualMachine</a> <li><a href="VcVirtualMachine.html#powerOn">VcVirtualMachine</a> <li><a href="VcVirtualMachine.html#suspend">VcVirtualMachine</a> <li><a href="VcVirtualMachine.html#reset">VcVirtualMachine</a> <li><a href="VcVirtualMachine.html#reconfigure">VcVirtualMachine</a> <li><a href="VcVirtualMachine.html#relocate">VcVirtualMachine</a> <li><a href="VcVirtualMachine.html#migrate">VcVirtualMachine</a> <li><a href="VcVirtualMachine.html#customize">VcVirtualMachine</a> <li><a href="VcVirtualMachine.html#shutdownGuest">VcVirtualMachine</a> <li><a href="VcVirtualMachine.html#standbyGuest">VcVirtualMachine</a> <li><a href="VcVirtualMachine.html#rebootGuest">VcVirtualMachine</a> <li><a href="VcVirtualMachine.html#createSnapshot">VcVirtualMachine</a> <li><a href="VcVirtualMachine.html#removeAllSnapshots">VcVirtualMachine</a> <li><a href="VcVirtualMachine.html#revertToCurrentSnapshot">VcVirtualMachine</a> <li><a href="VcVirtualMachine.html#markAsTemplate">VcVirtualMachine</a> <li><a href="VcVirtualMachine.html#markAsVirtualMachine">VcVirtualMachine</a> <li><a href="VcVirtualMachine.html#resetGuestInformation">VcVirtualMachine</a> <li><a href="VcVirtualMachine.html#mountToolsInstaller">VcVirtualMachine</a> <li><a href="VcVirtualMachine.html#unmountToolsInstaller">VcVirtualMachine</a> <li><a href="VcManagedEntity.html#destroy">VcManagedEntity</a> <li><a href="VcVirtualMachine.html#upgradeVirtualHardware">VcVirtualMachine</a> <li><a href="VcVirtualMachine.html#exportVm">VcVirtualMachine</a> </ul> <p> This list may include the following operations for a ResourcePool: <ul> <li><a href="VcResourcePool.html#importVApp">VcResourcePool</a> <li><a href="VcResourcePool.html#createVm">VcResourcePool</a> <li><a href="VcResourcePool.html#updateConfig">VcResourcePool</a> <li><a href="VcFolder.html#createVm">VcFolder</a> <li><a href="VcManagedEntity.html#destroy">VcManagedEntity</a> <li><a href="VcManagedEntity.html#rename">VcManagedEntity</a> </ul> This list may include the following operations for a VirtualApp: <ul> <li><a href="VcManagedEntity.html#destroy">VcManagedEntity</a> <li><a href="VcVirtualApp.html#clone">VcVirtualApp</a> <li><a href="VcVirtualApp.html#unregister">VcVirtualApp</a> <li><a href="VcVirtualApp.html#exportVApp">VcVirtualApp</a> <li><a href="VcVirtualApp.html#powerOn">VcVirtualApp</a> <li><a href="VcVirtualApp.html#powerOff">VcVirtualApp</a> <li><a href="VcVirtualApp.html#updateVAppConfig">VcVirtualApp</a> </ul> <p> In releases after vSphere API 5.0, vSphere Servers might not generate property collector update notifications for this property. To obtain the latest value of the property, you can use PropertyCollector methods RetrievePropertiesEx or WaitForUpdatesEx. If you use the PropertyCollector.WaitForUpdatesEx method, specify an empty string for the version parameter. Any other version value will not produce any property values as no updates are generated.
effectiveRole Number[] Access rights the current session has to this entity.
host VcDatastoreHostMount[] Hosts attached to this datastore.
id String returns the id of this ManagedObject
info VcDatastoreInfo Specific information about the datastore.
initialProperties String[]
iormConfiguration VcStorageIORMInfo 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. <p> 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 <a href="VcStorageResourceManager.html#ConfigureDatastoreIORM">VcStorageResourceManager</a>
name String Name of this entity, unique relative to its parent. <p> Any / (slash), \ (backslash), character used in this name element will be escaped. Similarly, any % (percent) character used in this name element will be escaped, unless it is used to start an escape sequence. A slash is escaped as %2F or %2f. A backslash is escaped as %5C or %5c, and a percent is escaped as %25.
overallStatus VcManagedEntityStatus General health of this managed entity. The overall status of the managed entity is computed as the worst status among its alarms and the configuration issues detected on the entity. The status is reported as one of the following values: <ul> <li>red: The entity has alarms or configuration issues with a red status. <li>yellow: The entity does not have alarms or configuration issues with a red status, and has at least one with a yellow status. <li>green: The entity does not have alarms or configuration issues with a red or yellow status, and has at least one with a green status. <li>gray: All of the entity's alarms have a gray status and the configuration status of the entity is not being monitored. </ul> In releases after vSphere API 5.0, vSphere Servers might not generate property collector update notifications for this property. To obtain the latest value of the property, you can use PropertyCollector methods RetrievePropertiesEx or WaitForUpdatesEx. If you use the PropertyCollector.WaitForUpdatesEx method, specify an empty string for the version parameter. Any other version value will not produce any property values as no updates are generated.
parent VcManagedEntity Parent of this entity. <p> This value is null for the root object and for <a href="VcVirtualMachine.html">VcVirtualMachine</a> objects that are part of a <a href="VcVirtualApp.html">VcVirtualApp</a>.
permission VcPermission[] List of permissions defined for this entity.
recentTask VcTask[] The set of recent tasks operating on this managed entity. This is a subset of <a href="VcTaskManager.html#recentTask">VcTaskManager</a> belong to this entity. A task in this list could be in one of the four states: pending, running, success or error. <p> This property can be used to deduce intermediate power states for a virtual machine entity. For example, if the current powerState is "poweredOn" and there is a running task performing the "suspend" operation, then the virtual machine's intermediate state might be described as "suspending." <p> Most tasks (such as power operations) obtain exclusive access to the virtual machine, so it is unusual for this list to contain more than one running task. One exception, however, is the task of cloning a virtual machine. In releases after vSphere API 5.0, vSphere Servers might not generate property collector update notifications for this property. To obtain the latest value of the property, you can use PropertyCollector methods RetrievePropertiesEx or WaitForUpdatesEx. If you use the PropertyCollector.WaitForUpdatesEx method, specify an empty string for the version parameter. Any other version value will not produce any property values as no updates are generated.
reference VcManagedObjectReference returns the ManagedObjectReference of this ManagedObject
sdkConnection VcSdkConnection returns the parent SdkConnection
summary VcDatastoreSummary Global properties of the datastore.
tag VcTag[] The set of tags associated with this managed entity. Experimental. Subject to change.
triggeredAlarmState VcAlarmState[] A set of alarm states for alarms triggered by this entity or by its descendants. <p> Triggered alarms are propagated up the inventory hierarchy so that a user can readily tell when a descendant has triggered an alarm. In releases after vSphere API 5.0, vSphere Servers might not generate property collector update notifications for this property. To obtain the latest value of the property, you can use PropertyCollector methods RetrievePropertiesEx or WaitForUpdatesEx. If you use the PropertyCollector.WaitForUpdatesEx method, specify an empty string for the version parameter. Any other version value will not produce any property values as no updates are generated.
value VcCustomFieldValue[] List of custom field values. Each value uses a key to associate an instance of a <a href="VcCustomFieldStringValue.html">VcCustomFieldStringValue</a> with a custom field definition.
vimHost VcSdkConnection returns the parent SdkConnection (deprecated)
vimType String returns the type of this ManagedObject
vm VcVirtualMachine[] Virtual machines stored on this datastore.

Methods

Name Returns
VcDatastore(com.vmware.vmo.plugin.vi4.model.IVimObjectFactory , VcManagedObjectReference , String ) constructor
createTrigger(Number timeout, String filter, String condition, String filterToSync) Trigger
datastoreEnterMaintenanceMode() VcStoragePlacementResult
datastoreExitMaintenanceMode_Task() VcTask
destroy_Task() VcTask
destroyDatastore() void
refreshDatastore() void
refreshDatastoreStorageInfo() void
reload() void
rename_Task(String newName) VcTask
renameDatastore(String newName) void
setCustomValue(String key, String value) void
updateVirtualMachineFiles_Task(VcDatastoreMountPathDatastorePair[] mountPathDatastoreMapping) VcTask

Returned by

Method Returns
VcHostDatastoreSystem.createLocalDatastore(String name, String path) VcDatastore
VcHostDatastoreSystem.createNasDatastore(VcHostNasVolumeSpec spec) VcDatastore
VcHostDatastoreSystem.createVmfsDatastore(VcVmfsDatastoreCreateSpec spec) VcDatastore
VcHostDatastoreSystem.expandVmfsDatastore(VcDatastore datastore, VcVmfsDatastoreExpandSpec spec) VcDatastore
VcHostDatastoreSystem.extendVmfsDatastore(VcDatastore datastore, VcVmfsDatastoreExtendSpec spec) VcDatastore
VcPlugin.getAllDatastores(String[] additionalPropertyFilters, String query) VcDatastore[]
VcSdkConnection.getAllDatastores(String[] additionalPropertyFilters, String query) VcDatastore[]

Referenced in

Method Returns
VcDatastoreNamespaceManager.createDirectory(VcDatastore datastore, String displayName, String policy) String
VcFileManager.uploadFileToDatastore(VcDatacenter datacenter, VcDatastore datastore, String srcFilePath, String destFilePath) boolean
VcHostDatastoreSystem.expandVmfsDatastore(VcDatastore datastore, VcVmfsDatastoreExpandSpec spec) VcDatastore
VcHostDatastoreSystem.extendVmfsDatastore(VcDatastore datastore, VcVmfsDatastoreExtendSpec spec) VcDatastore
VcHostDatastoreSystem.queryAvailableDisksForVmfs(VcDatastore datastore) VcHostScsiDisk[]
VcHostDatastoreSystem.queryVmfsDatastoreExpandOptions(VcDatastore datastore) VcVmfsDatastoreOption[]
VcHostDatastoreSystem.queryVmfsDatastoreExtendOptions(VcDatastore datastore, String devicePath, boolean suppressExpandCandidates) VcVmfsDatastoreOption[]
VcHostDatastoreSystem.removeDatastore(VcDatastore datastore) void
VcHostDatastoreSystem.removeDatastoreEx_Task(VcDatastore[] ) VcTask
VcHostDatastoreSystem.updateLocalSwapDatastore(VcDatastore datastore) void
VcOvfManager.createImportSpec(String ovfDescriptor, VcResourcePool resourcePool, VcDatastore datastore, VcOvfCreateImportSpecParams cisp) VcOvfCreateImportSpecResult
VcPlugin.getProvisionedSpace(VcDatastore datastore) Number
VcPlugin.importOvf(String ovfUri, VcHostSystem hostSystem, String importFolderName, String vmName, VcOvfNetworkMapping[] networks, VcDatastore datastore, VcKeyValue[] props) VcVirtualMachine
VcStorageResourceManager.configureDatastoreIORM_Task(VcDatastore datastore, VcStorageIORMConfigSpec spec) VcTask
VcStorageResourceManager.queryDatastorePerformanceSummary(VcDatastore datastore) VcStoragePerformanceSummary[]