pages

Thursday, January 20, 2011

vCO - Access to Java Classes

By default JavaScript in vCO is limited to class subtree java.util.* . Please read vCenter Orchestrator Administration Guide 4.1 on page 69 before changing default settings.
Why changing default settings? In my case I want to unzip bundles in an offline repository only with vCO, not using 3rd party tools. The ZipFile object is direct accessible, but some methods are derived from classes in java.io.* and java.lang.Object. So I have to loosen the default restrictions, described on Page 69.

Step1:

create a text file e.g MyShutter.txt with following content:

java.io.*
java.util.*
java.lang.Object


Save this file at <VCO-install-folder>\Orchestrator\app-server\bin\MyShutter.txt. This folder already exists.

Step 2:

Stop VCO-Server
Edit vmo.properties (look in ...\app-server\server\vmo\conf) and add following line:

com.vmware.scripting.rhino-class-shutter-file=MyShutter.txt

I've tried to use here an absolute path e.g. C:/VCO/MyShutter.txt (nothing was mentioned in documentation). You will get an error (server.log) like this if doing so:

2011-01-20 16:52:31.540+0100 ERROR [MainScriptingObject] Cannot find rhino js shutter class file at location : C:\Program Files\VMware\Orchestrator\app-server\bin\VCOMyShutter.txt

Step 3:

Start VCO-Server
Run an example using an object from new accessible classes.
Check server.log
If your example fails, check
  • server.log for above error - maybe the shutter file was not found
  • object naming - so you not using import the object must be fully qualified - e.g. ZipFile object qualifies as java.util.zip.ZipFile
Feel free to leave comments or drop your questions.

Regards, Andreas

Thursday, January 13, 2011

vCO - SOAP connect via VB .NET

Last week i try to build a Win32 application, based on the vCenter Orchestrator WSDL interface. In my case i try to develop an administrator interface which allows external administrators (external locations and so on) to start defined workflows with defined input parameters, like a vSphere Client for automation tasks.

After the successful evaluation i wrote the following instruction:

At first I install the newest version of Visual Studio 2010 Express Editions on my notebook and create a new Windows-Forms project. After the creation of an empty project you have to add a webservice reference, cause the vCenter Orchestrator WSDL interface is web-based. This is done by a right mouse click on the root folder of your project (in my case SOAPvCO).












In the sub-menu you will find an option called "Add Service Reference". After clicking the "Advanced" option and the WebService Reference button you can add the local WSDL path of your vCenter Orchestrator and rename it how you want it (in my case vCOref).








After the service reference is created all necessary methods and attributes are available in Visual Studio object browser. Now you can create a simple form in like this:














The basic elements are a textbox (multiline), a connect button (name=ButtonConnect) and an exit button (name=ButtonExit) to close the application. By doing a double click the connect button you will get the code window of the form. As you can see, the sub (ButtonConnect_Click) is created automatically. In this code window you have to create the following code (sorry for the screenshot, but only self-writing teaches!).


















In this simple example the connection parameters are asked with simple input boxes and written into string variables. The most important part is the declaration of "SOAP" as vCOref(our reference).VSOWebControlService(default class for new service) above the sub routines. With this definition above you can now use the "SOAP" constructor for the full form.

When debugging the project, the result should look like:













As you can see, the connection was successful and the number of workflow are shown. With this basic you can start to build up some stuff especially for your needs.

Feel free to ask any questions if you want to know more about the possibilities.

Wednesday, December 22, 2010

vCO - bug discovered on initializing variables

After examing Deric's question in VMware community for vCO I was a little bit confused of my testing results - could that be? - is it a feature or a bug.
Now we have a first statement, it is definitly a bug. Read more at http://communities.vmware.com/thread/296963.

Regards, Andreas

vCO - cluster AAM compliance check

Normal productive clusters are spread over two or more fire compartments. But only maximum five hosts in a cluster are primary hosts for AAM. What happens if all primary hosts reside in one section and this section fails?!  Check your cluster AAM fire compartment compliance:
The following code is compressed in one task for better viewing. For production use split it up in action & workflow(s), depending on sections. It will check, if minmum 2 host in each cell (fire compartment) is a primary host. Adapt these values for your use.
Parameters:
  • (input) Cluster [VcClusterComputeResource]: the cluster to be checked
  • (input) Cell1, Cell2 [Array/VcHostSystem]: an array containing the hosts in each fire compartment (e.g. use vCO configurations)
  • (output) compliant [boolean]: the cluster compliance
  • (output) Cell1Primary, Cell2Primary [Array/VcHostSystem]: primary hosts found for cell
