Mount Virtual Disk operation

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-type attribute 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

<vm>

Specifies the name of the VM on which the virtual disk is to be mounted

Yes

<vm-guid>

Specifies the globally unique identifier (GUID) of a VM to restrict the operation to that VM if multiple VMs have the same name

No

<controller-id>

Specifies the zero-based ID of the intended controller

Valid values: Any integer

Default value: 0

No

<lun>

Specifies the zero-based logical unit number (LUN) of the drive on the controller on which the disk needs to be mounted

Valid values: Any integer

Default value: 0

No

<path>

Specifies the location of the virtual disk

Yes

<optical-drive>

Indicates whether the target is an optical drive

Valid values: true, false (default)

No

<scsi>

Indicates whether the target is a Small Computer System Interface (SCSI) drive

If you do not specify <scsi>, an Integrated Drive Electronics (IDE) interface is used.

Valid values: true, false (default)

No

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

 Sample



<items>
        <item>
            <target>
                <host>10.128.8.172</host>
                <user-name>administrator</user-name>
                <password   encryption-type="Base64">XXXXX</password>   
                <timeout-secs>120</timeout-secs>
            </target>
            <vm>VM1</vm>
            <vm-guid>1CCBFE38-FF48-424F-9FE2-713293C7105F</vm-guid>
            <controller-id>1</controller-id>
            <lun>1</lun>
            <path>D:\ISO\rhel-server-5.4-i386-dvd.iso</path>
            <optical-drive>true</optical-drive>
            <scsi>false</scsi>
        </item>
        <item>
            <target>
                <host>pw-pun-rds-dv01</host>
                <user-name>administrator</user-name>
                <password>XXXXX</password>   
            </target>
            <vm>VM45</vm>
            <vm-guid></vm-guid>
            <controller-id>1</controller-id>
            <lun>0</lun>
            <path>D:\VMs\vw-pun-bpa-dv04\vw-pun-bpa-dv04\vw-pun-bpa-dv04.vhd</path>
            <optical-drive></optical-drive>
            <scsi></scsi>
        </item>
        <item>
            <vm>VM45</vm>
            <vm-guid></vm-guid>
            <controller-id>1</controller-id>
            <lun>1</lun>
            <path>D:\VMs\vw-pun-bpa-dv05\vw-pun-bpa-dv05.vhd</path>
            <optical-drive></optical-drive>
            <scsi>true</scsi>
        </item>
        <item>
            <target>Config1</target>
            <vm>RHEL5</vm>
            <vm-guid></vm-guid>
            <controller-id></controller-id>
            <lun></lun>
            <path>D:\ISO\rhel-server-5.4-i386-dvd.iso</path>
            <optical-drive>true</optical-drive>
            <scsi></scsi>
        </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>10.128.8.172</host>
        <user-name>administrator</user-name>
        <password encryption-type="Base64">XXXXX</password>
        <timeout-secs>120</timeout-secs>
      </target>
      <vm>VM1</vm>
      <vm-guid>1CCBFE38-FF48-424F-9FE2-713293C7105F</vm-guid>
      <controller-id>1</controller-id>
      <lun>1</lun>
      <path>D:\ISO\rhel-server-5.4-i386-dvd.iso</path>
      <optical-drive>true</optical-drive>
      <scsi>false</scsi>
    </arguments>
    <arguments>
      <target>
        <host>pw-pun-rds-dv01</host>
        <user-name>administrator</user-name>
        <password>XXXXX</password>
      </target>
      <vm>VM45</vm>
      <vm-guid />
      <controller-id>1</controller-id>
      <lun>0</lun>
      <path>D:\VMs\vw-pun-bpa-dv04\vw-pun-bpa-dv04\vw-pun-bpa-dv04.vhd</path>
      <optical-drive />
      <scsi />
    </arguments>
    <arguments>
      <vm>VM45</vm>
      <vm-guid />
      <controller-id>1</controller-id>
      <lun>1</lun>
      <path>D:\VMs\vw-pun-bpa-dv05\vw-pun-bpa-dv05.vhd</path>
      <optical-drive />
      <scsi>true</scsi>
    </arguments>
    <arguments>
      <target>Config1</target>
      <vm>RHEL5</vm>
      <vm-guid />
      <controller-id />
      <lun />
      <path>D:\ISO\rhel-server-5.4-i386-dvd.iso</path>
      <optical-drive>true</optical-drive>
      <scsi />
    </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>4</response-count>
  </metadata>
  <responses>
    <MountVirtualDiskResponse>
      <metadata>
        <target>10.128.8.172</target>
        <status>success</status>
        <count>1</count>
      </metadata>
      <items>
        <item>
          <vm-element-name>VM1</vm-element-name>
          <genus>2</genus>
          <class>Msvm_ResourceAllocationSettingData</class>
          <superclass>CIM_ResourceAllocationSettingData</superclass>
          <dynasty>CIM_ManagedElement</dynasty>
          <relpath>Msvm_ResourceAllocationSettingData.InstanceID="Micro</relpath>
          <soft>1CCBFE38-FF48-424F-9FE2-713293C7105F\\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\\1\\1\\L"</soft>
          <property-count>22</property-count>
          <derivation>{CIM_ResourceAllocationSettingData, CIM_SettingData,CIM_ManagedElement}</derivation>
          <server>PW-PUN-RDS-DV01</server>
          <namespace>root\virtualization</namespace>
          <path>\\PW-PUN-RDS-DV01\root\virtualization:Msvm_ResourceA1CCBFE38-FF48-424F-9FE2-713293C7105F\\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\\1\\1\\L"</path>
          <address></address>
          <allocation-units>Disks</allocation-units>
          <automatic-allocation>True</automatic-allocation>
          <automatic-deallocation>True</automatic-deallocation>
          <caption>ISO Disk Image</caption>
          <connection>{D:\ISO\rhel-server-5.4-i386-dvd.iso}</connection>
          <consumer-visibility>3</consumer-visibility>
          <description>Settings for the Microsoft ISO Disk Image.</description>
          <element-name>ISO Disk Image</element-name>
          <host-resource></host-resource>
          <instance-i-d>Microsoft:1CCBFE38-FF48-424F-9FE2-713293C7105F\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\1\1\L</instance-i-d>
          <limit>1</limit>
          <mapping-behavior></mapping-behavior>
          <other-resource-type></other-resource-type>
          <parent>\\PW-PUN-RDS-DV01\root\virtualization:Msvm_ResourceA1CCBFE38-FF48-424F-9FE2-713293C7105F\\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\\1\\1\\D"</parent>
          <pool-i-d>Microsoft:D92D268E-9AA8-49dd-8C7D-821CEFB5F597\Root</pool-i-d>
          <reservation>1</reservation>
          <resource-sub-type>Microsoft Virtual CD/DVD Disk</resource-sub-type>
          <resource-type>21</resource-type>
          <virtual-quantity>1</virtual-quantity>
          <virtual-system-identifiers></virtual-system-identifiers>
          <weight>0</weight>
        </item>
      </items>
    </MountVirtualDiskResponse>
    <MountVirtualDiskResponse>
      <metadata>
        <target>pw-pun-rds-dv01</target>
        <status>success</status>
        <count>1</count>
      </metadata>
      <items>
        <item>
          <vm-element-name>VM45</vm-element-name>
          <genus>2</genus>
          <class>Msvm_ResourceAllocationSettingData</class>
          <superclass>CIM_ResourceAllocationSettingData</superclass>
          <dynasty>CIM_ManagedElement</dynasty>
          <relpath>Msvm_ResourceAllocationSettingData.InstanceID="Micro</relpath>
          <soft>8F7A9D52-F292-4599-95C7-1D559595D9CB\\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\\1\\0\\L"</soft>
          <property-count>22</property-count>
          <derivation>{CIM_ResourceAllocationSettingData, CIM_SettingData,CIM_ManagedElement}</derivation>
          <server>PW-PUN-RDS-DV01</server>
          <namespace>root\virtualization</namespace>
          <path>\\PW-PUN-RDS-DV01\root\virtualization:Msvm_ResourceA8F7A9D52-F292-4599-95C7-1D559595D9CB\\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\\1\\0\\L"</path>
          <address></address>
          <allocation-units>Disks</allocation-units>
          <automatic-allocation>True</automatic-allocation>
          <automatic-deallocation>True</automatic-deallocation>
          <caption>Hard Disk Image</caption>
          <connection>{D:\VMs\vw-pun-bpa-dv04\vw-pun-bpa-dv04\vw-pun-bpa-dv04.vhd}</connection>
          <consumer-visibility>3</consumer-visibility>
          <description>Settings for the Microsoft Hard Disk Image.</description>
          <element-name>Hard Disk Image</element-name>
          <host-resource></host-resource>
          <instance-i-d>Microsoft:8F7A9D52-F292-4599-95C7-1D559595D9CB\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\1\0\L</instance-i-d>
          <limit>1</limit>
          <mapping-behavior></mapping-behavior>
          <other-resource-type></other-resource-type>
          <parent>\\PW-PUN-RDS-DV01\root\virtualization:Msvm_ResourceA8F7A9D52-F292-4599-95C7-1D559595D9CB\\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\\1\\0\\D"</parent>
          <pool-i-d>Microsoft:70BB60D2-A9D3-46aa-B654-3DE53004B4F8\Root</pool-i-d>
          <reservation>1</reservation>
          <resource-sub-type>Microsoft Virtual Hard Disk</resource-sub-type>
          <resource-type>21</resource-type>
          <virtual-quantity>1</virtual-quantity>
          <virtual-system-identifiers></virtual-system-identifiers>
          <weight>0</weight>
        </item>
      </items>
    </MountVirtualDiskResponse>
    <MountVirtualDiskResponse>
      <metadata>
        <target>10.128.8.172</target>
        <status>success</status>
        <count>1</count>
      </metadata>
      <items>
        <item>
          <vm-element-name>VM45</vm-element-name>
          <genus>2</genus>
          <class>Msvm_ResourceAllocationSettingData</class>
          <superclass>CIM_ResourceAllocationSettingData</superclass>
          <dynasty>CIM_ManagedElement</dynasty>
          <relpath>Msvm_ResourceAllocationSettingData.InstanceID="Micro</relpath>
          <soft>8F7A9D52-F292-4599-95C7-1D559595D9CB\\E3FE821D-0F5A-47AA-9DA9-C85DD4AEC7B9\\0\\1\\L"</soft>
          <property-count>22</property-count>
          <derivation>{CIM_ResourceAllocationSettingData, CIM_SettingData,CIM_ManagedElement}</derivation>
          <server>PW-PUN-RDS-DV01</server>
          <namespace>root\virtualization</namespace>
          <path>\\PW-PUN-RDS-DV01\root\virtualization:Msvm_ResourceA8F7A9D52-F292-4599-95C7-1D559595D9CB\\E3FE821D-0F5A-47AA-9DA9-C85DD4AEC7B9\\0\\1\\L"</path>
          <address></address>
          <allocation-units>Disks</allocation-units>
          <automatic-allocation>True</automatic-allocation>
          <automatic-deallocation>True</automatic-deallocation>
          <caption>Hard Disk Image</caption>
          <connection>{D:\VMs\vw-pun-bpa-dv05\vw-pun-bpa-dv05.vhd}</connection>
          <consumer-visibility>3</consumer-visibility>
          <description>Settings for the Microsoft Hard Disk Image.</description>
          <element-name>Hard Disk Image</element-name>
          <host-resource></host-resource>
          <instance-i-d>Microsoft:8F7A9D52-F292-4599-95C7-1D559595D9CB\E3FE821D-0F5A-47AA-9DA9-C85DD4AEC7B9\0\1\L</instance-i-d>
          <limit>1</limit>
          <mapping-behavior></mapping-behavior>
          <other-resource-type></other-resource-type>
          <parent>\\PW-PUN-RDS-DV01\root\virtualization:Msvm_ResourceA8F7A9D52-F292-4599-95C7-1D559595D9CB\\E3FE821D-0F5A-47AA-9DA9-C85DD4AEC7B9\\0\\1\\D"</parent>
          <pool-i-d>Microsoft:70BB60D2-A9D3-46aa-B654-3DE53004B4F8\Root</pool-i-d>
          <reservation>1</reservation>
          <resource-sub-type>Microsoft Virtual Hard Disk</resource-sub-type>
          <resource-type>21</resource-type>
          <virtual-quantity>1</virtual-quantity>
          <virtual-system-identifiers></virtual-system-identifiers>
          <weight>0</weight>
        </item>
      </items>
    </MountVirtualDiskResponse>
    <MountVirtualDiskResponse>
      <metadata>
        <target>pw-pun-rds-dv01</target>
        <status>success</status>
        <count>1</count>
      </metadata>
      <items>
        <item>
          <vm-element-name>RHEL5</vm-element-name>
          <genus>2</genus>
          <class>Msvm_ResourceAllocationSettingData</class>
          <superclass>CIM_ResourceAllocationSettingData</superclass>
          <dynasty>CIM_ManagedElement</dynasty>
          <relpath>Msvm_ResourceAllocationSettingData.InstanceID="Micro</relpath>
          <soft>9C4BE436-1EAE-4210-AD25-EB94E14E1377\\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\\0\\0\\L"</soft>
          <property-count>22</property-count>
          <derivation>{CIM_ResourceAllocationSettingData, CIM_SettingData,CIM_ManagedElement}</derivation>
          <server>PW-PUN-RDS-DV01</server>
          <namespace>root\virtualization</namespace>
          <path>\\PW-PUN-RDS-DV01\root\virtualization:Msvm_ResourceA9C4BE436-1EAE-4210-AD25-EB94E14E1377\\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\\0\\0\\L"</path>
          <address></address>
          <allocation-units>Disks</allocation-units>
          <automatic-allocation>True</automatic-allocation>
          <automatic-deallocation>True</automatic-deallocation>
          <caption>ISO Disk Image</caption>
          <connection>{D:\ISO\rhel-server-5.4-i386-dvd.iso}</connection>
          <consumer-visibility>3</consumer-visibility>
          <description>Settings for the Microsoft ISO Disk Image.</description>
          <element-name>ISO Disk Image</element-name>
          <host-resource></host-resource>
          <instance-i-d>Microsoft:9C4BE436-1EAE-4210-AD25-EB94E14E1377\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\0\0\L</instance-i-d>
          <limit>1</limit>
          <mapping-behavior></mapping-behavior>
          <other-resource-type></other-resource-type>
          <parent>\\PW-PUN-RDS-DV01\root\virtualization:Msvm_ResourceA9C4BE436-1EAE-4210-AD25-EB94E14E1377\\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\\0\\0\\D"</parent>
          <pool-i-d>Microsoft:D92D268E-9AA8-49dd-8C7D-821CEFB5F597\Root</pool-i-d>
          <reservation>1</reservation>
          <resource-sub-type>Microsoft Virtual CD/DVD Disk</resource-sub-type>
          <resource-type>21</resource-type>
          <virtual-quantity>1</virtual-quantity>
          <virtual-system-identifiers></virtual-system-identifiers>
          <weight>0</weight>
        </item>
      </items>
    </MountVirtualDiskResponse>
  </responses>
</ms-hyperv-response> 

Was this page helpful? Yes No Submitting... Thank you

Comments