I have a requirement to backup and restore VMware Lab Manager 4 "Configurations" and the virtual machines within them.
The 'Capture' code below sources from VMware Lab Manager SOAP API Documentation, which I would like to use, when run, so that it prompts for:
Lab Manager Server name/IP Address
Workspace Name
Configuration Name
Credentials
Storage path for capture of Configuration and content within (Computers etc)
I then require the reverse of this so as to restore a configuration that was previously exported.
-------------------------------------------------------------------------------------------------
--------------CAPTURE CONFIGURATION ----------------------------------------------
int newConfigId = ConfigurationCapture(10,Config10Capture);
{
//**
//** LabManagerSoap is the name of the Web reference in Visual Studio
//**
[login to view URL] binding = new
[login to view URL]();
//** Create login
[login to view URL] = new
[login to view URL]();
[login to view URL] = "jaya";
[login to view URL] = "Lab Manager";
[login to view URL] = "MyOrg";
[login to view URL] = "MyWorkspace";
[login to view URL] = new CertificateAccepter();
//** Get Configuration object
[login to view URL] Config =
[login to view URL]("Config26");
//** Get configuration identifier and deployed status from object
int configurationId = [login to view URL];
bool deployed = [login to view URL];
//** Capture configuration if it’s deployed
if (deployed)
{
//** Save capture with date and time stamp
string captureName=[login to view URL] + [login to view URL]();
string LMStorageServer = "LM Server";
[login to view URL](configurationId, captureName);
}
catch (Exception e)
{
[login to view URL]("Error: " + [login to view URL]);
[login to view URL]();
}
--------------------------------------------------------------------------------------------
ConfigurationCapture method present a new configuration name stored on VMWare Lab. If you need to restore, simply check if the current configuration is deployed or not by evaluating the IsDeployed property, delete the configuration by using ConfigurationDelete method, and then do the restore by using ConfigurationClone method. That's it. Every required method is already documented on API docs.