3.0

Table Of Contents
VMware, Inc. 23
Chapter 2 Getting Started with the Lab Manager SOAP API
static string CheckoutDeployConfiguration( string version)
{
//
//** Check out a configuration and deploy it to the Workspace
string srcconfig = "ProofOfBuild-R2"; //** Configuration name
System.DateTime time = System.DateTime.Now;
string configname = version+"-"+
time.ToString().Replace(" ", "_").Replace("/","-");
//
//** Bind to Lab Manager SOAP Web service
//
LabManagerSoap.VMwareLabManagerSOAPinterface binding = GetLMAPI();
//
//** Get configuration information -- Configuration object
//
LabManagerSoap.Configuration config =
binding.GetSingleConfigurationByName(srcconfig);
Console.WriteLine("Checkout configuratioin "+ srcconfig);
//
//** Check configuration out of Configuration Library and
//** name it(configname)
//
int newCheckoutID = binding.ConfigurationCheckout(config.id,
configname);
Console.WriteLine("Deploy configuratioin "+ srcconfig);
//
//** Deploy Configuration
//** false = Do not run images from ESX host
//** 1 = Fenced mode, traffic blocked in and out
//
binding.ConfigurationDeploy(newCheckoutID, false, 1);
Console.WriteLine("Deploy is completed");
return configname;
}
///<summary>
/// The CaptureUndeployConfiguration() method saves the configuration
/// to the Lab Manager Library and undeploys it from the workspace.
///</summary>