Latest Headlines
0

updated: Calling vCO-Workflows from Powershell

It was long on the TODO-list, now I got an reason (http://communities.vmware.com/thread/316038?tstart=0):
Extending the Powershell-script that calls vCO-workflows with input and output-parameters.

When executing the workflow, you have to specify an array of WorkflowtokenAttribute-Objects, which can be created in the namespace of the Webservice-Proxy:


# Connect to vCO and generate Proxy $vcoWS (-Class and -Namespace for easy stub-object generation later
 $vcoWS = New-WebServiceProxy -Class VCO -Namespace VCO -Uri http://192.168.215.176:8280/vmware-vmo-webcontrol/webservice?WSDL
 ...

# generate Array with Input PArameters (WorkflowTokenAttribute - Objects)
 $inparams = @()

# fill the array, one entry for each input parameter
 $inparams += New-Object -TypeName VCO.WorkflowTokenAttribute
 $inparams[0].name = "inputString"
 $inparams[0].type = "String"
 $inparams[0].value = "Hello World"

# ... and exectue (use $null instead on $inparams if Workflow has no input parameters
 $workflowToken = $vcoWS.executeWorkflow($workflow.id, "vcoadmin1" , "VMware2010", $inparams)

...

A comparable array of WorkflowTokenAttribute-Objects which contains the Output-Parameters of the workflow can be returned by


# get Output-Parameter, when workflow has finished #($wftResults is again an array of WorkflowTokenAttribute
$wftResults = $vcoWS.getWorkflowTokenResult($workflowToken.id, "vcoadmin1", "VMware2010")
$wftResults

the missing link: How to create Stub-Objects from scratch…
the hint: http://stackoverflow.com/questions/4196523/render-ssrs-report-with-parameters-using-soap-in-powershell

See the full updated example here:
http://www.vcoportal.de/examples/powershell-vco/

0

Web-Frontends for vCO

UPDATE Oct. 8th, 2011:

VMware Labs published the Perspectives-Plugin!
This is an very smart way to provide certain users a Web-Interface for certain workflows in a very easy way (and without any need for development, you just have to run the setup workflows)…
Download the Perspectives-Plugin here: http://labs.vmware.com/flings/perspectives-plug-in-for-vcenter-orchestrator
More information and configuration examples on www.vcoteam.info

*** Original Post ***

Right now, the Orchestrator provides two ways to create a web-based frontend. You can use the built-in components named Webviews, or you can do your own stuff using the SOAP-Webservice-API of vCO.

Webviews are based on Tapestry (a web-framework to “connect” HTML-Elements and Java-Classes) and Dojo (mainly for the input presentation of workflows).

There is one ready-to-run Webview bundled with vCO: the weboperator. It provides easy-to-use access to all workflows, you can run, monitor and schedule workflows via browser. The weboperator is installed automatically, but you have to publish it once:

publish webview

After that you can access the weboperator via your Browser: http://your.vco.server:8280/vmo/weboperator

Screenshot weboperator

If you want to develop your own webviews, start with the template in the examples.zip you can download from the vCO-homepage https://www.vmware.com/support/orchestrator/doc/vco-samples-4.1.0-776.zip and the corresponding documentation in the Developer Guide (page 279) http://www.vmware.com/pdf/vco_410_developers_guide.pdf#page=279
Good luck 😛 !

For using the SOAP-based Webservice-API you can find the process also in the Developer Guide:
http://www.vmware.com/pdf/vco_410_developers_guide.pdf#page=245

There are a bunch of examples for different programming languages:
Java and C#: See the examples.zip (link above)
Powershell: Calling Workflows from Powershell
PHP: http://mighty-virtualization.blogspot.com/2011/05/php2vco-how-to-establish-webservice.html
VB.net: http://mighty-virtualization.blogspot.com/2011/01/vco-soap-connect-via-vb-net.html
Python: http://labs.vmware.com/flings/pyvco

See also following discussions in the forums:
http://communities.vmware.com/thread/310753
http://communities.vmware.com/message/1712210

There are two real challenges when using the webservice-API: If your workflow hast input parameters, especially ones from the Inventory (like a VM), you have to other calls to find them, and there is currently no support for the input presentation defined in the workflow (in rare cases, where some “business-logic” is done via input presentation it might be possible that you cannot use these workflows via the API!).

To conclude: Having a web-based User Interface for vCO is a very useful thing, because you can let end-users execute workflows directly. There are a couple of mechanisms available to create such web-GUIs, and some promising components are on the way (VMware aquired Wavemaker, Rumors about FLEX-based vSphere Client, … 😉 )

0

Upcoming Books about vCO (and more)

VMware is going to publish a book about Day-to-Day administration with the Orchestrator. Author is Cody Bunch, who also has some great information and tutorials on his hompage, e.g. this one: http://professionalvmware.com/2011/05/spring-cleaning-orphaned-vm-files-with-vco/

For updates (and other planned books from very promising Authors), see the announcement below and watch http://www.vmware.com/go/vmwarepress

The official press announcement about VMware Press:
VMware Press is the official publisher of VMware books and training materials that provide guidance for the critical topics facing today’s technology professionals and students. With books, certification and study guides, video training, and learning tools produced by world-class architects and IT experts, VMware Press helps IT professionals master a diverse range of topics on virtualization and cloud computing, and is the official source of reference materials for completing the VMware Certified Professional (VCP) Examination.

Automating Day-to-Day Administration of VMware vSphere 5.x Automating Day-to-Day Administration of VMware vSphere 5.x
by Cody Bunch • Technology Hands-On • Fall 2011

This hands-on technical guide to automating vSphere with Orchestrator teaches administrators how to save time and resources by automating their virtual infrastructure. Automation expert Cody Bunch teaches valuable practices and tool use through a combination of real world automation examples and case studies.

Storage Design and Implementation in VMware vSphere 5.x Storage Design and Implementation in VMware vSphere 5.x
by Mostafa Khalil • Technology Deep Dive • Fall 2011

In this technology deep dive book, expert architect Mostafa Khalil teaches everything an administrator or architect needs to know about design, management and storage maintenance in the vSphere 5.0 virtual environment, including detailed procedures and guidelines, architectural design elements, best practices, common configuration details, and more.

Administering VMWare SRM 5.x Administering VMware SRM 5.x
by Mike Laverick • Technology Hands-On • Fall 2011

In this practical and technical guide to installing and configuring VMware’s Site Recovery Manager 5.0, expert Mike Laverick takes readers through set-ups for multiple vendors, disaster recovery, common pitfalls and errors, while along the way explaining why things happen, and how to fix them.

( I felt free to change the list of planned books to the proper order 😀 )

0

VMworld 2011 – Help to reveal VMware’s best kept secret !

VMworld 2011 Session voting is open!
And yes, there are some Orchestrator related sessions in the race…
So rise your thumbs to hear something about vCO:

http://www.vmworld.com/cfp.jspa

0

Customize a Virtual Machine

For John’s question in the VMware Communities about customizing a VM here:
http://communities.vmware.com/thread/311899
I took the challenge and created a small example how to customize a Virtual Machine using the CustomizeVM_Task().

The network settings, licensing, domain stuff and so on should come from a sysprep.inf text file.

Creating the proper CustomizationSpecification is really a hard job, especially since a couple of settings are mandatory even if the used information is already given via the SysprepText.

I got help using the API Reference, and the UML charts in Steve Jin’s indispensable book (http://www.amazon.com/VMware-VI-vSphere-SDK-Infrastructure/dp/0137153635 , I cannot mention it often enough… and no, that’s not an affiliate-link…yet… 😀 ), page 242.

When testing it, I got a lot of not helpful errors like “Cannot complete customization”. If you increase the loglevel in vCenter, in the vCenter logs there are a bit more information. Just don’t forget to reset it afterwards to avoid “logflooding”.

At the end I ended up with this code:


var sysprepMime = sysprepFile.getContentAsMimeAttachment();
 var sysprepText = sysprepMime.content
 System.debug("sysprep: " + sysprepText);

//create the custSpec objects
 var custSpec = new VcCustomizationSpec();
 System.debug("custSpec: " + custSpec);
 var myVcCustomizationSysprepText = new VcCustomizationSysprepText() ;
 System.debug("myVcCustomizationSysprepText: " + myVcCustomizationSysprepText);
 myVcCustomizationSysprepText.value = sysprepText //from Resource element above
 custSpec.identity = myVcCustomizationSysprepText;
 System.debug("custSpec.identity: " + custSpec.identity);

//fill the mandatory GlobalIPSettings
 var myVcCustomizationGlobalIPSettings = new VcCustomizationGlobalIPSettings() ;
 custSpec.globalIPSettings = myVcCustomizationGlobalIPSettings;
 System.debug("custSpec.globalIPSettings: " + custSpec.globalIPSettings);

//fill in the NIC-settings-map for one nic with unknownIPGenerator (IP-spec is in sysprep-text):
 var mappingMap = new Array();
 var myVcCustomizationAdapterMapping = new VcCustomizationAdapterMapping() ;
 var myVcCustomizationIPSettings = new VcCustomizationIPSettings() ;
 var myIpGenerator;
 //myIpGenerator = new VcCustomizationUnknownIpGenerator() ;
 //myIpGenerator = new VcCustomizationFixedIp();
 //myIpGenerator.ipAddress = "1.2.3.4";
 myIpGenerator = new VcCustomizationDhcpIpGenerator() ;

myVcCustomizationIPSettings.ip = myIpGenerator;
 myVcCustomizationAdapterMapping.adapter = myVcCustomizationIPSettings;
 System.debug("myVcCustomizationIPSettings.ip:" + myVcCustomizationIPSettings.ip);
 System.debug("myVcCustomizationAdapterMapping.adapter: " + myVcCustomizationAdapterMapping.adapter);
 mappingMap.push(myVcCustomizationAdapterMapping);
 System.debug("mappingMap: " + mappingMap);

//adding map to custSpec
 custSpec.nicSettingMap = mappingMap;

vmToCustomize.customizeVM_Task(custSpec);

Download the full workflow example here: http://www.vcoportal.de/download/workflow/customizeVM.workflow

Customize VM Workflow
Customize VM Workflow
customizeVM.workflow
2.1 KiB
Details...