Unsupported content

 

This version of the product has reached end of support. The documentation is available for your convenience. However, you must be logged in to access it. You will not be able to leave comments.

Basic_VM_Operations for Hyper-V Server 2012 actor adapter

Use the <items> element when you call an adapter from an out-of-the-box process in BMC Atrium Orchestrator Development Studio. Use the adapter request XML when you create a custom process by using the Call Adapter activity in BMC Atrium Orchestrator Development Studio. 

This section illustrates the adapter requests and responses for the following basic virtual machine operations:

Find Virtual Machine Details operation

The Find Virtual Machine Details operation retrieves details of one or more virtual machines (VMs). 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 Find Virtual Machine Details operation 

Element

Description

Required

<operation-name>

Specifies the name of the operation: find-virtual-machine-details

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>
  • <host>
  • <password>
Yes
<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

<username>

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

<name>

Specifies the name of the VM for which you need to retrieve details 

If multiple VMs have the same name, the adapter retrieves the details of all these VMs.

Tip

You can use an empty <vm> element to retrieve the details of all VMs in the network.


No
<id>

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

Tip

The <vm-guid> for a specified <vm> is displayed as the value of the <guid> element in adapter response.


No
<computer-name>

Specifies one or more Hyper-V hosts on which the virtual machine is to be created

You can specify any NetBIOS names, IP addresses, and fully-qualified domain names. The default is the local computer — use “localhost” or a dot (“.”) to specify the local computer explicitly.

No

The following figure shows a sample <items> XML element for the Find Virtual Machine Details operation.

Sample <items> XML for the Find Virtual Machine Details operation

<items>
   <item>
	<target>
        <host>localhost</host>
		<user-name>admin</user-name>
		<password encryption-type="Base64">YWRtaW4=</password>
		<timeout-secs>120</timeout-secs>
	</target>
		<name>test1</name>
    </item>
	<item>
		<target>config2</target>
		<name>test1</name>
		<id>E8103920-xxxx-xxxx-xxxx-11DECB33875B</id>
		<computer-name>test-server.domain.com</computer-name>
	</item>
</items>

The following figure shows a sample adapter request for the Find Virtual Machine Details operation.

Sample adapter request for the Find Virtual Machine Details operation

<ms-hyperv-request>
  <operation-name>find-virtual-machine</operation-name>
      <arguments>
        <item>
            <target>
               <host>localhost</host>
               <user-name>admin</user-name>
               <password encryption-type="Base64">YWRtaW4=</password>
            </target>
            <name>test1</name>
            <computer-name>test-server.domain.com</computer-name> 
        </item>
      </arguments>
</ms-hyperv-request>

The following figure shows a sample adapter response for the Find Virtual Machine Details operation.

Adapter response for the Find Virtual Machine Details operation

