Hi all,
I'm starting a new project and starting it with v Sphere 6! The idea around the project is to surface application and back end storage relationships on the VM. I'm thinking about using tags but don't see any tag actions/workflows in the vRO 6. It looks like people are using PowerShell to manipulate tags. Could you guys point me to the best way to manipulate vSphere tags from vRO?
Thanks
Mike
Thanks Ilian. I assumed this would be part of the vCenter plug-in but it may not be the case. Seems odd to me that to put a vCenter tag on a vCenter VM you need two different plug-ins but certainly the underlying tag API is not part of the vCenter SDK.
Look in the APi explorer. It should be on the vCenter plug-in.
I did not use these yet but I was told it was in 6.0
Hi Mike,
The tagging service is exposed in the new vSphere vAPI. vAPI is a new set of API that cannot be consumed directly from current vRO VC plug-in.
I'm not sure if the tagging service is exposed also in the regular vSphere API. If it is not exposed there, then vSphere tags functionality will not be available as VC plug-in scripting objects/methods.
To use vAPI in vRO scripting, you'll need a new vRO vAPI plug-in. Such plug-in might not be released before the next major release of vRO, and most probably it won't be compatible with vRO 6.0 due to some required vRO platform-side changes.
As a workaround for vRO 6 - there is a REST layer on top of vSphere 6 vAPI, so it may be possible to use REST API calls to manipulate tags. I haven't played with it yet, though.
Thanks Ilian. I assumed this would be part of the vCenter plug-in but it may not be the case. Seems odd to me that to put a vCenter tag on a vCenter VM you need two different plug-ins but certainly the underlying tag API is not part of the vCenter SDK.
I'm begging the super smart guys in PSO to post some packages that can use the vAPI features like tagging that are not available to us via the vCenter SDK. I am teetering on the edge of writing a wrapper for the powerCLI cmdlets but have been holding out for the full vCO integration. It seems like the functionality for interacting with the tags has been around for a long time in PowerCLI. Has the vAPI been around for a long time and not publicized? If not how are they achieving that in PowerCLI?
Thanks for the pointer. The VMware vCloud Suite SDK for Python doc contains some code samples. Here is a link to the doc page :
https://developercenter.vmware.com/sdks
I'm either going to go after REST or Python. Rest being my fist choice so I can keep everything in VCO (aka VRO - I'll call it by it's new name in about 10 years).
Mike
I've seen a few examples for Power Shell and tags. The problem with Power Shell is that it requires a windows host and WinRM to be setup. That dramatically reduces the portability of the code between customers. If I go the Power Shell route, I think I'll use the NetApp Workflow (WFA) as it is based on Power Shell and uses the VMware PowerCli for some functions.
Unfortunately the tag API was not public until vSphere 6. The vAPI I think got a lot of updates for vSphere 6 including the tags.
In prior versions of vCO, like 5.1, is it possible to read tags at least?
I see that the VCVirtualMachine object has an attribute "tag" but when I try to retrieve it, I get nothing back.
My script is very simple. I have an input parameter, in_vm of type VC:VirtualMachine and the script is
var tags = in_vm.tag;
System.log(tags);
Server.log(tags);
When I run the workflow with a VM that I know has a category and a tag, It doesn't seem to return anything.
thanks!
Anoop
Hi,
I don't think the .tag attribute of a managed entity in the vCenter API is related to the Tagging functionality.
According to the vSphere API reference this attribute is there since 4.x (long before the Tagging feature was introduced), and it's still marked as experimental.
So I don't think that .tag attribute has any functionality right now.
Joerg
I really like the tagging functionality of the PowerCLI. I used the PowerCLI 6.0 installed on the same server as my NetApp Workflow Automation. (WFA) WFA is PowerShell based (along with Perl) and it was much easier to use the PowerCLI from WFA than it was from VRO. I'm calling my WFA workflow via rest instead of using the powershell plugin and winRM. The security and setup are much cleaner. A suggestion to VMWare is to add a REST interface on top of the PowerCLI - similar to Simple HTTP api for Executing PowerShell Scripts - Windows PowerShell Blog - Site Home - MSDN Blogs
Tags are awesome! Now I know what volumes my VMs use even if they bypass the hypervisor and mount them directly.
Mike
ATM the most straight forward way to use tags is to use the vCO REST plug-in to use the vAPI that include managing tags.
This is IMO a lot cleaner than calling out to PowerCLI.