VMware

This Question is Answered

1 "helpful" answer available (6 pts)
6 Replies Last post: Jul 16, 2009 3:34 PM by Michael Ottati  

SOAP Equivilant for: Clone to existing worspace? posted: Apr 20, 2009 11:33 AM

Click to view Michael Ottati's profile Hot Shot 93 posts since
Jan 6, 2006

I would like to automate the "merging" of two different library configurations into a single work space. The two base configurations making up the merge are libraries. Is there a mechanism to do this using the LabManagerInternal API set?

My first attempt was to use Checkout. That API fails due to the server side requirement that the target of checkout operation may not exist. This is shown below:

test:
LabMinder:Checkout Checking out library: LoadRunner4K_SSH to workspace: TaskS
pace500.15
BUILD FAILED
javax.xml.ws.soap.SOAPFaultException: "TaskSpace500.15" already exists in the workspace. ---> "TaskSpace500.15" already exists in the workspace. ---> "TaskSpace500.15" already exists in the workspace.

I next considered using the ConfigurationClone method. That method requries a workspace to be passed in on the configurationId argument as shown below:

test:
LabMinder:Clone Starting to clone configuration LoadRunner4K_SSH
BUILD FAILED
javax.xml.ws.soap.SOAPFaultException: This configuration is not a Workspace Configuration ---> This configuration is not a Workspace Configuration ---> This configuration is not a Workspace Configuration

My question is what API call should I be using to do this? I looked at ConfigurationCopy however that method requires that a VMCopyData structure be created. The requirement of the VMCopyData structure implies that this call initiates a deep copy operation, potentially onto a different data store.

Is there a way to do this?

Click to view ESRI Scott's profile Novice 4 posts since
Sep 12, 2008
is there an answer for the VMCopyData structure? i am unfamiliar with how to create this object?
Click to view stanbinev's profile Hot Shot 122 posts since
Feb 14, 2007

Merging two library configurations into one workspace configuration cannot be done via the SOAP API in Lab Manager 2.x and 3.x. The only workaround that I can think of is the check them out separately into the workspace, add each VM to Templates, and then create a new configuration out of all the templates you created. I am not sure that is a good thing to do.

In Lab Manager 4.0, however, there are two new API methods which will allow you to do what you want. These are:

ConfigurationCloneToWorkspace(...) - from a workspace configuration clone to either new or existing workspace configuration

LibraryCloneToWorkspace(...) - from a library configuration clone to either new or existing workspace configuration

As far as ConfigurationCopy is concerned, it allows you to copy a filtered set of VMs into a new configuration (not existing one).

Click to view stanbinev's profile Hot Shot 122 posts since
Feb 14, 2007

Here is a code snippet that copies all VMs in a configuration into a new configuration (example in C#.NET2):

VMwareLabManagerSOAPinterface soapBinding = soapFactory.getBinding();


string datastoreName = "MyDatastore";
List<VMCopyData> vmCopyData = new List<VMCopyData>();
Machine[] vms = soapBinding.ListMachines(configId);


foreach (Machine vm in vms) {
VMCopyData vmData = new VMCopyData();
vmData.machine = vm;
vmData.storageServerName = datastoreName;
vmCopyData.Add(vmData);
}


soapBinding.ConfigurationCopy(configId, "NewConfiguration", "Description", vmCopyData.ToArray());

Click to view stanbinev's profile Hot Shot 122 posts since
Feb 14, 2007

Can you provide more detail on the particular use case that necessitates the merging of two lib. configurations into one workspace configuration?

Just curious.


Developer Social Media

Communities