# Managed Object - VsanObjectSystem(vim.cluster.VsanObjectSystem)

See also
  ComputeResource, Task, VirtualMachineProfileSpec, VsanHostVsanObjectSyncQueryResult, VsanObjectIdentityAndHealth, VsanObjectInformation, VsanObjectQuerySpec, VsanSyncingObjectFilter
Since
  vSphere API 5.5

## Managed Object Description

This managed object type provides the service interface for setting the storage policy to one vSAN object, querying the vSAN object status information, i.e., its storage profile, its health status.
When the ManagedEntity is accessed with MOID of 'vsan-cluster-object-system' through vSAN service at vCenter server and ESXi host side, it acts as cluster-level APIs. When it accessed with MOID of 'vsan-object-system' through vSAN service at ESXi host side, its scope is only limited to that host.

Properties

Name | Type | Description
--- | --- | ---
None

Methods

Methods defined in this Managed Object
QuerySyncingVsanObjectsSummary, RelayoutObjects, VosQueryVsanObjectInformation, VosSetVsanObjectPolicy, VsanDeleteObjects_Task, VsanQueryInaccessibleVmSwapObjects, VsanQueryObjectIdentities

# QuerySyncingVsanObjectsSummary(querySyncingVsanObjectsSummary)

Query summary information about the syncing objects in this cluster. It will retrieve information about syncing objects based on object filter options.

Required Privileges
  None
Since
  vSAN API 6.8.7

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the VsanObjectSystem used to make the method call.
cluster P | ManagedObjectReference to a ComputeResource | vSAN cluster. Since vSAN API 6.8.7
syncingObjectFilter* P | VsanSyncingObjectFilter | Filter spec for summary. Since vSAN API 6.8.7

*Need not be set P Required privilege - see tooltip for details

Return Value

Type | Description
--- | ---
VsanHostVsanObjectSyncQueryResult | result VsanSyncingObjectQueryResult.

Faults

Type | Description
--- | ---
NotSupported |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="QuerySyncingVsanObjectsSummary" type="vsan:QuerySyncingVsanObjectsSummaryRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="QuerySyncingVsanObjectsSummaryResponse"> <complexType> <sequence> <element name="returnval" type="vsan:VsanHostVsanObjectSyncQueryResult"/> </sequence> </complexType> </element>

# RelayoutObjects(relayoutObjects)

The re-layout task for the objects which need change in object format. This may involve physical on-disk re-layout of objects which will cause data movement in the cluster. Objects in the old format might not be able to use some of the new features.

Required Privileges
  None
Since
  vSAN API 7.2

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the VsanObjectSystem used to make the method call.
cluster P | ManagedObjectReference to a ComputeResource | Since vSAN API 7.2

P Required privilege: cluster

Return Value

Type | Description
--- | ---
ManagedObjectReference to a Task | The task object which represents the vSan RelayoutObjects task.

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

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="RelayoutObjects" type="vsan:RelayoutObjectsRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="RelayoutObjectsResponse"> <complexType> <sequence> <element name="returnval" type="vsan:ManagedObjectReference"/> </sequence> </complexType> </element>

# VosQueryVsanObjectInformation(queryVsanObjectInformation)

Get information about the vSAN object/directory.
If it's called in VC, the spbmProfileGenerationId can be safely ignored in vim.cluster.VsanObjectQuerySpec, it will be automatically set to the correct value by using SPBM service. If it's called in host with MOID 'vsan-object-system', both fields in VsanObjectQuerySpec should be provided, if spbmProfileGenerationId is not provided, the one from vSAN CMMDS will be used here, as a result, the mismatch field for storage compliance result is not reliable in some cases, e.g. profile is updated or deleted in vCenter after the vSAN object creation. If it's called in host with MOID 'vsan-cluster-object-system', the spbmProfileGenerationId in VsanObjectQuerySpec would be ignored and mismatch field is not reliable. Note this API can query maximum 500 vSAN objects at once when it's called from ESXi host for performance consideration, otherwise, the InvalidArgument exception will be thrown.
If the vSAN object can not be found, FileNotFound exception will be raised. If the vSAN object failed to read the policy, e.g. because it is not accessible, FileNotReadable exception will be raised.

Required Privileges
  None

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the VsanObjectSystem used to make the method call.
cluster* P | ManagedObjectReference to a ComputeResource | vSAN cluster. Ignored if called against host. Since vSphere API 5.5
vsanObjectQuerySpecs P | VsanObjectQuerySpec[] | vSAN object query spec list. Since vSphere API 5.5

*Need not be set P Required privilege - see tooltip for details

Return Value

Type | Description
--- | ---
VsanObjectInformation[] | Object information list.

Faults

Type | Description
--- | ---
FileNotFound |
FileNotWritable |
InvalidArgument |
NotSupported |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="VosQueryVsanObjectInformation" type="vsan:VosQueryVsanObjectInformationRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="VosQueryVsanObjectInformationResponse"> <complexType> <sequence> <element name="returnval" type="vsan:VsanObjectInformation" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> </element>

# VosSetVsanObjectPolicy(setVsanObjectPolicy)

Set the policy of the vSAN object. The cluster parameters is ignored if called on ESX.
Profile can be 3 formats:
1. `VirtualMachineEmptyProfileSpec` means to use the empty vSAN policy. This is not the default policy, but a policy where all fields have default values.
2. `VirtualMachineDefinedProfileSpec` where profileId is set, in which case this profileId will be looked up in SPBM for the detailed policy information.
3. `VirtualMachineDefinedProfileSpec` where profileId is an empty string and instead the profileData is set for extensionKey 'com.vmware.vim.sps'. In this case the objectData field can be either the vSAN expression format, or a SPBM XML string. If no profile is supplied, and the call is executed against vCenter, then SPBM will be consulted for the vSAN datastore's default profile.
When this method returns successfully, the profile has been applied, but vSAN may still be remediating in order to implement the new policy. The health state of the object and resync information should be monitored to check on the progress.
Only the third option for profile is available when called on ESXi, other formats will raise InvalidArgument exception. If SPBM needs to be contacted, but SPBM is not available, RuntimeFault exception will be raised. If the profileId can not be resolved with SPBM, InvalidArgument exception will be raised. If objectData was provided but is neither of the two supported formats, InvalidArgument exception will be raised. If the vSAN object can not be found, FileNotFound exception will be raised. If the vSAN object failed to set the policy, e.g. because it is not accessible, FileNotWritable exception will be raised. If called against vCenter, but no ESXi host could be contacted to perform the operation, the exception is logged and the False is returned by this method. NOTE: This API requires additional Global.Settings privilege if called against vSphere 65P02 release.

Required Privileges
  None

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the VsanObjectSystem used to make the method call.
cluster* P | ManagedObjectReference to a ComputeResource | vSAN cluster. Ignored if called against host. Since vSphere API 5.5
vsanObjectUuid P | xsd:string | vSAN object UUID. Since vSphere API 5.5
profile* P | VirtualMachineProfileSpec | See above description for all possible options. Since vSphere API 5.5

*Need not be set P Required privilege - see tooltip for details

Return Value

Type | Description
--- | ---
xsd:boolean | True when the operation successfully, False when it is failed and there is no exception raised.

Faults

Type | Description
--- | ---
FileNotFound |
FileNotWritable |
InvalidArgument |
NotSupported |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="VosSetVsanObjectPolicy" type="vsan:VosSetVsanObjectPolicyRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="VosSetVsanObjectPolicyResponse"> <complexType> <sequence> <element name="returnval" type="xsd:boolean"/> </sequence> </complexType> </element>

# VsanDeleteObjects_Task(deleteObjects)

Delete vSAN Objects on vSAN cluster. When the 'cluster' parameter is specified, this is a cluster level asynchronous API. The delete operation will return a task result which tracks progress, please check the task state when use. When it's called again host, it's a host level asynchronous API, which deprecates the 'DeleteVsanObjects' in vim.vsan.VsanInternalSystem. WARNING: This API can be slow because we do IOs to all the objects. This API can be used to delete vSAN objects. vSAN won't allow access to objects which have lost quorum. Such objects can be deleted with the optional "force" flag.

Required Privileges
  None
