mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-23 22:50:09 +03:00
Backlog #3691: Check if running VM in vCenter has VNC open port and set GRAPHICS section with right port
This commit is contained in:
parent
f4d54779c8
commit
21bee73dc3
@ -181,7 +181,7 @@ class VIClient
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
########################################################################
|
||||
# Builds a hash with the DataCenter / ClusterComputeResource hierarchy
|
||||
@ -1070,6 +1070,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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user