Depending on compliance state you can use the both arrays in a next step email workflow to inform about the cell compliance.

If you are running vSphere 4.1 you can use DRS groups to get already defined host lists:

<Cluster>.configurationEx.group contains the group listing (array).
Cluster.configurationEx.group[x].host constains the host list of group x (array). You can use this to feed the parameters Cell1 & Cell2 dynamically with values from vSphere.

Regards, Andreas

Tuesday, December 21, 2010

X-Mas - a little gift: MCS-ViewHA

How to see the primary Nodes in a VMware HA Cluster?

As you know, VMware vSphere has really nice features. One of then is the VMware HA or VMware High Availbility feature. With this, it is possible to build a high availbility Cluster for virtual maschines. Any virtual Machine in that cluster are protected for Hosts crashes.

The HA Feature monitors all ESX-Hosts in the Cluster and restart any virtual maschine on other ESX-Server if one or more ESX-Servers are crashing. So the virtual machines are back and running in a few minutes.

A VMware Cluster can be build with at least max. 32 ESX-Hosts. You must configure it by the vCenter Server, but pretty nice is, that the VMware HA Feature works without the vCenter Management Server. This means that the ESX-Host is montoring itself and all other ESX-Hosts over heartbeats.

All Server do it?... Not all!

In a VMware HA Cluster are max. five ESX-Server primary Hosts. All other ESX-Hosts will be secondary Hosts. Only the primary Hosts will be have Information about the whole Cluster. The secondary Host does not have that Information. But in a kind of failure, a secondary Hosts can be promoted to a primary Node by any primary Node.

In the normal Szenario, if one primary Host goes down, the other primary Node realize that over the heartbeat and promote a secondary Hosts to a primary Host.

But what happend, if all primary Hosts goes down at the same time? Now the Cluster has a problem, that no ESX-Hosts has Information about the whole Cluster and can´t promote any Hosts to a primary state. Did you think that this szenario are infrequent? We have seen this really often.

One Example is, when you build a Cluster over two locations. The only secured way for that szenario is, to build up a Cluster with max. of 8 ESX-Hosts, so you can sure, that at least one Host per location is a primary host.

But what can you do if you want to build a cluster with more than 8 Hosts? Are you sure that you have primary Nodes on all Locations? Where can you seen this? The vCenter Client dosn´t show you this Information.

In many Project we are asked which ESX-Server in a VMware Cluster are active (primary) and which one was passive (secondary). So we build a little Tool that display the primary Nodes in a VMware Cluster what we named MCS-ViewHA. With that, you can see which ESX-Node is a primary Node.




You can Download this free Tool from our Website.

http://www.mightycare.de/downloads/mcs_viewha

Monday, December 20, 2010

vCloud Director - installation part I

Based on the actual evolutions in the VMware product environment, I decide to installl the new vCloud Director in my home-lab. There are two things which i had to get before starting:

  • Oracle DB 11g for Windows
  • RHEL 5 64bit
After several register processes and hours of downloads I decide to start with the oracle server based on windows. In the future I think i will run it under RHEL also.

Starting with the Oracle DB server there are several things which need my attention, because after the installation the Enterprise Manager (http://localhost:1521/em) was available to me but the listener only reacts on the 127.0.0.1 address. In my opinion there was no way to change it while installing.

First thing i try was diabling the Windows firewall :-) , but without success. Next thing i try was a special command:

tnsping oracle.cjo.local

which reports an error while connecting. After that i try to get an status of the actual configuration with:

lsnrctl status

which shows several TNS-xxxx errors (for example: TNS-03505: Failed to resolve name). After reading some support statements i stopped all services in the server manager.







Then i go to the dbhome_1 directory and edit the tnsnames.ora and listener.ora (configuration files for the service) and change all localhosts to the right DNS name.

tnsnames.ora














listener.ora



After that i start all stopped services (OracleDBConsoleoracle, OracleMTSRecoveryService, OracleOraDb11g_home1TNSListener and OracleServiceORACLE) and check the status via:

lsnrctl status

which shows the right connection name.














Also i try another

tnsping oracle.cjo.local

which shows the following:


Next part now is to install the vCloud Director and try if the connection works. An update will follow...

Sunday, December 19, 2010

vCO - get ESX SSL thumbprint

To add a new ESX host to virtual center by vCO you need the SSL thumbprint of this host.
The following scriptable task shows a simple solution. To keep the example as simple as possible, most parameters are defined local. For production use declare these parameters (port, userName, ...) as input parameters.


For example, you can modify the VMware workflow 'add host to cluster' as shown below, to add a host with self signed or unknown CA to your cluster:



Feel free to leave comments.

Regards, Andreas