3mime
Contributor
Contributor

Get VM id as wanted by Lab Manager SOAP API

hello,

I'm facing with a problem which involves both PowerCLI and the powershell binding for Lab Manager SOAP API (http://blogs.vmware.com/vipowershell/2009/01/managing-vmware-lab-manager-with-ctp3.html). For example:

$myvm = get-vm -name "myvm"

In the code above, PowerCLI is used to retrieve a VM. The identifier of $myvm can be easily retrieved using $myvm.id, where id is a string.

PROBLEM:

On the Lab Manager side, the SOAP api provides GetMachine(id), where the identifier is an integer and not related to the id string returned from  the VM PowerCli object. This means that I won't be able to use GetMachine to query Lab Manager data starting from the id of a PowerCLI Get-VM.

QUESTION:

How do I get the required VM identifier from PowerCLI to be used with GetMachine in Lab Manager SOAP API? Is it possible just using PowerCLI and Lab Manager web service or do I need to crunch the Lab Manager database??

Thanks

Emiliano

0 Kudos
2 Replies
cjstaples-emc
Contributor
Contributor

Was anyone able to help out here?  I have a similar situation, and am hoping to be able to correlate SOAP API IDs to a VM instance.

=cjs

0 Kudos
3mime
Contributor
Contributor

Not really. I've just forgot about LM SOAP API. Because I was needing it only for reporting, I've been able finally to get information I need directly from the database. Anyway, there is not other way than using a SQL query on LM.

When you query lab manager you can get the VM vshpere instance id (and not name) from the view BucketVirtualServer, field dir_id Smiley Happy

0 Kudos