Mount Virtual Disk operation for Microsoft Hyper-V Server 2012 adapter

The Mount Virtual Disk operation mounts a disk on an existing logical drive on the virtual machine (VM). This disk is usually a Virtual Hard Disk (VHD) file, but you can also specify an ISO file or the path to an optical disk. This topic illustrates the actor adapter request and response and describes the elements used in the request.

The following table describes the elements for the adapter request:

 Adapter request elements for the Mount Virtual Disk operation 

Element

Description

Required

<operation-name>

Specifies the name of the operation: mount-virtual-disk

Yes

<arguments>

Contains the elements that specify the details of the virtual disk to be mounted

Yes

<target>

Contains a dynamic target configuration or uses a predefined target configuration of the Hyper-V server on which the request is executed

Note

If you do not specify a dynamic target in the adapter request, the default adapter configuration is used.

The <target> element contains the following elements:

  • <host>
  • <user-name>
  • <password>
  • <timeout-secs>

Conditional; required if a target is referenced or specified in the request

<host>

Specifies the host name or the IP address of the Hyper-V server 

The <host> element applies to a dynamic target.

Conditional; required when specifying a dynamic target

<user-name>

Specifies the user name to be used to connect to the Hyper-V server 

The <user-name> element applies to a dynamic target.

Conditional; required when specifying a dynamic target

<password>

Specifies the password that corresponds to the <user-name>provided 

The <password> element applies to a dynamic target. 

The <password> element can contain an encryption-typeattribute that indicates whether the password specified is encrypted. 

Valid values for encryption-type: base64, plain (default)

Conditional; required if <user-name> is specified

<timeout-secs>

Specifies the time, in seconds, after which the attempt to connect to the Hyper-V server fails 

Default value: 60

No

<path>Specifies the location of the virtual diskNo
<read-only>Specifies that the virtual hard disk, which is to be mounted be in read-only modeNo

The following figure shows a sample <items> XML element for the Mount Virtual Disk operation: 

Sample <items> XML element for the Mount Virtual Disk operation

<items>
	<item>
		  <target>
			<host>localhost</host>
			<user-name>admin</user-name>
			<password encryption-type="Base64">YWRtaW4=</password>
			<timeout-secs>120</timeout-secs>
		   </target>
			<path>C:\test.vhdx</path>
      </item>
   <item>
	  <target>
			<host>localhost</host>
			<user-name>admin</user-name>
			<password encryption-type="Base64">YWRtaW4=</password>
			<timeout-secs>120</timeout-secs>
	  </target>
			<path>C:\test.vhdx</path>
			<read-only/>
   </item>
</items>

The following figure shows a sample adapter request for the Mount Virtual Disk operation: 

Sample adapter request for the Mount Virtual Disk operation
<ms-hyperv-request>
  <operation-name>mount-virtual-disk</operation-name>
         <arguments>
              <target>
                  <host>localhost</host>
                  <user-name>admin</user-name>
                  <password encryption-type="Base64">YWRtaW4=</password>
               </target>
                  <path>C:\test.vhdx</path>
        </arguments>
</ms-hyperv-request>

The following figure shows a sample adapter response for the Mount Virtual Disk operation: 

Sample adapter response for the Mount Virtual Disk operation

<ms-hyperv-response>
  <metadata>
    <status>success</status>
    <response-count>1</response-count>
  </metadata>
  <responses>
    <MountVirtualDiskResponse>
      <metadata>
        <target>BW-HOU-DCA-DV01</target>
        <status>success</status>
        <count>1</count>
      </metadata>
      <items>
        <item />
      </items>
    </MountVirtualDiskResponse>
  </responses>
</ms-hyperv-response>
Was this page helpful? Yes No Submitting... Thank you

Comments