VirtualSerialPort

VirtualSerialPort
VirtualSerialPort

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.

  • Network backing (VirtualSerialPortURIBackingInfo) supports a connection between the virtual machine and a resource on the network. The virtual machine can initiate a connection with the network resource, or it can listen for connections originating from the network.
  • Pipe backing (VirtualSerialPortPipeBackingInfo) supports I/O through a named pipe. The pipe connects the virtual machine to a host application or a virtual machine on the same host.
  • File backing (VirtualSerialPortFileBackingInfo) supports output through the virtual serial port to a file on the same host.
  • Physical serial port backing (VirtualSerialPortDeviceBackingInfo) supports a connection between the virtual machine and a device that is connected to a physical serial port on the host.
  • ThinPrint backing (VirtualSerialPortThinPrintBackingInfo) provides driver-free printing.

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.

        VirtualMachineConfigOption.hardwareOptions.VirtualDeviceOption[].backingOption[]

    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.

        VirtualMachineConfigSpec.deviceChange[].device.backing

    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.

AllOf
This class requires all of the following:
JSON Example
{
    "_typeName": "string",
    "key": 0,
    "deviceInfo": {
        "_typeName": "string",
        "label": "string",
        "summary": "string"
    },
    "backing": {
        "_typeName": "string"
    },
    "connectable": {
        "_typeName": "string",
        "migrateConnect": "string",
        "startConnected": false,
        "allowGuestControl": false,
        "connected": false,
        "status": "string"
    },
    "slotInfo": {
        "_typeName": "string"
    },
    "controllerKey": 0,
    "unitNumber": 0,
    "numaNode": 0,
    "deviceGroupInfo": {
        "_typeName": "string",
        "groupInstanceKey": 0,
        "sequenceId": 0
    },
    "yieldOnPoll": false
}
boolean
yieldOnPoll
Required

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.)