pages

Sunday, October 17, 2010

vCO - new plug-in released: VIX

VMware released a new vCenter Orchestrator plug-in this week: the vCO VIX plug-in. With this integration it is possible to start operations direct in the virtual machine, like file copy, starting a service or check for directories.



The plugin can be downloaded at VMware Labs: http://labs.vmware.com/flings/vix-vco
Within the .zip file are several components:

o11nplugin-vix.dar - The vCO VIX plug-in (binary)
vCO41-VIX-Plugin-Guide.pdf - The documentation guide
VMware-vix-x64-1.10.1-266898.zip - The Windows 64-bit VIX DLL
VSOSDK-vix-src.zip - The vCO VIX plug-in (project and source code)

The .dar file can be installed like every other plug-in in the configuration interface of the vCenter Orchestrator.

Thursday, October 7, 2010

vCO - Input Dependency - using Presentation in VMware Orchestrator

A vCO Starter asked how to prefill DropDow-Boxes (or other fields) as input in dependency of an other input. Here a simple guide to use an action in Presentation to do this.

Assuming there is a workflow with two input parameters, Input1 [string] for free input, Input2 [string] in dependency of Input1 wich should offer following values:

  • Input1 = A --> A1, A2, A3
  • Input1 = B --> B1, B2, B3
  • Input1 all other values --> C1, C2, C3

Define both strings as input parameter. Then go to the presentation tab.



The Mandatory Property forces an input for Parameter Input1. You can not proceed the Workflow without a value for Input1.

Before looking at Input2, create an action:


This action will return an array of string in dependency of the input parameter MySelection described at the beginning.

Now use this action to define the second parameter:



Add a "Predefined list of elements" property. 


Use action sign (the puzzle) to bind the action on this property. Click the "string" to select the propriate input parameter or our action. After this the presentation look like this.






Execute the workflow and test the behavior.

Thursday, September 30, 2010

vCO - mount NFS Datastore with VMware Orchestrator

Here a little action to mount a NFS export to a Host (assuming all export settings are checked for ESX).

Input parameter

  • Host [VcHostSystem] - Host to mount the NFS-Export
  • NfsServer [string] - IP or Name of Server exporting the NFS
  • NfsPath [string] - path to mount point from export, e.g. /mnt/export/NFS
  • DatastoreName [string] - Datastore name on Host 

Output parameter

  • Datastore [VcDatastore] - Datastore object of attached NFS-Store

Wednesday, September 29, 2010

vCO - setting DRS mode in VMware Orchestrator

To set DRS automation level is easy with vCO. But how to set the DRS mode (manual, partially automated and fully automated)?



The above example has Cluster [VcClusterComputeResource] and DRSmode [string] as input parameter. Output is Task as VcTask, so you can continue with action vim3WaitTaskEnd.

DRSmode has 3 possible values:

  • manual
  • partiallyAutomated
  • fullyAutomated

Sunday, September 26, 2010

vCO - functions in VMware Orchestrator

Sometimes you need a function to calculate a result and you don't want to use an action. Here we have an (sense free) example which shows us how a function is build up and used. Also the scope of used variables is demonstrated:



This example will log (in extra lines): 3, 4, 0, 7, 3, 4, 99

This show us the scope of defined variables. The variables a and b are defined in outer and inner (function) scope. The changed values (set to 99) will only affect the inner a and b. Otherwise c - there is no c defined inside the function or passed to it. So the outer c will be used.

After calling Add(a,b) the value of c is set to 99.

Regardless of the scope a function can return a value using the keyword return. There is no type definition. The function will return an object.

Warning - it is not recommended to manipulate outer variables from inside a function. It works, but making your code difficult to debug if any error or misbehavior occurs.

vCO - sorting arrays in VMware Orchestrator

The integrated sort function for array Array.sort() will sort the array ascending. This works good for scalar types like number. But how to sort descending (not using Array.reverse()) or sorting arrays containing complex types like virtual machines? Let's have a look.

The example above will log this:


The following example is sorting descending:


The example will log this:
The function "desc" returns a boolean to decide to sort or not. It works as comparator for the sorting algorithm inside sort(). I don't know this algorithm, but this is not necessary. Just use ist as sorting comparator. So if returned true the pairs will change place in array - like quicksort or so.

This offers us an option to sort non scalar types like virtual machine or other complex types.
Have a look at a workflow with VMs [Array/VirtualMachine] as input parameter - in this example my array contains 3 virtual machines:

The (partial) log shows this:


As you can see, the array is sorted ascending by the id of each VM. If you want the array sorted ascending by VM.name, try this (there are now 4 VMs in array):

And the log shows this:Be careful with your self created sort function. Use it only on homogen arrays. Because all elements must support the properties you use in your function. On heterogen arrays adapt your function to match all possible elements.

Tuesday, August 31, 2010

SQL 2008 Express Management

Somtimes the day begins as the last day ends... in this morning my fellow here at mightycare solutions tried to install the new vCenter Orchestrator for an enterprise customer. Because of the limited functionality (it is an proof-of-concept) he decides to use SQL 2008 Express with the SQL Express 2008 Management Studio. At frist we would install the SQL Server (like known from SQL deployments) and afterwards we decide to install the Management Studio.

After the installation of several features (.NET, .NET update, and so on) we install the SQL Server 2008 Express and start the installation of the Management Studio Express. But what is that? After choosing the "Add features to an existing instance..." we can not select the "Management Tools - Basic" option!



After a few moments of investigating we try to use the other, in my eyes senseless, option "Perform a new installation of SQL Server 2008" and what did my swollen eyes see? An option called "Management Tools - Basic"!

So i think this is another example of user experience at Microsoft...