VMware Cloud Community
nimos001
Enthusiast
Enthusiast
Jump to solution

Adding Network Adapter to Guest via command line

I need some help trying to track down the command line for adding a new network adapter to multiple guest virtual machines at once and designating the port group name.

I tried using the below command and it does create the new adapter but it's grayed out and I can't make any changes to it other than delete it via the GUI. Any help is appreciated!!!

~ # vim-cmd vmsvc/devices.createnic 10 99 vmxnet3 DR_Private

Reply
0 Kudos
1 Solution

Accepted Solutions
nimos001
Enthusiast
Enthusiast
Jump to solution

I was just coming back to post that I figured out what I needed.

(Changes Network Adapter already present)

Get-Cluster %cluster_name% |Get-VM  |Get-NetworkAdapter |Set-NetworkAdapter -NetworkName DR_Private -Confirm:$false

(Adds New Network Adapter to CLUSTER)

Get-Cluster %cluster_name% |Get-VM |New-NetworkAdapter -NetworkName DR_Private -StartConnected -Confirm:$false

-Brian

View solution in original post

Reply
0 Kudos
4 Replies
nimos001
Enthusiast
Enthusiast
Jump to solution

I tested the below command and it will change the current adapter to what I desire. ( I assume if I do not list a specific vm after Get-VM it will apply this to all vm's on the cluster but have not verified?) I am still trying to determine how to ONLY add a new VM to all of these systems.

Get-Cluster %cluster_name% |Get-VM %vm_name% |Get-NetworkAdapter |Set-NetworkAdapter -NetworkName DR_Private -Confirm:$false

Reply
0 Kudos
admin
Immortal
Immortal
Jump to solution

Remove-the arguments to " Get-VM " command, then it should work for all.


" Get-Cluster <cluster_name> |Get-VM | New-NetworkAdapter -NetworkName <Name of n/w> -portKey <Specify the port of virtual switch> -Confirm:$false "



For more options in " New-NetworkAdapter " command checkout .. New-NetworkAdapter - vSphere PowerCLI Cmdlets Reference



~dGeorgey

nimos001
Enthusiast
Enthusiast
Jump to solution

I was just coming back to post that I figured out what I needed.

(Changes Network Adapter already present)

Get-Cluster %cluster_name% |Get-VM  |Get-NetworkAdapter |Set-NetworkAdapter -NetworkName DR_Private -Confirm:$false

(Adds New Network Adapter to CLUSTER)

Get-Cluster %cluster_name% |Get-VM |New-NetworkAdapter -NetworkName DR_Private -StartConnected -Confirm:$false

-Brian

Reply
0 Kudos
TurboBailey
Contributor
Contributor
Jump to solution

Installing to the latest Esxi-embedded client worked for me.

I have been scratching my head about this problem so thank you!

Reply
0 Kudos