VMware

This Question is Answered

2 "helpful" answers available (6 pts)
5 Replies Last post: Oct 12, 2009 5:55 AM by gpanki  

How to retrieve DataStore Path posted: Jun 2, 2009 8:11 AM

Click to view vemwhere's profile Novice 6 posts since
Jun 2, 2009

I'm writing a perl script using Labmanager SOAP API to deploy multiple configs in Labmanger. After deploying the Config/VM, I would like to interact with the VMs in each config. To do this I am using the VIX Perl API. My issue is that I need to know the datastore path of each VM as soon as it is deployed so that VIX commands can be ran on it.

The script is multi-threaded. Each thread represents one configuration with one vm.

I know how to list all the datastores for all registered VMs. The VM name is not unique so I cannot parse this list for that. Does anyone know a way to reliably get the datastore path for a VM knowing either the MachineId or ConfigID/MachineID combo? Ideall I would be able to do sometype of search for the ID that will yield the datastore path.

I'm open to VI Toolkit, VIX or anything else out there that will allow me to get this info (preferably using Perl).

Thanks.

Re: How to retrieve DataStore Path

1. Jun 2, 2009 8:39 AM in response to: vemwhere
Click to view cschmidt's profile Novice 20 posts since
Sep 11, 2006
so are you trying to get the path on the datastore to a particular VM's .vmx file? which you'd then hand over to a call in the VIX Api? Am i reading that correctly?

Re: How to retrieve DataStore Path

3. Jun 2, 2009 9:00 AM in response to: vemwhere
Click to view cschmidt's profile Novice 20 posts since
Sep 11, 2006

I think this might be what your looking for:

LabManagerInternal.GetConsoleAccessInfo Method
C#
WebMethod()

public MKSConsoleInfo GetConsoleAccessInfo(
int machineId
);
Parameters
machineId

It will return an object type called MKSConsoleInfo which contains a value VmxLocation. When I tried it through soapUI it gave me a valid path to the vmx file of the machine_id i passed it


Re: How to retrieve DataStore Path

5. Oct 12, 2009 5:55 AM in response to: vemwhere
Click to view gpanki's profile Lurker 1 posts since
Dec 21, 2008

Hi, I also want to retrive .vmx file name. can you please share your source code.

Thank You!!

Developer Social Media

Communities