DrewHeath
Contributor
Contributor

Tag Propagation

Jump to solution

I have a set of tags that I would like to deploy to folders in vCenter, and would like to know if there is a method to automatically assign those tags to the VMs that reside in the folder that was tagged.  Thank you in advance!

0 Kudos
1 Solution

Accepted Solutions
daphnissov
Immortal
Immortal

You can do something like this very easily:

$VMs = Get-Folder -Name "Ansible Lab" | Get-VM

foreach ($this in $VMs){

    New-TagAssignment -Entity $this -Tag Finance}

View solution in original post

0 Kudos
6 Replies
daphnissov
Immortal
Immortal

Programmatically, yes. Graphically, no.

0 Kudos
DrewHeath
Contributor
Contributor

Do you have any guidance for this process?

0 Kudos
daphnissov
Immortal
Immortal

Using PowerCLI it's a simple process. Are you open to using that?

0 Kudos
DrewHeath
Contributor
Contributor

Yes.  We have a number of different folders, so it depends on how intricate it is.  We already have some tags being synced between two different vCenters with PowerCLI.

0 Kudos
daphnissov
Immortal
Immortal

You can do something like this very easily:

$VMs = Get-Folder -Name "Ansible Lab" | Get-VM

foreach ($this in $VMs){

    New-TagAssignment -Entity $this -Tag Finance}

View solution in original post

0 Kudos
DrewHeath
Contributor
Contributor

Thanks, I can work with this!

0 Kudos