VMware Cloud Community
Naineyess
Enthusiast
Enthusiast

Can we use vCloud's action in vCenter ????

Is there any way to use vCloud's action or workflow in vCenter ????

8 Replies
iiliev
VMware Employee
VMware Employee

I'm not sure I fully understand your question. Could you provide more details?

Strictly speaking, actions/workflows do not belong to vCloud or vCenter. You can call them from any other action/workflow.

0 Kudos
Naineyess
Enthusiast
Enthusiast


Okay let me explain you . . I am working on building a workflow where i want to increase the no of Cpu, Memory and Storage and for that requirement ,I had noticed that some of the Action are Present in vCloud Director Package in vCO,  I want to use them for vms to increase above mentioned compute resources for VMs in vCenter but not vCloud Director.

I am finding difficulties to use them as they are giving follwoing error

TypeError: Cannot find function attachDisk in object DynamicWrapper (Instance) : [VcVirtualMachine]-[class com.vmware.vmo.plugin.vi4.model.VimVirtualMachine] -- VALUE : VirtualMachine<vm-2901>'Testing'. (Dynamic Script Module name : attachDiskVM_SN#4)

I hope you could getmy pain point and be able to help me out Smiley Happy

Thanks !!

0 Kudos
iiliev
VMware Employee
VMware Employee

Thanks for the explanation.

The problem is that we have two types of virtual machine scripting objects:

  • VC virtual machine (defined in class com.vmware.vmo.plugin.vi4.model.VimVirtualMachine in VC plug-in)
  • vCloud virtual machine (defined in class com.vmware.vmo.plugin.vcloud.model.VM in vCloud plug-in)

Method attachDisk() is present only for vCloud virtual machine scripting objects, but it seems you are calling it on object of type VC virtual machine, and as it does not have such method, an error is thrown.

So if you need to call method attachDisk() you should somehow obtain a valid scripting object of type vCloud virtual machine, or convert VC virtual machine object to vCloud virtual machine object.


Hope this helps,

-Ilian

Naineyess
Enthusiast
Enthusiast

okay thanks... but how to convert VC vm object to vCloud vm object ???

Or don't we have any other option to achieve the same ???

0 Kudos
iiliev
VMware Employee
VMware Employee

There is no simple conversion from VC vm to vCloud vm, I'm afraid Smiley Sad

It should be possible to get vm's ID (and maybe other info if needed) from VC vm object and then search for vm with such ID in vCloud using vCloud API. But I'm not familiar enough with vCloud plug-in and don't know what search API/functionality it provides. I'll ask around how such mapping can be done.

cdecanini_
VMware Employee
VMware Employee

Do you have vCloud Director setup ?

If so configure the vCloud Director plug-in for it and use the workflow directly.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Naineyess
Enthusiast
Enthusiast

Thanks ... Smiley Happy  But the main problem is I don't want to convert my vCenter VM into vCloud .. Because that will be more time consuming and not good for my flow ..

Basically what I want is to use some of the workflow of vCloud (like "Attach a hard disk") for vCenter VM and for that purpose I was asking the above mention questions ... Smiley Sad  Is there any other way to achieve the same ??? Or if any other method to create the same workflow for vCenter vm ???

Please help me with that ...

0 Kudos
iiliev
VMware Employee
VMware Employee

To create the same workflow for vCenter vm, when there is no 1:1 mapping at the API level, you have to:

  1. Be familiar with both systems - vCloud and vCenter.
  2. Get familiar with both plug-ins' API and how much of system functionality is exposed via scripting API. Maybe there is disk attaching functionality in vCenter but it is not exposed in the API? Or maybe the same functionality can be achieved by calling one or more other scripting methods?
  3. In the worst case, you may need to look at implementation details, eg. at Java code to see what exactly attachDisk() scripting method does. Maybe this Java code calls some low-level API available only in vCloud?

In short, I doubt there is a quick way or drop-in replacement for existing vCloud workflow/action to make it work with vCenter vm objects.

0 Kudos