Closed glennmatthews closed 9 years ago
Probably relevant:
PowerCLI script to do create serial port. Although Firewall settings on esxi server has to be done manually.
# Adds the base cmdlets
Add-PSSnapin VMware.VimAutomation.Core
# This script adds some helper functions and sets the appearance. You can pick and choose parts of this file for a fully custom appearance.
. "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1"
Function New-SerialPort
{
Param(
[string]$vmName,
[string]$prt
) #end
$dev = New-Object VMware.Vim.VirtualDeviceConfigSpec
$dev.operation = "add"
$dev.device = New-Object VMware.Vim.VirtualSerialPort
$dev.device.key = -1
$dev.device.backing = New-Object VMware.Vim.VirtualSerialPortURIBackingInfo
$dev.device.backing.direction = "server"
$dev.device.backing.serviceURI = "telnet://:$prt"
$dev.device.connectable = New-Object VMware.Vim.VirtualDeviceConnectInfo
$dev.device.connectable.connected = $true
$dev.device.connectable.StartConnected = $true
$dev.device.yieldOnPoll = $true
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.DeviceChange += $dev
$vm = Get-VM -Name $vmName
$vm.ExtensionData.ReconfigVM($spec)
}
14da863 is related
I found an example of adding serial ports via pysphere: https://groups.google.com/forum/#!topic/pysphere/u1PI4tnpiXA
I installed pysphere on my server and was able to run the serial port script from the web page above. deploy vm with cot add serial port:
python add_serial_port.py -s 10.122.197.27 -u root -p rtpfe123 -v skorka_test3 -P 33334
telnet to the serial porttelnet 10.122.197.27 33334
55e78d32f31b8b8db24323014ed6b87e6a66214d
Currently
ovftool
ignores serial ports defined in an OVF, socot deploy esxi
(which uses ovftool) will create VMs with no serial ports even if the OVF defines them.Until/unless VMware fixes this
ovftool
limitation, it would be really helpful for COT to implement some workaround (possibly using PowerCLI?) to force creation of the requested serial ports.