Retrieve VM File Info operation


The Retrieve VM File Info operation returns details about the files that match the specified search criteria. The operation searches the folder specified by the datastore and all corresponding subfolders. The Vmware client used by the operation must have at least browse access to the specified datastore.

The following table describes the elements for this request.

Adapter request elements for the Retrieve VM File Info operation

Element

Definition

Required

<operation-type>

Defines the type of operation: Advanced_Vm

Yes

<operation-name>

Defines the name of operation: Retrieve_VM_File_Info

Yes

<soap-url>

Specifies the URL for the remote SOAP service running on the VMware VirtualCenter

If the <soap-url> element is not specified, the request uses the VirtualCenter Server details specified in the adapter configuration.

Default format for HTTPS: https://<hostName>:<port>/sdk/vim

Default format for HTTP: http://<hostName>:<port>/sdk/vim

Note

If you want to use an HTTP value, you might need to change the configuration of the VMware Infrastructure application.

No

<transport>

Specifies the transport protocol for the message

If the <transport> element is not provided, the request uses the VirtualCenter Server details specified in the adapter configuration.

Valid values: https-rpc (default), http-rpc

Note

If the value of the <transport> element is https-rpc, you must install the security certificate for the VMware Virtual Center to the keystore of the peer on which the adapter is enabled.

No

<user-name>

Specifies the user name that is used for HTTP basic authentication on the VMware Virtual Center

If no user name is specified, the request is executed with the user name that is specified in the configuration.

No

<password>

Specifies the password corresponding to <user-name>

Conditional; required if <user-name> is specified

<parameters>

Contains the elements required to execute the operation

Yes

<virtual-machine>

Contains the name of the virtual machine on which this operation is to be executed

Yes

<datastore>

Contains the name of the datastore to search for files matching the given criteria

Valid value: String

Yes

<datacenter>

Specifies the datacenter hosting the datastore

This element is only required if duplicate datastores exist in different datacenters with the same name.

Conditional

<virtual-machine>

Contains the name of the virtual machine used to make the method call

Valid value: String

No

If this element is not specified, the file information for all virtual machines in the datastore are retrieved.

match-pattern

Contains the criteria for searching files in the datastore

For virtual machine disk files, you can obtain the actual size of the disk file by specifying flat in the match pattern.

Valid value: String

No

The following code sample shows a sample adapter request for the Retrieve VM File Info operation.

Sample adapter request for the Retrieve VM File Info operation

<vmware-infrastructure-request>
  <operation-type>Advanced_Vm</operation-type>
  <operation-name>Retrieve_VM_File_Info</operation-name>
  <soap-url></soap-url>
  <transport></transport
  <user-name></user-name>
  <password></password>
  <parameters>
     <datastore>abc15 disk3</datastore>            
     <virtual-machine>TestVM6</virtual-machine>
     <search-spec>
        <match-pattern>*.vmdk</match-pattern>
    </search-spec>
  </parameters>
</vmware-infrastructure-request>

The following code sample shows the response for the sample Retrieve VM File Info operation.

Sample adapter response for the Retrieve VM File Info operation

<vmware-infrastructure-response>
  <metadata>
   <status>success</status>
 </metadata>
<RetrieveVMFileInfoResponse>
<returnval>
 <Task>session[E421C3ED-FCC7-4BA2-93D8-1E7562B9BC06]2E8B024F-0048-4681-8A4A-546F96871866</Task>
 <propSet>
<name>info</name>
<TaskInfo>
 <key>session[E421C3ED-FCC7-4BA2-93D8-1E7562B9BC06]2E8B024F-0048-4681-8A4A-546F96871866</key>
 <Task>session[E421C3ED-FCC7-4BA2-93D8-1E7562B9BC06]2E8B024F-0048-4681-8A4A-546F96871866</Task>
 <name>SearchDatastoreSubFolders_Task</name>
 <descriptionId>host.DatastoreBrowser.searchSubFolders</descriptionId>
 <Datacenter>datacenter-2</Datacenter>
 <entityName>ABC_DEV</entityName>
 <state>success</state>
 <cancelled>false</cancelled>
 <cancelable>false</cancelable>
 <ArrayOfHostDatastoreBrowserSearchResults>
<HostDatastoreBrowserSearchResults>
 <Datastore>datastore-15</Datastore>
 <folderPath>[abc15 disk3] TestVM6/</folderPath>
 <file>
<path>TestVM6-flat.vmdk</path>
<fileSize>5144576000</fileSize>
<modification>2009-10-12T07:27:02-04:00</modification>
 </file>
 <file>
<path>TestVM6.vmdk</path>
<fileSize>396</fileSize>
<modification>2009-10-13T07:10:39-04:00</modification>
 </file>
 <file>
<path>TestVM6_1-flat.vmdk</path>
<fileSize>5144576000</fileSize>
<modification>2009-10-12T07:29:39-04:00</modification>
 </file>
 <file>
<path>TestVM6_1.vmdk</path>
<fileSize>398</fileSize>
<modification>2009-10-13T07:10:40-04:00</modification>
 </file>
</HostDatastoreBrowserSearchResults>
 </ArrayOfHostDatastoreBrowserSearchResults>
 <TaskReasonUser>
<userName>rba</userName>
 </TaskReasonUser>
 <queueTime>2009-12-28T06:13:32.6875Z</queueTime>
 <startTime>2009-12-28T06:13:32.6875Z</startTime>
 <completeTime>2009-12-28T06:13:32.8125Z</completeTime>
 <eventChainId>0</eventChainId>
</TaskInfo>
 </propSet>
</returnval>
</RetrieveVMFileInfoResponse>
</vmware-infrastructure-response>

The following code sample describes the adapter response elements.

Adapter response elements for the Retrieve VM File Info operation

Element

Definition

<Task>

A task is used to monitor and potentially cancel long running operations

<cancelable>

Flag to indicate whether or not the cancel task operation is supported

<cancelled>

Flag to indicate whether or not the client requested cancellation of the task

<completeTime>

Time stamp when the task was completed (whether success or failure)

<descriptionId>

An identifier for this operation

This includes publicly visible internal tasks and is a lookup in the TaskDescription methodInfo data object.

<entity>

Managed entity to which the operation applies

<entityName>

The name of the managed entity, locale-specific, retained for the history collector database

<error>

If the task state is error, this property contains the fault code.

<eventChainId>

Event chain ID that leads to the corresponding events

<locked>

If the state of the task is running, this property is a list of managed entities that the operation has locked, with a shared lock.

<name>

The name of the operation that created the task

This is not set for internal tasks.

<progress>

If the task state is running, this property contains a progress measurement, expressed as percentage completed, from 0 to 100.

If this property is not set, the command does not report progress.

<queueTime>

Time stamp when the task was created

<reason>

Kind of entity responsible for creating this task

<result>

If the task state is success, this property may contain a return value

<startTime>

Time stamp when the task started running

<state>

Runtime status of the task

<task>

The managed object that represents this task

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*