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 |
---|---|---|
| Specifies the name of the operation: | 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
| Yes |
<host> | Specifies the host name or the IP address of the Hyper-V server | Conditional; required when specifying a dynamic target |
<username> | Specifies the user name to be used to connect to the Hyper-V server | Conditional; required when specifying a dynamic target |
<password> | Specifies the password that corresponds to the | Conditional; required if |
<name> | Specifies the name of the VM for which you need to retrieve details Tip You can use an empty | 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 | 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 |
---|---|---|
| Specifies the name of the operation: | Yes |
| Contains the elements that specify the details of the VM whose state needs to be changed | Yes |
| 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
| Conditional; required if a target is referenced or specified in the request |
| Specifies the host name or the IP address of the Hyper-V server | Conditional; required when specifying a dynamic target |
| Specifies the user name to be used to connect to the Hyper-V server | Conditional; required when specifying a dynamic target |
| Specifies the password that corresponds to the | Conditional; required if |
| Specifies the name of the VM whose state needs to be changed | Yes |
| Specifies the new state of the VM
| 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:
The following figure shows a sample adapter response for the Set Virtual Machine State operation:
Comments
Log in or register to comment.