The Create Virtual Machine operation creates a new virtual machine (VM) on the Microsoft Hyper-V server. 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 Create Virtual Machine operation
The following figure shows a sample <items> XML element for the Create Virtual Machine operation.
Sample <items> XML element for the Create Virtual Machine operation
<items>
        <item>
          <target>
            <host>10.128.8.172</host>
            <user-name>administrator</user-name>
            <password   encryption-type="Base64">pwd</password>   
            <timeout-secs>120</timeout-secs>
          </target>
          <name>VM1</name>
          <path>D:\Virtual Machines\</path>
        </item>
        <item>
          <target>
            <host>pw-pun-rds-dv01</host>
            <user-name>administrator</user-name>
            <password>pwd</password>   
          </target>
          <name>VM2</name>
        </item>
        <item>
          <target>Config1</target>
          <name>VM3</name>
          <path>D:\Virtual Machines\</path>        
        </item>
</items>
 
 The following figure shows a sample adapter request for the Create Virtual Machine operation:
Sample adapter request for the Create Virtual Machine operation
<ms-hyperv-request>
    <operation-name>create-virtual-machine</operation-name>
    <arguments>
      <target>
        <host>10.128.8.172</host>
        <user-name>administrator</user-name>
        <password encryption-type="Base64">pwd</password>
        <timeout-secs>120</timeout-secs>
      </target>
      <name>VM1</name>
      <path>D:\Virtual Machines\</path>
    </arguments>
    <arguments>
      <target>
        <host>pw-pun-rds-dv01</host>
        <user-name>administrator</user-name>
        <password>pwd</password>
      </target>
      <name>VM2</name>
    </arguments>
    <arguments>
      <target>Config1</target>
      <name>VM3</name>
      <path>D:\Virtual Machines\</path>
    </arguments>
</ms-hyperv-request>
 
 The following figure shows a sample adapter response for the Create Virtual Machine operation:
Sample adapter response for the Create Virtual Machine operation
<ms-hyperv-response>
  <metadata>
    <status>success</status>
    <response-count>1</response-count>
  </metadata>
  <responses>
    <CreateVirtualMachineResponse>
      <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_ComputerSystem</class>
          <superclass>CIM_ComputerSystem</superclass>
          <dynasty>CIM_ManagedElement</dynasty>
          <relpath>Msvm_ComputerSystem.CreationClassName="Msvm_Com</relpath>
          <property-count>29</property-count>
          <derivation>{CIM_ComputerSystem, CIM_System, CIM_EnabledLog</derivation>
          <server>PW-PUN-RDS-DV01</server>
          <namespace>root\virtualization</namespace>
          <path>\\PW-PUN-RDS-DV01\root\virtualization:Msvm_Comp</path>
          <assigned-numa-node-list>{}</assigned-numa-node-list>
          <caption>Virtual Machine</caption>
          <creation-class-name>Msvm_ComputerSystem</creation-class-name>
          <dedicated></dedicated>
          <description>Microsoft Virtual Machine</description>
          <element-name>VM1</element-name>
          <enabled-default>2</enabled-default>
          <state>Stopped</state>
          <health-state>5</health-state>
          <identifying-descriptions></identifying-descriptions>
          <install-date>20120307044614.000000-000</install-date>
          <guid>EDEF3C27-A88A-4069-B365-98346E4C291E</guid>
          <name-format></name-format>
          <on-time-in-milliseconds>0</on-time-in-milliseconds>
          <operational-status>{2}</operational-status>
          <other-dedicated-descriptions></other-dedicated-descriptions>
          <other-enabled-state></other-enabled-state>
          <other-identifying-info></other-identifying-info>
          <power-management-capabilities></power-management-capabilities>
          <primary-owner-contact></primary-owner-contact>
          <primary-owner-name></primary-owner-name>
          <process-i-d>0</process-i-d>
          <requested-state>Not Applicable</requested-state>
          <reset-capability>1</reset-capability>
          <roles></roles>
          <status></status>
          <status-descriptions>{Operating normally}</status-descriptions>
          <time-of-last-configuration-change>20120307044614.003574-000 begin_of_the_skype_highlighting            003574-000      end_of_the_skype_highlighting</time-of-last-configuration-change>
          <time-of-last-state-change>16010101000000.000000-000</time-of-last-state-change>
        </item>
      </items>
    </CreateVirtualMachineResponse>
  </responses>
</ms-hyperv-response>