Compartir a través de


IVMVirtualMachine::AddNetworkAdapter method

The AddNetworkAdapter method adds a network interface to the virtual machine.

Syntax

HRESULT AddNetworkAdapter(
  [out] IVMNetworkAdapter **networkAdapter
);

Parameters

networkAdapter [out]

A new IVMNetworkAdapter object.

Return value

This method supports standard return values, as well as the following. For information on Virtual Server specific return values not listed below, see HRESULT Codes Specific to the Virtual Server.

Return code Description
S_OK
The operation was successful.
E_POINTER
The networkAdapter parameter is NULL.
VM_E_VM_UNKNOWN
The configuration is unknown.
VM_E_VM_RUNNING
Virtual machine is running or saved.
DISP_E_EXCEPTION
An unexpected error has occurred.

Remarks

You can only add a new network interface to a stopped virtual machine. The newly created network adapter is not connected to a virtual network.

Requirements

Product
Microsoft Virtual Server 2005 onWindows Server 2003
Download
Microsoft Virtual Server 2005 R2 SP1 Update onWindows Server 2008orWindows Server 2003
Header
VsComInterfaces.h

See also

IVMVirtualMachine