Hi Folks,
As part of developing an approval workflow for instantiating an vApp, I need to pull the memory and cpu details for an vApp Template in vcloud director, which is in an catalog.
I'm not finding any option under "VclQueryResultAdminVAppTemplateRecord" in API Search.
Kindly advise.
Unfortunately, that info is not available while the Instantiate vAppTemplate task is being blocked. My team has reported this to engineering and asked that such additional information be made available via the api. Here's an example of the level of information we can currently extract during that blocking task:
User
vApp
VM
VM
Unfortunately, that info is not available while the Instantiate vAppTemplate task is being blocked. My team has reported this to engineering and asked that such additional information be made available via the api. Here's an example of the level of information we can currently extract during that blocking task:
User
vApp
VM
VM
There is a workaround but quite ugly: download the vAppTemplate OVF and extract data from there.
Christophe.
Thanks Burke and Christophe,
Is it possible to pull this info by running a REST operation via the HTTP-REST plugin or by running an SQL query via the SQL plugin.
I hav'nt gone through their documentation fully yet.
Using HTTP REST you will have similar limitations (i.e no Hardware details in the vAppTemplate). You would have to get the Template OVF, which requires enabling download (meaning vCenter export to vCD transfer share).
The difference may be that with HTTP REST you can download the OVF content directly to a string whereas using vCD API you need to download the ovf to a vCO local disk, and load it from a file to a string. The downside of HTTP REST is that you will need extra authentication.
The SQL route I would not advise since you have no guarantee the schema will be the same in different versions of vCD.
Christophe.
Hi Christophe,
Thanks to this community post - http://communities.vmware.com/message/2030905#2030905
I'm able to find the ID of the VM in VC. example - vm-1095.
I'm not too well versed with VCO and hence need furthur guidance in how to use this VM object to obtain it's Memory and Cpu info.
Also is this is the right approach to obtain the configuration details of an vApp Template for now.
If this is a private cloud, using vCenter works. If a public cloud then I am affraid getting it from vAppTemplate.downloadOvf is the only solution for the moment.
To get it from a VC:virtualMachine try this:
cpuCount = vm.summary.config.numCpu;
memoryMB = vm.summary.config.memorySizeMB;
Thanks Christophe,
All that I have now is the VM id as an string. Ex - vm1055.
Kindly let me know as to how I can get the VC:virtualMachine object of this VM id.
Like this:
vcVm = Server.findForType("VC:VirtualMachine", vmMoref);
vmMoref being your vm ID.
Christophe.
It did not work Christohphe. Nevertheless I was able to pull the same using
vcVm = VcPlugin.getAllVirtualMachines(null, "xpath:id='"+vmMoref+"'");
But you did give me directions. Thanks for all the help.
I forgot that the VC objects ID are prefixed with the vcenter URL. The ID is:
vimServerHostName + "/" + vmMoref and not vmMoref since vCO can talk to several vCenter and need to differentiate the objects.
But you found a good solution as well.
Christophe.