ESXi

 View Only
  • 1.  Adding Network Adapter to Guest via command line

    Posted Sep 23, 2013 07:55 PM

    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



  • 2.  RE: Adding Network Adapter to Guest via command line

    Posted Sep 24, 2013 11:43 AM

    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



  • 3.  RE: Adding Network Adapter to Guest via command line

    Posted Sep 24, 2013 12:12 PM

    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



  • 4.  RE: Adding Network Adapter to Guest via command line
    Best Answer

    Posted Sep 24, 2013 12:14 PM

    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



  • 5.  RE: Adding Network Adapter to Guest via command line

    Posted Aug 17, 2017 09:44 AM

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

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