DarrenPenner
Enthusiast
Enthusiast

Unable to use tags in PowerCli 6.3 on Windows 10

Jump to solution

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

I get

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?

1 Solution

Accepted Solutions
stephenrbarry
Enthusiast
Enthusiast

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.

View solution in original post

0 Kudos
36 Replies
LucD
Leadership
Leadership

Can you try with an older PowerCLI version ?

You're not running vCenter on a Windows 10 box I assume ?

This was definitely not there in previous versions, might be a "feature"


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
DarrenPenner
Enthusiast
Enthusiast

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.

0 Kudos
LucD
Leadership
Leadership

You can download older versions in the Developer Center.

See vSphere PowerCLI 6.0 - VMware Developer Center


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
DarrenPenner
Enthusiast
Enthusiast

I installed PowerCLI 6.0.0.7254 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.

0 Kudos
LucD
Leadership
Leadership

Strange, perhaps someone from VMW would be able to shed some light.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
DarrenPenner
Enthusiast
Enthusiast

Any suggestion on how to get their attention on this post?

You can't seem to actually be able to open a ticket for PowerCLI under support.

0 Kudos
LucD
Leadership
Leadership

You can open a SR for PowerCLI, as long it is not for your debugging your scripts, but "features" in PowerCLI itself.ion.

I contacted them, waiting for a react


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
DarrenPenner
Enthusiast
Enthusiast

I went and opened an SR for this also in case any VMware support happens to come along this thread.

SR16967990604

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.

VMware SDK and API Support | United States

This isn't covered under the regular support contracts and is a separate contract/cost.

0 Kudos
alanrenouf
VMware Employee
VMware Employee

Hi,

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.

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
0 Kudos
DarrenPenner
Enthusiast
Enthusiast

Hi Alan,

I have updated the ticket the information you provided.


Thanks for your help with this!

VMwareAndrew
VMware Employee
VMware Employee

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?

0 Kudos
DarrenPenner
Enthusiast
Enthusiast

Hi Andrew,

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.

Thanks.

0 Kudos
stephenrbarry
Enthusiast
Enthusiast

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?

Steve

0 Kudos
DarrenPenner
Enthusiast
Enthusiast

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).

0 Kudos
stephenrbarry
Enthusiast
Enthusiast

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:

Site Recovery Manager 6 and Storage DRS Tagging: Part I–The Basics

VMware KB: How Site Recovery Manager Handles Storage DRS Tagging

0 Kudos
VMwareAndrew
VMware Employee
VMware Employee

Hi Darren -

Thanks for the info - I won't need to repro on Windows 10 then if it affects 2008 R2.  We'll be in touch.

0 Kudos
watchrebel
Contributor
Contributor

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.

stephenrbarry
Enthusiast
Enthusiast

Great stuff, thank you for sharing your findings.  That should prove very helpful.

0 Kudos
DarrenPenner
Enthusiast
Enthusiast

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.

0 Kudos