1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

Backlog #3691: Check if running VM in vCenter has VNC open port and set GRAPHICS section with right port

(cherry picked from commit 21bee73dc3c54a319c5a7c996a1179fb8799bb3a)
This commit is contained in:
Tino Vazquez 2015-03-19 17:56:41 +01:00
parent 133c96fff6
commit 42259dc87d

View File

@ -181,7 +181,7 @@ class VIClient
false
end
end
end
end
########################################################################
# Builds a hash with the DataCenter / ClusterComputeResource hierarchy
@ -1066,6 +1066,16 @@ class VCenterVm
"IMPORT_VM_ID = \"#{@vm.config.uuid}\"\n"\
"SCHED_REQUIREMENTS=\"NAME=\\\"#{@vm.runtime.host.parent.name}\\\"\"\n"
vp=@vm.config.extraConfig.select{|v| v[:key]=="remotedisplay.vnc.port"}
if vp.size > 0
str << "GRAPHICS = [\n"\
" TYPE =\"vnc\",\n"\
" LISTEN =\"0.0.0.0\",\n"\
" PORT =\"#{vp[0][:value]}\"\n"\
"]\n"
end
if @vm.config.annotation.nil? || @vm.config.annotation.empty?
str << "DESCRIPTION = \"vCenter Virtual Machine imported by OpenNebula"\
" from Cluster #{@vm.runtime.host.parent.name}\"\n"