1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-13 12:58:17 +03:00

F #4913: When a vCenter VM is deployed, the ESX_HOST is stored in a tmp file so VNC connection work right away

This commit is contained in:
mcabrerizo 2017-06-11 19:10:20 +02:00
parent 10c363a4ee
commit 55034c9079

View File

@ -29,6 +29,8 @@ $: << File.dirname(__FILE__)
require 'vcenter_driver'
VNC_ESX_HOST_FOLDER = "/tmp"
dfile = ARGV[0]
cluster_name = ARGV[1]
vm_id = ARGV[2]
@ -72,6 +74,12 @@ begin
vm.poweron
vm.set_running(true)
# Add VCENTER_ESX_HOST to MONITOR info so VNC works for running VMs F#4242
esx_host = vm["runtime.host.name"]
f = File.open(File.join(VNC_ESX_HOST_FOLDER, "vcenter_vnc_#{one_vm["ID"]}"), 'w')
f.write(esx_host)
f.close
puts vm['_ref']
rescue Exception => e