- LICENSE AND COPYRIGHT
VMware::LabManager - Perl module to provide basic VMware Lab Manager operations.
This module provides an encapsulation of VMware Lab Manager SOAP API in convenient API format. Basic functionality like deploying & deleting a library config to & from the workspace are provided.
A little code snippet to get you started:
use VMware::LabManager; use Data::Dumper; #instantiate the LM object my $lm = VMware::LabManager->new('username','passwd','labManager hostname', 'org'); #or if you want the XML messages dumped (i.e. verbose), pass the debug option: my $lm = VMware::LabManager->new('username','passwd','labManager hostname', 'org', 'debug'); #deploy_config returns the config ID of the config that is deployed my $configID = $lm->deploy_config('my_library_config_name'); print $configID; #get all the machines in the deployed config my $machineArray = $lm->get_machines($configID); print Dumper($machineArray); #delete the config once you are done. $action = $lm->delete_config($configID); print $action
This module does not provide a one-to-one mapping of the Lab Manager SOAP API, but rather it provides an API wrapper, which combines certain SOAP calls as a meaningful single operation. Thus this module is heavily tailored for automation purposes. But, it should also cater to the broader audience as it still does provide overall functionality that might be required.
Using this module, you can checkout a config & deploy it in one single method call, similarly undeploy & delete in a single method call. This module also provides a method to get the list of all machines (and their details) that a deployed configuration has. Apart from that the SOAP object & auth header methods are exposed; So if need be, they can be used to access other SOAP calls available through Lab Manager SOAP service.
This function instantiates the LM object. The arguments in the required order are:
Username - Your username for Lab Manager login.
Password - Your password for Lab Manager login.
Hostname - FQDN of the Lab Manager you are trying to log in.
Organization - Organization to which you belong to in Lab Manager.
This does not authenticate with the Lab Manager server yet. That happens when you use one of the other methods.
This method is primary used internally, but there are situations where it could be used for other SOAP methods that have not been exposed by this module. This method returns SOAP::Lite object & sets the readable option on. You can use this in conjunction with Authentication header, which you can get from get_auth_header() method.
NOTE: Usage of this method outside the scope of this API is not recommended.
This method returns an authentication header wrapper that is needed for each SOAP call that you make to Lab Manager. It uses the options you provided in the new() method to build this header.
This method is tailored for automation. During automation, one primarily cares about deploying a library image. A single method call to encapsulate the whole set of operations is more deirable.
This method requires a config name (make sure it is unique in the system), which it uses to:
Checkout the config to your default workspace with a random name.
Deploy the confignation in fenced mode.
Return the unique numeric Config ID of the deployed config.
You have to use this config ID to undeploy & delete it at at later stage.
This method returns an array of all the Machines in the deployed config. For each machine it includes mac address, name, internal IP, external IP, name & its id.
This method performs two actions - 1)undeploy the configuation (if it is not undeployed) and 2) delete the configuation. This method takes the config ID of the configuration you deployed earlier using the deploy_config() method.
<"ivaturi at gmail.com">
Please report any bugs or feature requests to
firstname.lastname@example.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=VMware-LabManager. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
You can also look for information at:
RT: CPAN's request tracker
AnnoCPAN: Annotated CPAN documentation
Copyright 2010 "Aditya Ivaturi".
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.