Changing NICs in virtual servers



  • Sanity check. Does this make sense? We are changing from e1000e virtual nics to vmxnet3 nics to go from 1 Gbps to 10 Gbps in throughput.

    Changing NICs.jpg



  • Looks right. Would have to test. but looks right.



  • Here is the actual code in a more searchable context, sterilized for general use.

    #Connects to the vCenter Server
    #Connect-VIServer -Server <vcenter>
    
    #Gathers nic information
    $nicTel1 = Get-NetworkAdapter -VM vmTel1
    $nicTI1 = Get-NetworkAdapter -VM vmTI1
    $nicTI2 = Get-NetworkAdapter -VM vmTI2
    $nicTS1 = Get-NetworkAdapter -VM vmTS1
    $nicSQL1 = Get-NetworkAdapter -VM vmSQL1
    $nicSQL2 = Get-NetworkAdapter -VM vmSQL2
    
    #Removes old e1000e network adapters
    Remove-NetworkAdapter -NetworkAdapter $nicTel1
    Remove-NetworkAdapter -NetworkAdapter $nicTI1
    Remove-NetworkAdapter -NetworkAdapter $nicTI2
    Remove-NetworkAdapter -NetworkAdapter $nicTS1
    Remove-NetworkAdapter -NetworkAdapter $nicSQL1
    Remove-NetworkAdapter -NetworkAdapter $nicSQL2
    
    #Creates new network vmxnet3 adapters
    New-NetworkAdapter -NetworkName "VM Network" -StartConnected:$true -Type Vmxnet3 -VM vmTel1
    New-NetworkAdapter -NetworkName "VM Network" -StartConnected:$true -Type Vmxnet3 -VM vmTI1
    New-NetworkAdapter -NetworkName "VM Network" -StartConnected:$true -Type Vmxnet3 -VM vmTI2
    New-NetworkAdapter -NetworkName "VM Network" -StartConnected:$true -Type Vmxnet3 -VM vmTS1
    New-NetworkAdapter -NetworkName "VM Network" -StartConnected:$true -Type Vmxnet3 -VM vmSQL1
    New-NetworkAdapter -NetworkName "VM Network" -StartConnected:$true -Type Vmxnet3 -VM vmSQL2
    
    #Check the work
    Get-NetworkAdapter -VM vmTel1
    Get-NetworkAdapter -VM vmTI1
    Get-NetworkAdapter -VM vmTI2
    Get-NetworkAdapter -VM vmTS1
    Get-NetworkAdapter -VM vmSQL1
    Get-NetworkAdapter -VM vmSQL2
    
    #Disconnect from vCenter server
    Disconnect-VIServer
    


  • @NerdyDad said in Changing NICs in virtual servers:

    Here is the actual code in a more searchable context, sterilized for general use.

    Very useful! Thanks!