So I am reading this post http://blogs.vmware.com/PowerCLI/2013/12/using-tags-with-powercli.html
because there are a few things I want to start using tags for.
We're running vCenter 6.0 and ESXi 6.0.
When I run get-tag I get an error
Get-Tag : 4/19/2016 9:01:23 AM Get-Tag Index was outside the bounds of the array. At line:1 char:1 + Get-Tag -Name "Operations" + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-Tag], VimException + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomatio n.ViCore.Cmdlets.Commands.Tagging.GetTag
When I run
get-vm -tag Operations
get-vm : 4/19/2016 8:28:58 AM Get-VM Value cannot be null. Parameter name: collection
At line:1 char:1 + get-vm -Tag Operations + ~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-VM], VimException + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVM
For OS I am running Windows 10, Powershell 5 and PowerCLI 6.3.8258
There is a tag called Operations and a category called Operations VMs in vCenter.
This issue occurs if I am running Powershell with the PowerCli modules added to it or if I launch PowerCLI itself.
I have tried googling the errors with both powershell and powercli in the query but end up getting back long functions or scripts that are building large arrays or resource issues which my machine isn't having an issue with.
If I run the same command on the Windows vCenter server I get the exact same error.
There is a VM that exists on the target vCenter with the "Operations" tag.
Any suggestions on how to troubleshoot or approach this?
It looks like the issues with get-tag and SRM were resolved in PowerCLI 6.5 R1. So far, my brief testing has had positive results. I'd be curious to hear if it resolves everyone else's issues as well.
No, the Windows 10 device is my workstation, vCenter is running on Server 2008R2.
I'll see if I can dig up an older version 6 PowerCLI, when I look for it on the VMware download site they all say no longer available.
I installed PowerCLI 188.8.131.5254 on this machine and also installed on my coworkers machine that never had PowerCLI on it.
Using two different accounts that both have full admin access we both generated the same errors on both machines.
I went and opened an SR for this also in case any VMware support happens to come along this thread.
Thanks for your help LucD
Edit: Spoke with a gentleman from VMware support.
Turns out this is supported by a separate department that focuses on the SDK and API side.
This isn't covered under the regular support contracts and is a separate contract/cost.
Im the PM for PowerCLI, cases such as this where you are running a single cmdlet (not a script) that has been run on a previous version and worked are absolutely supported, the SDK support is not for this.
Please can you ask the support engineer to log this and to let me (Alan Renouf) know if he has any issues.
I apologize for your inconvenience here.
Hi Alan -
I'm an Escalation Engineer and am assisting on your case. I've been able to use the get-tag function in my lab, but this is on a 2008 R2 Server. I'm running Windows 10 on my workstation, but that's not working because it doesn't like the NAT that's going on between the two. I don't have a Windows 10 workstation inside the lab environment at this time, but I could put one up there.
Based on the wording of your post, is it only not working on Windows 10?
In our environment it isn't working on mine or my co-workers Windows's 10 machines, I also tried running it directly on our vCenter server which is running Server 2008 R2 and I get all the same errors.
I don't know if it is an issue due to the client or an issue with our vCenter server communicating back to it....
My contact info is on the SR, if you can reach out I can demonstrate the behaviour in our environment.
Hey Darren, just wanted to let you know that you're not alone in this one. I am experiencing the exact same behavior on two of my vCenter servers. I also have an SR open with VMware so I'll let you know if I hear any resolutions.
In my environment, I have 3 vCenter servers participating in a federated SSO domain, so tags/roles/license info is all replicated between them. We also use SRM which does a lot of automatic tag creation/assignment, so I'm suspecting that the combination of factors may be contributing to my issues. Do you have any of these factors in place in your environment?
We're running a similar environment, two vCenters in two separate data centers but linked and using the same SSO domain, we're also running SRM.
Right now our SRM isn't using the tags outside the defaults (Partially how this post came about as I want to start leveraging them with custom tags).
Interesting, that seems like a pretty strong coincidence.
I came across an article about SRM and tags, and it lead me to some advanced settings in SRM. The most interesting of which is enableSdrsStandardTagCategoryCreation. The description for that setting is "“In Federated SSO setups, this flag should be disabled and the tags and tag categories should be manually created.”
But I've found some conflicting info from reading the SRM documentation itself, so I'm a little confused at the moment. Hopefully VMware support can clear things up a bit.
Here are some article I've been reading for reference:
We ran into this issue in our environment today. Multiple vCenter 6.0 instances (recently upgraded from 5.5) joined to one PSC domain, several SRM 6.0 instances in the mix.
At first we did not disable storage.enableSdrsStandardTagCategoryCreation because of ambiguity around the use of the term "federated" to describe a single domain. After disabling that setting and manually deleting/re-creating the static tags/categories we found it didn't help with the Get-Tag error.
I've noticed if I disable storage.enableSdrsTagging in the SRM advanced settings so that all the SRM-created Consistency Group and Protection Group tags get deleted in the domain, the Get-Tag cmdlet starts working normally again.
When any of the SRM-created CG or PG tags exist, I get the "Index was outside the bounds of the array." error back from Get-Tag.
With all the SRM-created tags deleted, I've tried manually re-creating a tag with the exact same name, description, and category as one of the ones SRM had created previously and Get-Tag works just fine with that.
It seems like the way SRM is creating the tags might be related. Perhaps it is somehow attaching extra data to the object or using some format that the Get-Tag cmdlet doesn't like.
For now with storage.enableSdrsTagging disabled in all the SRM instances we can use PowerCLI to manage tags, but that's not really a fix.
I'll open an SR on Monday as well.
When you open your ticket reference my SR at the root of this thread.
The support engineer on my case was able to get tags working correctly and has opened an internal case with the developers.