VMware Cloud Community
fborges555
Enthusiast
Enthusiast
Jump to solution

add a physical nic (vmnic1)

Hi gurus

I have an esxi host already added to vcenter with only one nic(vmnic0), I would like to use cli to add the second vmnic1 to the host vswitch so I can have

the following

pastedImage_0.png

and not

pastedImage_1.png

Thanks for any help

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Try like this

$esxName = 'MyEsx'

$swName = 'vSwitch0'

$nicName = 'vmnic1'


Get-VMHost -Name $esxName | Get-VirtualSwitch -Name $swName -PipelineVariable vss |

ForEach-Object -Process {

    Set-VirtualSwitch -VirtualSwitch $vss -Nic (@($vss.Nic) + $nicName) -Confirm:$false

}


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

View solution in original post

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Try like this

$esxName = 'MyEsx'

$swName = 'vSwitch0'

$nicName = 'vmnic1'


Get-VMHost -Name $esxName | Get-VirtualSwitch -Name $swName -PipelineVariable vss |

ForEach-Object -Process {

    Set-VirtualSwitch -VirtualSwitch $vss -Nic (@($vss.Nic) + $nicName) -Confirm:$false

}


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

Reply
0 Kudos
fborges555
Enthusiast
Enthusiast
Jump to solution

L.

as always thanks for all the help...stay safe

Reply
0 Kudos