VMware Cloud Community
malek12
Contributor
Contributor

Script to list the speed of a virtual machines network adapter and Script to set the speed limit

Hello, I am looking for two different scripts to do the following.

 

Script 1 :  Get the speed of the network adapter per VM.  I tried using the get- networkadapter command but it does not give me anything for the actual speed of the network adapter.  How can this be achieved?  I am referencing https://developer.vmware.com/docs/5060/cmdlet-reference/doc/Get-NetworkAdapter.html.  Is this the correct place to look?

Script 2:  Change the speed of the network adapters per VM.  If I have a list of VM's where the nic is set to unlimited but I want to limit them to 2 GB, how would I do that?  I do not see where these options are available in the Set-NetworkAdapter  command?

Any help would be appreciated, thanks!

Labels (1)
  • He

Reply
0 Kudos
4 Replies
LucD
Leadership
Leadership

Are you sure you want the speed?
To get that you can have a look at Solved: Re: getting physicl nic speed _powercli - VMware Technology Network VMTN

If you mean setting the limit for a vNIC, you can have a look at Solved: Re: Cannot find any way to change network adapter ... - VMware Technology Network VMTN


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

Reply
0 Kudos
malek12
Contributor
Contributor

You are correct LucD, I worded it poorly.  I am specifically talking about the limit for the network adapter of a VM.  By default it is set to unlimited.  I have a need to get a list of all the VM's in an environment that will show what the limit is set to, which is overwhelmingly going to be unlimited, since they were deployed that way.  Once that list is generated, I would require a script that could change the limit to whatever the server owners need to.  In some cases 1GB or 2GB or whatever they decide.

So I don't need the speed, I need the value of what the limit is set to on a per network adapter basis of a VM, and then how I can change that on a per network adapter basis of a VM.

 

Thanks,

 

Reply
0 Kudos
LucD
Leadership
Leadership

That is exactly what the script in the 2nd link is doing


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

Reply
0 Kudos
malek12
Contributor
Contributor

Thanks LucD.  I will take a look at it and let you know if it does what I need.

Reply
0 Kudos