pages

Showing posts with label vCD. Show all posts
Showing posts with label vCD. Show all posts

Thursday, September 20, 2012

vCloud Director - get chain length and consolidate a vCloud:VM

As you may know it isn´t possible to consolidate a VM as an organization administrator. In most environments the customer gets an Org (Cola for example) and can deploy vApps etc. but isn´t able to consolidate a vCloud:VM (i use the vCO syntax for explicit wording).

If you want to provide this function in a customer portal, with WaveMaker for example, you need to check the chain length and when the user decides the consolidate method has to be called.

I build a workflow:





















The workflow has three steps: determination of the chain length, user decision to consolidate or not and the consolidate call itself. The first part (getChain script) looks like this:



myVm.updateInternalState();

System.log("VM name: "+myVm.name);

var doc = new XML(myVm.toXml());
default xml namespace = doc.namespace();
var n8 = new Namespace("http://www.vmware.com/vcloud/extension/v1.5");

System.log("ChainLength: "+doc.VCloudExtension.*::VmVimInfo.*::VirtualDisksMaxChainLength);

var chainLength = doc.VCloudExtension.*::VmVimInfo.*::VirtualDisksMaxChainLength;

if(myVm.vmStatus.value != 8){
throw("VM is not powered off!");
} 



As you can see I update the state of "myVM" (vCloud:VM) and setting the variable "chainLength" (number). The chain length is used as external input for the user interaction, so it´s possible to decide based on the count.

After the submission the myVm.consolidate() method is called and the workflows waits for it.

With my host.login() workflow you can combine the Org based login with the consolidation of vCloud:VM´s :)

Tuesday, July 3, 2012

vCD is multi-tenant, vCO is single-tenant, what now?

This week I had a discussion with one of our VSSP customers about the integration of vCloud Director in vCenter Orchestrator. As you might know there ist a plug-in for the vCD available which allows you to configure the vCD connection and make it available in vCO.

Now there is one thing to know about: If you configure the plug-in you will use the SYSTEM organization to have all other organizations available. If you connect to the vCO with the SOAP interface (with WaveMaker for example) the users will have full access to the vCD and not only to their organization.

Because of the user and role management in vCloud Director you will be limited in some functions. As example: There is no way to "consolidate" a VM even if you can see the chain length in their properties. This is limited to the provider administrator role.

So what´s the solution?

You can insert all organizations as new vCD connections in the vCD plug-in and as a vCO admin you are able to consolidate... but this isn´t really slick. The other was is to "authenticate" users with their organization and limit their access to their vApps/VMs.

After some attempts i designed a workflow like this:

IN-Parameter:

  • org (string)
  • user (string)
  • pass (string)

IN-Attributes:
  • url (string)
which were easy to fill from a web portal. With these parameters you are able to use the VclHost.login() method like this:

VclHostManager.setRuntimeCredentials(user, pass); 
var host = VclHostManager.createHost(); 
host.url = url; 
host.organization = org; 
host.sessionMode = VclHostSessionMode.PER_USER_SESSION; 
host.enabled = true; 
host.login(); 

Now you are "logged" in with the user and the matching org. A way to verify this is to check for the organizations:

var Organizations = host.getOrganizations(); 
for (i in Organizations){
    System.log("Organization: "+Organizations[i].name);
}


As you can see you will only receive the organizations of the logged in user :)

In my test environment it looks like this:














Now you will be able to get the vApps and Vms of the organization and do some magic with them. I will post some further steps (chain length, WaveMaker portal) later... cause I´m a consultant... in a hotel... with some beer... and only a notebook :)

Wednesday, August 17, 2011

vCO - VMware LabManager migration to vCloud Director (part 1)

Awaiting my new hardware for testing the vLM to vCD migration I decided to give you an theoretical overview how the migration is realized. First thing I had to learn was that a vCD registered host could not act as an vLM host because of a higher agent version on the host (version 5). Unfortunately I forgot to make a screenshot (will repeat that with the new lab).

With this knowledge there is only one option: vLM with vCenter Server 4 and vCD with vCenter Server 5, both registered in the vCenter Orchestrator.





















When migrating to vSphere 5 this could be a one-time scenario. Maybe there are two environments -> the "old" vSphere 4 with vCenter Server 4.x, ESX/ESXi 4.x and VMware LabManager 4.x.x and the "new" one with vCenter 5, ESX 5 and vCD 1.x.

The migration scenario I want to build up is divided into the following steps:

  1. Archiving the vLM VMs into the Library
  2. Export of the archived VMs to a "transfer" NFS datastore
  3. Creation of the "old" configuration as vApp in the vCD
  4. Import of the exported vLM VMs as new vCD VMs
Really simple, or what?

I think I will need several SOAP workflows for the vLM to export the VMs in a consistent state to the "transfer" datastore. Next thing is to create the configuration in the vCD and register the VMs as new vApps or VMs in the vCD. 

Please be patient, in the next 2 weeks I will test it and create a manual for the migration including the vCO packages.

In the meantime... have a look upon the new AMQP Plug-In!