VMware

This Question is Answered

1 "correct" answer available (10 pts) 1 "helpful" answer available (6 pts)
5 Replies Last post: Jul 1, 2009 12:17 PM by Michael Ottati  

How to deploy a sinlge image from a mulitimage configuration? posted: Jun 25, 2009 10:09 AM

Click to view Swordphish99's profile Novice 6 posts since
Jun 19, 2009

In the Lab Manager GUI you are able to select the images you want to deploy from a library configuration, is there a way to do this with the SOAP API

Thanks in advance...

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

The ideal way to do it would be if there was some sort of a ConfigurationCheckoutEx method that would allow you to selectively checkout machines from the source configuration.

Then next best thing would be checkout a new configuration from the source and "prune away" the machines you did not want. In order for such pruning to occur a ConfigurationDeleteMachine method would be required. There is a ConfigurationAddMachine(Ex) call however both the original and Ex varient only provision for templates to be added, not machines from other configurations.

It appears that you could clone the entire configuration and use the ConfigurationDeployEx method supplying only these parameters.

public void ConfigurationDeployEx(
int configurationId, ##
bool honorBootOrder, true
bool startAfterDeploy, false

You would then have to iterate through the machines in the configuration and power them on individually. This seems like a lot of work and you would still not quite have the outcome you desire. The powered off VMs that you did not want would still occupy disk storage.

I had also considered using ConfigurationCopy in the way illustrated in the code fragment shown below:

Configuration c = proxy.getSingleConfigurationByName(sourceConfig);
log("Copying library: " + sourceConfig + " to workspace: " + destinationConfig );
ArrayOfMachine machines = proxy.listMachines(c.getId());
ArrayOfVMCopyData vmCopyData = new ArrayOfVMCopyData();
for (Machine m : machines.getMachines()) {
VMCopyData vmcd = new VMCopyData();
vmcd.setMachine(m);
vmcd.setStorageServerName(m.getDatastoreNameResidesOn());
vmCopyData.getVMCopyDatas().add(vmcd);
}
int checkedOutID = proxy.configurationCopy(c.getId(), destinationConfig, "my description", vmCopyData);
log( destinationConfig + " has been successfully checked out.");

The ConfigurationCopy method performs a full VM copy, not a linked clone and would end up consuming considerably more resources (including time) than you are likely to have budgeting to this task.

Click to view AHutton's profile Enthusiast 50 posts since
Dec 4, 2008
What would also be nice to add to this is the functionality of being able to checkout from one library configuration one or more of the machines into an existing workspace configuration as you can do through the web interface. It would be great to create through the API a workspace configuration based on multiple library configurations. We have many combinations of machines that need to go into a config, and it would be nice to keep the pieces seperate for maintainability and merge them as we need into the different multiple machine combinations.
Click to view Michael Ottati's profile Hot Shot 93 posts since
Jan 6, 2006

I agree with you completely.

This is essentially the question I was asking in: SOAP Equivalent for: Clone to existing workspace?

Lets hope that something gets added in the next release along with vSphere integration.

Developer Social Media

Communities