VMware Cloud Community
cvv2
Contributor
Contributor
Jump to solution

Add security tag to a new vm in NSX-T with powershell

Hi all,

I found a nice powershell script (https://www.vrealize.it/2019/12/22/add-or-remove-tags-in-nsx-t-with-powercli/) But I run into the problem of the limit of "1000" I see with ($vmdata.help.list) that the page_size is default 1000. Does anyone have a solution for this so that the list returns more than 1000?

Reply
0 Kudos
3 Solutions

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Since the post hasn't been updated since it was published, I suspect the author didn't get an answer.
Why don't you ask the question as a Reply on that blog post?


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

View solution in original post

Reply
0 Kudos
Zsoldier
Expert
Expert
Jump to solution

You could maybe start here then as part of your new VM build script:

https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Applying-NSXT-Tag-to-a-VM/m-p/2863049#...

Chris Nakagaki (中垣浩一)
Blog: https://tech.zsoldier.com
Twitter: @zsoldier

View solution in original post

cvv2
Contributor
Contributor
Jump to solution

Spoiler
Thank you, with a few tweaks my rollout script worked the way I want again.

View solution in original post

Reply
0 Kudos
5 Replies
LucD
Leadership
Leadership
Jump to solution

Since the post hasn't been updated since it was published, I suspect the author didn't get an answer.
Why don't you ask the question as a Reply on that blog post?


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

Reply
0 Kudos
Zsoldier
Expert
Expert
Jump to solution

Based on the API doc, page size is limited to 1000. https://vdc-download.vmware.com/vmwb-repository/dcr-public/d6de7a5e-636f-4677-8dbd-6f4ba91fa5e0/36b4...

Unfortunately, I don't see anyway that you could get a filtered list from this api endpoint in particular.  Weird that they would limit it to 1000.  Seems like an oversight, but depending on what you are trying to accomplish from this particular call, there might be another way.

What is it that you are trying to do exactly @cvv2  ?  

Chris Nakagaki (中垣浩一)
Blog: https://tech.zsoldier.com
Twitter: @zsoldier
Reply
0 Kudos
cvv2
Contributor
Contributor
Jump to solution

Hi, @Zsoldier 

I want to set a security tag(s) (NSX-T) on a new created VM. The new VM is created with a Powershell script.

 

 

 

 

Reply
0 Kudos
Zsoldier
Expert
Expert
Jump to solution

You could maybe start here then as part of your new VM build script:

https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Applying-NSXT-Tag-to-a-VM/m-p/2863049#...

Chris Nakagaki (中垣浩一)
Blog: https://tech.zsoldier.com
Twitter: @zsoldier
cvv2
Contributor
Contributor
Jump to solution

Spoiler
Thank you, with a few tweaks my rollout script worked the way I want again.
Reply
0 Kudos