VMware Cloud Community
DrewHeath
Contributor
Contributor
Jump to solution

Tag Propagation

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
Jump to solution

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
Jump to solution

Programmatically, yes. Graphically, no.

0 Kudos
DrewHeath
Contributor
Contributor
Jump to solution

Do you have any guidance for this process?

0 Kudos
daphnissov
Immortal
Immortal
Jump to solution

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

0 Kudos
DrewHeath
Contributor
Contributor
Jump to solution

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
Jump to solution

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}

0 Kudos
DrewHeath
Contributor
Contributor
Jump to solution

Thanks, I can work with this!

0 Kudos