Since
  vSAN API vSAN 6.7U1

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the VsanObjectSystem used to make the method call.
cluster* P | ManagedObjectReference to a ComputeResource | vSAN cluster. Ignored if called against host. Since vSAN API vSAN 6.7U1
objUuids P | xsd:string[] | The vSAN object UUIDs to delete. Since vSAN API vSAN 6.7U1
force* P | xsd:boolean | The force flag, inaccessible objects can't be deleted without this flag. WARNING: it's at your own risk. Since vSAN API vSAN 6.7U1

*Need not be set P Required privilege - see tooltip for details

Return Value

Type | Description
--- | ---
ManagedObjectReference to a Task |

Faults

Type | Description
--- | ---
InvalidArgument |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.
VsanFault |

Events

Type
None

# VsanQueryInaccessibleVmSwapObjects(queryInaccessibleVmSwapObjects)

Query all inaccessible vmswap objects on a vSAN cluster. It works on both cluster level and host level.

Required Privileges
  None
Since
  vSAN API vSAN 6.7U1

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the VsanObjectSystem used to make the method call.
cluster* P | ManagedObjectReference to a ComputeResource | vSAN cluster. Ignored if called against host. Since vSAN API vSAN 6.7U1

*Need not be set P Required privilege: cluster

Return Value

Type | Description
--- | ---
xsd:string[] | list of inaccessible vmswap objects.

Faults

Type | Description
--- | ---
NotSupported |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="VsanQueryInaccessibleVmSwapObjects" type="vsan:VsanQueryInaccessibleVmSwapObjectsRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="VsanQueryInaccessibleVmSwapObjectsResponse"> <complexType> <sequence> <element name="returnval" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> </element>

# VsanQueryObjectIdentities(queryObjectIdentities)

Map from vSAN object UUIDs to their identities. The results contain the identities of all objects that could be resolved. The identity includes things like the object type, references to the VM the object belongs to and such. If called against a host with MOID 'vsan-object-system', the cluster argument is ignored and, only those objects are resolved which can be resolved by that host. For VM related objects a host can only resolve the objects if the VM they belong to is registered on that host. If called against a host with MOID 'vsan-cluster-object-system', the cluster argument is ignored and cluster wide object identities would be returned except template VM, and in identities, the VM property would be left unset. If called against vCenter, all connected hosts will be contacted for this information and the results will be aggregated. Any VMs registered with hosts which are disconnected will hence not be resolved. It's not recommended to use this API to get all of vSAN object identities at once to avoid potential performance issue due to large response in large scale cluster. Instead, we should limit the output by specifying various filter parameters like the objects UUID, object type, only including health or identity result etc.

Required Privileges
  None

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the VsanObjectSystem used to make the method call.
cluster* P | ManagedObjectReference to a ComputeResource | vSAN cluster. Ignored if called against host. Since vSphere API 5.5
objUuids* P | xsd:string[] | The vSAN object UUIDs for querying. Unset to query all of vSAN objects Since vSphere API 5.5
objTypes* P | xsd:string[] | Querying the vSAN objects with given types, only the object whose type in this list will be returned. All of available object types include 'vmswap', 'vdisk', 'namespace', 'vmem', 'stats', 'other', 'iscsiHome', 'iscsiLun', 'iscsiTarget' and 'fileShare'. Unset to query all of vSAN objects with any type Since vSphere API 5.5
includeHealth* P | xsd:boolean | If the result includes the object health status. Default is False Since vSphere API 5.5
includeObjIdentity* P | xsd:boolean | If the result includes all of the object identity. Default is True if it's unset Since vSphere API 5.5
includeSpaceSummary* P | xsd:boolean | If the result includes the vSAN space consumption summarizing by object type. Currently, it's not supported to include both of space summary and object identity in the result. Default is false. Since vSphere API 5.5

*Need not be set P Required privilege - see tooltip for details

Return Value

Type | Description
--- | ---
VsanObjectIdentityAndHealth | Object information structure

Faults

Type | Description
--- | ---
NotSupported |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.
VsanFault |

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="VsanQueryObjectIdentities" type="vsan:VsanQueryObjectIdentitiesRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="VsanQueryObjectIdentitiesResponse"> <complexType> <sequence> <element name="returnval" type="vsan:VsanObjectIdentityAndHealth" minOccurs="0"/> </sequence> </complexType> </element>