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.