Data Object - VirtualSerialPort


Data Object Description

The VirtualSerialPort data object represents a serial port on a virtual machine. A virtual serial port uses one of the following backing types to specify how the virtual machine performs serial port operations.

When you use network backing, you can also configure a virtual serial port to use a virtual serial port concentrator. The virtual machine initiates a telnet connection with the concentrator, and the concentrator acts as a proxy between the virtual machine and a system on the network. By using a virtual serial port concentrator, you can maintain the connection between the virtual machine and the network resource when a vMotion event moves the virtual machine from one host to another. Without a virtual serial port concentrator, the connection would be lost. For information about using a serial port concentrator, see Using a Proxy with vSphere Virtual Serial Ports.

You can configure a virtual serial port when you create or reconfigure a virtual machine. For example, to create a virtual serial port with network backing, use the following sequence of operations. In this procedure, the virtual serial port uses a proxy and will accept a network connection.

  1. Use the QueryConfigOption method to determine the backing options that are available on a host. The method returns a VirtualMachineConfigOption data object. The virtual machine configuration data includes a list of backing options (backingOption). The following pseudocode shows the path to the backing options.


    The array of virtual device options can include a virtual serial port (VirtualSerialPortOption). The array of serial port backing options can include URI, file, pipe, or device backing options.

  2. Use the CreateVM_Task method (or the CreateChildVM_Task method) to create the virtual machine and configure the virtual serial port backing. Create a VirtualMachineConfigSpec data object and nested data objects for the method's config parameter. The following pseudocode shows the resulting path to the backing information.


    Set the direction property to "server" to direct the virtual machine to accept a connection. Set the serviceURI property to the URI for the host on which the virtual machine runs.
If you use physical device backing (VirtualSerialPortDeviceBackingOption), you should also use the QueryConfigTarget method to determine if a serial device is available before configuring device backing.


Name Type Description

Enables CPU yield behavior. If you set yieldOnPoll to true, the virtual machine will periodically relinquish the processor if its sole task is polling the virtual serial port. The amount of time it takes to regain the processor will depend on the degree of other virtual machine activity on the host.

To use this property, the CPU yield option must be supported. (See the yieldOnPoll property for the virtual serial port option object.)

Properties inherited from VirtualDevice
backing, connectable, controllerKey, deviceInfo, key, unitNumber
Properties inherited from DynamicData
dynamicProperty, dynamicType

Show WSDL type definition