Thursday, March 31, 2011

vCO - use and examples of RegExp (regular expression) Update

I just learned a little bit more about RexExP in vCO. The problem and solution track could found at http://communities.vmware.com/thread/308300 (there is no bug in RexExp, only a poor description of the method in vCO). A basic usage was already published in this previous post.

The string.match() is used to find substrings matching a pattern, the RegExp. But when you call this expecting a multiple return, you'll only get the first match.

test = "Cats don't eat catfish. Not my cat";
System.log (test.match("cat"));

will return only one element in array: "cat" - the first match found in catfish.

By expanding the RegExp with modifiers you will receive all results (maybe you know them from JavaScript).


test = "Cats don't eat catfish. Not my cat";
System.log (test.match(new RegEx("cat", "g")));

returns "cat,"cat" for both cat in string.
Using "i" will return "Cat".
And the combination gi "Cat", "cat", "cat"
  • i for case independend search
  • g for global search
  • gi as combination of both

This is the expected behavior mentioned in all tutorials.

Regards, Andreas

Wednesday, March 30, 2011

vCO - from infrastructure to the cloud (Cisco USC Plug-in)

As mentioned in many other blog articles in the past, the development of the vCenter Orchestrator Plug-ins goes straight ahead. A few weeks after the vCloud Plug-in the Cisco UCS Plug-in was released yesterday! This Plug-in shows how many ways there are to design automation and orchestration solutions. In my opinion there are two main strategies to implement a vCO in customer environments:
  • as leading system for automation design and implementation
  • as subordinate system with high integration possibilities
With this in mind there are two other important things to know: the infrastructure and the cloud automation. In every VMware cloud there is also the need to establish an basic vSphere infrastructure (infrastructire as a service) which abstracts the physical resources. So if you have a physical infrastructure you can know design the complete automation from hardware delivery up to cloud integration (application as a service).

Don´t get me wrong, you can integrate your ESX/ESXi host-systems in an automated way also without the Cisco USC Plug-in but if you have Cisco hardware the deployment is much more comfortable because of using the UCS API. Here are some examples from the release notes:

  • Application of a service profile to a UCS blade
  • Cloning a service profile template to a service profile
  • Service profile customization of frequently modified components
  • Import and export of service profiles from and to UCS Manager instances

As you can see the service definition is also available for the cloud infrastructure and allows you to definine service levels and tiers in an automated way.

Based on the HTTP POST method the integration of Cisco UCS Manager looks like:








With this method the Cisco UCS Manager XML API maps the objects with their attributes and functions in the vCenter Orchestrator.

In the Plug-in packages are also several example workflows and actions to automate an existing environment in a fast and comfortable way.















I hope that we now can address a wider audience to automate and orchestrate their cloud infrastructure.

Download Cisco UCS Plug-in: VMware vCenter Orchestrator Plug-in for Cisco UCS 1.0
Release Notes: VMware vCenter Orchestrator Plug-In for Cisco UCS Manager 1.0 Release Notes

Monday, March 28, 2011

vCO - set Jumbo Frames (MTU) for VMkernel

Last week I spoke to some fellows here at VMware and think about a solution to automate the MTU size for a dvPort/PortGroup with vCO automation. In the past there was no automated way than the excellent solution by Scott Lowe. Based on these findings i try to build this in vCO, knowing that the vSphere Client does not support this directly.

At first i had to identify the Port which serves the vmkernel and a few input parameters:









At first I need the host (in my case as string because this is used for an external excitation via SOAP), the name of the dvSwitch, the new IP address of the vmkernel interface and the new subnet mask. So i set the host (VcPlugin.getAllHostSystems) and use the getAllDvSwitches workflow from one of my last publications.
















After that I set the dvSwitch based on the input parameter (dvSwitch) and searching for the right port. The main procedure to identify the right port is: if(Ports[h].connectee.type == "hostVmkVnic") cause this compares to the vmkernel NIC.















At this point I know everything to change the MTU of the vmkernel Port, but... the API shows an cruel description:












So as mentioned when reading the article there is no direct API based way to set the MTU of a dvPort. In my case I solve the problem with using direct ssh commands. The drawback with this is the username/password dependence.














So after identifying the right host, the vmkernel port, the new ip address and subnet mask the ssh commands can run. As you can see I used exact the same commands as the console guys use.

So, hope this helps.

Tuesday, March 8, 2011

vCO - internal methods and authorizations

Today I had a strange problem at one of our larger customers. In fact it could be reduced to one sentence: "When starting a workflow from the GUI everything works, starting this workflow with the same user from a webservice client, all internal methods fail."

In this case internal methods mean things like:

var VMs = VcPlugin.getAllVirtualMachines();

or other actions with embedded methods. As a good Consultant I try to reduce the possibilities which can cause an error like this. At first I test the script of the customer (Perl) in my environment, with success because everything was fine. Then I review the user and his rights in the customers vCO and try my own Win32 test application (will be published soon). Every time I started Clients directly on the vCO all things going straight forward. Every time I test it from the customers PC nothing works or better the array "VMs" was empty.









The bad thing is that I can´t get any error inside the workflows. The vCenter Orchestrator always runs over the workflows and doesn´t display any error message. After several attempts I try to read out the log files in the vCenter Orchestrator. Inside the vCenter Orchestrator configuration there is a log viewer which i use for searching. After a few lines there are several ERROR entries, which look like this:

 2011-03-08 07:35:39.760+0100 ERROR [VimSession] getRootFolder() --> java.lang.Exception: getServiceContent() [vcouser@https://vCenterServerIP/sdk/Main#498028b0] --> Invalid login

I didn´t know that there was a difference between the networks (AD policy) because the user was created in the campus network. Testing it with my Win32 client directly on the vCenter Orchestrator with the same user was successful.

After we changed the rights for the user (AD group) everything works fine and all arrays were filled.

So if you see that internal actions or methods doesn´t work from your webclient, there could be an authorization problem :-)

Sunday, March 6, 2011

NEWS - time to change

Now it is official! Andreas and I joined the VMware PSO team this week. We decide to use mighty-virtualization further as it is known in the past: as virtualization and and automation blog. Between that we'll write at www.vcoteam.info, one of the best blogs for the vCenter Orchestrator automation tool.

Especially the newest vCO plugin for vCloud Director shows up that vCenter Orchestrator allows you to use infrastructure and cloud automation in future. In my opinion vCO is the best automation and orchestration tool for virtual environments on the market and we signed our flags to show you why ;-)

So please stay tuned, there are great things to come!