<ms-hyperv-response>
  <metadata>
    <status>success</status>
    <response-count>1</response-count>
  </metadata>
  <responses>
    <FindVMResponse>
      <metadata>
        <target>BW-HOU-DCA-DV01</target>
        <status>success</status>
        <count>1</count>
      </metadata>
      <items>
        <item>
          <vm-name>krishmaVM1</vm-name>
          <vm-id>271db0b3-ba2e-4287-9c39-0256cd78729e</vm-id>
          <ps-computer-name>BW-HOU-DCA-DV01</ps-computer-name>
          <runspace-id>5100d4fd-7837-49a5-a2d1-0ad690c245eb</runspace-id>
          <id>271db0b3-ba2e-4287-9c39-0256cd78729e</id>
          <name>krishmaVM1</name>
          <state>Paused</state>
          <integration-services-state></integration-services-state>
          <operational-status>{Ok}</operational-status>
          <primary-operational-status>Ok</primary-operational-status>
          <secondary-operational-status></secondary-operational-status>
          <status-descriptions>{Operating normally}</status-descriptions>
          <primary-status-description>Operating normally</primary-status-description>
          <secondary-status-description></secondary-status-description>
          <status>Operating normally</status>
          <heartbeat></heartbeat>
          <replication-state>Disabled</replication-state>
          <replication-health>NotApplicable</replication-health>
          <replication-mode>None</replication-mode>
          <cpu-usage>0</cpu-usage>
          <memory-assigned>1073741824</memory-assigned>
          <memory-demand>0</memory-demand>
          <memory-status></memory-status>
          <smart-paging-file-in-use>False</smart-paging-file-in-use>
          <uptime>00:01:47</uptime>
          <integration-services-version></integration-services-version>
          <resource-metering-enabled>False</resource-metering-enabled>
          <configuration-location>C:\ProgramData\Microsoft\Windows\Hyper-V</configuration-location>
          <snapshot-file-location>C:\ProgramData\Microsoft\Windows\Hyper-V</snapshot-file-location>
          <automatic-start-action>StartIfRunning</automatic-start-action>
          <automatic-stop-action>Save</automatic-stop-action>
          <automatic-start-delay>0</automatic-start-delay>
          <smart-paging-file-path>C:\ProgramData\Microsoft\Windows\Hyper-V</smart-paging-file-path>
          <numa-aligned>False</numa-aligned>
          <numa-nodes-count>1</numa-nodes-count>
          <numa-socket-count>1</numa-socket-count>
          <key>Microsoft.HyperV.PowerShell.VirtualMachineObjectKey</key>
          <is-deleted>False</is-deleted>
          <computer-name>BW-HOU-DCA-DV01</computer-name>
          <version>5.0</version>
          <notes></notes>
          <generation>1</generation>
          <path>C:\ProgramData\Microsoft\Windows\Hyper-V</path>
          <creation-time>11/24/2014 10:38:56 PM</creation-time>
          <is-clustered>False</is-clustered>
          <size-of-system-files>66718</size-of-system-files>
          <parent-snapshot-id></parent-snapshot-id>
          <parent-snapshot-name></parent-snapshot-name>
          <memory-startup>1073741824</memory-startup>
          <dynamic-memory-enabled>True</dynamic-memory-enabled>
          <memory-minimum>536870912</memory-minimum>
          <memory-maximum>1099511627776</memory-maximum>
          <processor-count>1</processor-count>
          <remote-fx-adapter></remote-fx-adapter>
          <network-adapters>{Microsoft.HyperV.PowerShell.VMNetworkAdapter,Microsoft.HyperV.PowerShell.VMNetworkAdapter,Microsoft.HyperV.PowerShell.VMNetworkAdapter,Microsoft.HyperV.PowerShell.VMNetworkAdapter...}</network-adapters>
          <fibre-channel-host-bus-adapters>{}</fibre-channel-host-bus-adapters>
          <com-port1>Microsoft.HyperV.PowerShell.VMComPort</com-port1>
          <com-port2>Microsoft.HyperV.PowerShell.VMComPort</com-port2>
          <floppy-drive>Microsoft.HyperV.PowerShell.VMFloppyDiskDrive</floppy-drive>
          <dvd-drives>{Microsoft.HyperV.PowerShell.DvdDrive}</dvd-drives>
          <hard-drives>{Microsoft.HyperV.PowerShell.HardDiskDrive}</hard-drives>
          <vm-integration-service>{Microsoft.HyperV.PowerShell.VMIntegrationComponent, Microsoft.HyperV.PowerShell.VMIntegrationComponent, Microsoft.HyperV.PowerShell.DataExchangeComponent,Microsoft.HyperV.PowerShell.ShutdownComponent...}</vm-integration-service>
        </item>
      </items>
    </FindVMResponse>
  </responses>
</ms-hyperv-response> 

Set Virtual Machine State operation

The Set Virtual Machine State operation changes the existing state of a virtual machine (VM). 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 Set Virtual Machine State operation 

Element

Description

Required

<operation-name>

Specifies the name of the operation: set-virtual-machine-state

Yes

<arguments>

Contains the elements that specify the details of the VM whose state needs to be changed

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>

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

<name>

Specifies the name of the VM whose state needs to be changed

Yes

<state>

Specifies the new state of the VM 

Valid values:

  • Running
  • Stopped
  • Suspended

Yes

The following figure shows a sample <items> XML element for the Set Virtual Machine State operation:

Sample <items> XML for the Set Virtual Machine State operation

 <items>
	<item>
		<target>
			<host>localhost</host>
			<user-name>admin</user-name>
			<password encryption-type="Base64">YWRtaW4=</password>
			<timeout-secs>120</timeout-secs>
		</target>
		<name>test1</name>
		<state>running</state>
      </item>
	<item>
		<target>config2</target>
		<name>VMtest1</name>
		<state>running</state>
	</item>
</items>

The following figure shows a sample adapter request for the Set Virtual Machine State operation:

Sample adapter request for the Set Virtual Machine State operation
<ms-hyperv-request>
  <operation-name>set-virtual-machine-state</operation-name>
               <arguments>
            <target>
                  <host>localhost</host>
                  <user-name>admin</user-name>
                  <password encryption-type="Base64">YWRtaW4=</password>
            </target>
            <name>test1</name>
            <state>running</state>
</arguments>
</ms-hyperv-request>

The following figure shows a sample adapter response for the Set Virtual Machine State operation: 

Sample adapter response for the Set Virtual Machine State operation
 
Was this page helpful? Yes No Submitting... Thank you

Comments