pages

Showing posts with label API. Show all posts
Showing posts with label API. Show all posts

Monday, February 27, 2012

vCO - want fast success? use python!


As you may know I´m always interested in finding new methods to make vCO available in the most common programming languages. Last week some guys developed their web service client in python using the outstanding PyvCO module: http://labs.vmware.com/flings/pyvco

I see their fast and impressive results which took them just a few days and decided to take a look into python using "native" SOAP clients. After reading thru some available modules I decide to use suds: https://fedorahosted.org/suds/ because it seems to have a simple design.

After installing the module on my MacBook with pip install suds the first test is really simple:

import suds
client = suds.client.Client('http://172.16.0.176:8280/vmware-vmo-webcontrol/webservice?wsdl')
print client

This is the output:














As you can see all methods and types are shown with a simple print :)

Based on this and some indents you can produce some real nice functions like this:
import suds

vCOurl = 'http://172.16.0.176:8280/vmware-vmo-webcontrol/webservice?WSDL'
#username = raw_input('Username: ')
#password = raw_input('Password: ')
username = 'USERNAME'
password = 'PASSWORD'

client = suds.client.Client(vCOurl)
#print client

def getAllWfs():
 allWfs = client.service.getAllWorkflows(username, password)
 return allWfs

def findWfs(name):
 Wfs = client.service.getWorkflowsWithName(name, username, password)
 return Wfs

#allWfs = getAllWfs()
allWfs = findWfs(raw_input('Workflow name: '))

for wf in allWfs:
   print wf.name
   print wf.id
   wfInParas = wf.inParameters
   for iParas in wfInParas[0]:
        print 'inParameter: '
        print (iParas.name, iParas.type)
   wfOutParas = wf.outParameters
   for oParas in wfOutParas[0]:
        print 'outParameter: '
        print (oParas.name, oParas.type)

With this you can search for a workflow and get the IN/OUT parameters. As you can see the success comes really fast!









So feel free to post your implementations!

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