THEL1ZARDKING
Contributor
Contributor

How do you add a E1000E NIC to Server 2012 VM via PowerCLI?

Jump to solution

Hello,

I have been attempting to figure out how to added a E1000E NIC to a Windows Server 2012 VM and have been wildly unsuccessful. None of the current 5.1 PowerCLI documentation even references it's existence.  When I use the Get-NetworkAdapter it returns the E1000E NICs as "Unknown."  I tried adding a NIC with a -Type of "Unknown" and it just added a regular "VMXNET" NIC.

I am testing against 5.0.0(Build 821926) hosts which can deploy Server 2012 with E1000E NICs via vCenter and PowerCLI 5.0.1 & 5.1 with the same results.  Any information you could provide me with would be greatly appreciated as I am out of ideas at the moment.

Cheers!

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership

I just posted Work with E1000E NICs in PowerCLI.

Give it a try and let me know if it works out for you ?


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

View solution in original post

0 Kudos
7 Replies
LucD
Leadership
Leadership

The E1000E is not yet in the enumeration for the VirtualNetworkAdapterType, that exlains why the New-NetworkAdapter doesn't accept the type.

But in the SDK API you can use the VirtualE1000e type for a NIC.

With the ReconfigVM_Task method you will be able to add such a NIC type.

Let me know if you need some sample code ?


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

0 Kudos
THEL1ZARDKING
Contributor
Contributor

Sample code would be great! Thanks Luc you never let me down.

0 Kudos
LucD
Leadership
Leadership

Try something like this

$vmName = "MyVM" 
$networkName = "networkname"
$vm
= Get-VM -Name $vmName $spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$dev
= New-Object VMware.Vim.VirtualDeviceConfigSpec
$dev
.Operation = "add"
$dev.Device = New-Object VMware.Vim.VirtualE1000e
$dev.Device.Connectable = New-Object VMware.Vim.VirtualDeviceConnectInfo
$dev.Device.Connectable.StartConnected = $true
$dev.Device.Backing = New-Object VMware.Vim.VirtualEthernetCardNetworkBackingInfo
$dev.Device.Backing.DeviceName = $networkName
$spec.deviceChange += $dev
$vm
.ExtensionData.ReconfigVM($spec)


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

0 Kudos
THEL1ZARDKING
Contributor
Contributor

Luc,

This code helped me get the nic added, I did find a "0" in the StartConnected line which I fixed below. They only thing I noticed is that it's not connecting it to my DVS.  I can get around this using the Set-NetworkAdapter cmdlet but I figure you probably know a way to incorporate it into the code below.  Thanks again!

LucD wrote:

Try something like this

$vmName = "MyVM" 
$networkName = "networkname"
$vm
= Get-VM -Name $vmName $spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$dev
= New-Object VMware.Vim.VirtualDeviceConfigSpec
$dev
.Operation = "add"
$dev.Device = New-Object VMware.Vim.VirtualE1000e
$dev.Device.Connectable = New-Object VMware.Vim.VirtualDeviceConnectInfo
$dev.Device.Connectable.StartConnected = $true
$dev.Device.Backing = New-Object VMware.Vim.VirtualEthernetCardNetworkBackingInfo
$dev.Device.Backing.DeviceName = $networkName
$spec.deviceChange += $dev
$vm
.ExtensionData.ReconfigVM($spec)
0 Kudos
LucD
Leadership
Leadership

That was an uppercase o, but thanks for noticing. I updated the code above.

I'm preparing a blog post with a function that provides more functionality.

Hold on


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

0 Kudos
LucD
Leadership
Leadership

I just posted Work with E1000E NICs in PowerCLI.

Give it a try and let me know if it works out for you ?


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

0 Kudos
ben1985
Contributor
Contributor

I realise this is an old thread but is there a way to edit a network adapter to be an e1000e?

0 Kudos