pages

Monday, July 9, 2012

chain length consolidation in vCloud Director - multi-tenancy part 2

Based on the last article I think about a solution to enable vCloud Director organization administrators to consolidate their virtual machines (keep in mind this is only available in the SYSTEM organization) without being the SYSTEM administrator.

So if your customers are administrators in their org they aren´t able to consolidate their VMs and this could cause performance issues.

With the "host.login()" method in the vCloud Director plug-in of vCenter Orchestrator you will be able to authorize organization administrators and identify their organizational vApps and VMs. Because the vCenter Orchestrator is connected as a SYSTEM administrator to the vCloud Director you can call methods like "consolidate" directly.

The most valuable step is to identify the chain length of the VM which isn´t viewable as organization admin. So if you know have identified your VMs you can create an scriptable task 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!");





Please keep in mind that the vm.updateInternalState() method is useful cause the state is sometimes not the same as displayed in vCO. This is also useful for the host.login() method in my last article.


The first step identifies the chain length and the second one checks the state of the VM. In my workflow used a "user interaction" with the chain length as external input to ask if the VM should be consolidate. From a external portal you have to use the "answerWorkflow" method.


When the user decides to consolidate (with seeing the chain length in the decision field) the next scriptable task only has a consolidate call:



var task = myVm.consolidate();



The whole workflow looks like this:

















You can control the operation in you vCloud Director, there you will see a "consolidating VM" even if you aren´t a SYSTEM administrator :)

5 comments:

  1. Cleaners Balham You may ask yourself what is the use of professional end of tenancy cleaning, and here are the answers:
    First, an end of tenancy cleaning company provides well trained cleaners who know how to deal with any cleaning task properly.

    ReplyDelete
  2. Now, what will you do? Can you clean your house as well as make arrangements for the get-together? Obviously, you cannot handle these things on your own.


    End Of Lease Cleaning Gold Coast | Bond Cleaning Gold Coast

    ReplyDelete
  3. Noteworthy utilization of tenses and additionally creative method for composing made this blog appealing. I read this blog deliberately and discovered nothing unfortunate identified with any reality. First rate work. Exchange Server Enterprise

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete