Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"cot deploy esxi" needs to create serial ports after deployment #24

Closed
glennmatthews opened this issue Jan 5, 2015 · 4 comments
Closed

Comments

@glennmatthews
Copy link
Owner

Currently ovftool ignores serial ports defined in an OVF, so cot 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.

@glennmatthews
Copy link
Owner Author

Probably relevant:

http://access-console-port-virtual-machine.blogspot.com/2013/07/add-serial-port-to-vm-through-gui-or.html

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)

}
  1. Power OFF your VM
  2. open PowerCLI
  3. New-SerialPort
  4. Power ON your vm
  5. telnet

@glennmatthews
Copy link
Owner Author

14da863 is related

@glennmatthews
Copy link
Owner Author

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 port
telnet 10.122.197.27 33334

glennmatthews added a commit that referenced this issue Aug 19, 2015
@glennmatthews
Copy link
Owner Author

55e78d3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant