VMware Cloud Community
AllBlack
Expert
Expert
Jump to solution

new-tagassignment returning tag with id not found

Hi,

I am using powercli 5.5.R1 and want to sign tags against VM in a vCenter 5.1 environment.
Retrieving tags with get-tag works fine but I cannot assign tag.

new-tagassignment -tag $mytag -Entity $vm returns an error that states the specified tag with id "InventoryServiceTag-<somenumber> was not found.

Does this not work against 5.1 environments?

Please consider marking my answer as "helpful" or "correct"
1 Solution

Accepted Solutions
AllBlack
Expert
Expert
Jump to solution

For those interested, VMware Support has told me that there is an issue with this if vCenters are configured in linked mode.
This should be fixed in an upcoming release

Please consider marking my answer as "helpful" or "correct"

View solution in original post

4 Replies
CRad14
Hot Shot
Hot Shot
Jump to solution

Tagging works in both 5.1 and 5.5.


From the error message, is it possible the Tag you are trying to assign has not been created in the 5.1 environment yet?

Conrad www.vnoob.com | @vNoob | If I or anyone else is helpful to you make sure you mark their posts as such! 🙂
0 Kudos
AllBlack
Expert
Expert
Jump to solution

The error states that the tag with ID was not found but when I run 'get-tag mytagname | select id' it returns the same id as the one the error is complaining about.
This tells me that the tag exists. Tried this for several other tags but same issue

Please consider marking my answer as "helpful" or "correct"
0 Kudos
kunaludapi
Expert
Expert
Jump to solution

Try this

$myTag = Get-Tag "Server 2003"

$myVM = Get-VM

foreach ($vm in $myVM) {

    New-TagAssignment -Tag "Server 2003" -Entity $VM.name

}

--------------------------------------------------------------- Kunal Udapi Sr. System Architect (Virtualization, Networking And Storage) http://vcloud-lab.com http://kunaludapi.blogspot.com VMWare vExpert 2014, 2015, 2016 If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
0 Kudos
AllBlack
Expert
Expert
Jump to solution

For those interested, VMware Support has told me that there is an issue with this if vCenters are configured in linked mode.
This should be fixed in an upcoming release

Please consider marking my answer as "helpful" or "correct"