The IVMNetworkAdapter interface is the interface to a virtual network interface card (NIC). It is used to set up how a virtual machine is networked. Network interface cards can be added and removed by using IVMVirtualMachine::AddNetworkAdapter and IVMVirtualMachine::RemoveNetworkAdapter. You can also retrieve an IVMNetworkAdapter object from the IVMNetworkAdapterCollection collection returned from the IVMVirtualMachine::NetworkAdapters property.
When to use
The following procedures explain how to use the IVMNetworkAdapter interface.
To attach a virtual NIC to a host NIC
- Virtual (guest) NICs are not attached directly to a host NIC. Instead, the virtual NIC is attached to a virtual network that is attached to a host NIC. For more information about configuring virtual networks, see IVMVirtualNetwork. To attach the virtual NIC to a virtual network, use the AttachToVirtualNetwork method.
To disconnect a virtual NIC from the virtual network
- The DetachFromVirtualNetwork method will detach the virtual NIC from the virtual network. After this function is called, the VirtualNetwork property will return a virtual network ID that is not valid.
To remove a virtual NIC from a virtual machine if you have the virtual NIC object
- Get the virtual machine associated with the virtual NIC by using the VirtualMachine property.
- Use the current object as a parameter to the IVMVirtualMachine::RemoveNetworkAdapter method.
The IVMNetworkAdapter interface inherits from the IDispatch interface. IVMNetworkAdapter also has these types of members:
The IVMNetworkAdapter interface has these methods.
|AttachToVirtualNetwork||Attaches the virtual NIC to the specified virtual network by using the virtual network's ID.
|DetachFromVirtualNetwork||Detaches the virtual NIC from its virtual network.
The IVMNetworkAdapter interface has these properties.
||The internal ID of this network adapter.
||The Ethernet (MAC/Physical/Network) address of the virtual NIC.
||Indicates whether the Ethernet address is dynamically generated.
||The virtual machine associated with this virtual NIC.
||The virtual network to which the virtual NIC is attached.
The default Ethernet address for a network interface is "00-00-00-00-00-00", which is considered an invalid Ethernet address by most operating systems. If IsEthernetAddressDynamic is set to FALSE, EthernetAddress must be initialized with a valid Ethernet network address.
||Microsoft Virtual Server 2005 onWindows Server 2003
||Microsoft Virtual Server 2005 R2 SP1 Update onWindows Server 2008orWindows Server 2003