VMware Cloud Community
thiag2011
Enthusiast
Enthusiast

New-NetworkAdapter- Unable to create a nic for Win 2016 OS

Hi all,

Am trying to create a network adapter on two dummy vms with OS versions marked as  Win2008(vm name = vm1)  and win 2016( vm name = test), using the below command.

1) PowerCLI F:\> Get-VM test | New-NetworkAdapter -NetworkName xxxxvlan105 -WakeOnLan -StartConnected -Type Vmxnet3

     New-NetworkAdapter : 12/7/2018 8:31:09 PM    New-NetworkAdapter        The network "xxxxvlan105" doesn't exist on the host.

          At line:1 char:15

          + Get-VM test | New-NetworkAdapter -NetworkName xxxxvlan105 -WakeOnLan -StartConne ...

        + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

         + CategoryInfo          : ResourceUnavailable: (xxxxvlan105:String) [New-NetworkAdapter], ViError

         + FullyQualifiedErrorId : Client20_VmHostServiceImpl_TryGetHostNetworkByName_NonexistentNetwork,VMware.VimAutomation.ViCore.Cmdlets.Commands.Vir

        tualDevice.NewNetworkAdapter

2) PowerCLI F:\> Get-VM vm1 | New-NetworkAdapter -NetworkName xxxxvlan105 -WakeOnLan -StartConnected -Type Vmxnet3

Name                 Type       NetworkName  MacAddress         WakeOnLan

                                                                  Enabled

----                 ----       -----------  ----------         ---------

Network adapter 6    Vmxnet3    xxxxvlan105  00:50:56:94:xx:xx       True

Note:

If I change the OS version to 2008 on vm "test", then am able to create the network adapter.

Any suggestions please...

0 Kudos
3 Replies
LucD
Leadership
Leadership

Are you sure that portgroup exists?


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

0 Kudos
thiag2011
Enthusiast
Enthusiast

Hi LucD,

Yes, the portgroup exists.

I created two vms, one will OS 2008 and other with 2016 on the same host.

This command works for 2008 OS tagged vm but not on 2016 OS.

Infact, if I change the OS version to 2008 in edit settings ( from 2016), this command works fine.

0 Kudos
LucD
Leadership
Leadership

Is this perhaps a portgroup on a VSS?
In that case it needs to be defined on the ESXi node where the VM is registered to.
You can check with (update the name of the VM and the portgroup accordingly)

Get-VM -Name vm1 | Get-VMHost | Get-VirtualPortGroup -Name xxxxvlan105


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

0 Kudos