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

Do not set VNC ports as used in certain states #214

Original fix by @dfelsch
This commit is contained in:
Javi Fontan 2017-06-09 16:36:38 +02:00
parent 125a6825ca
commit 4018be7277

View File

@ -19,7 +19,13 @@ module OneDBFsck
port = vm_doc.root.at_xpath('TEMPLATE/GRAPHICS[translate(TYPE,"vnc","VNC")="VNC"]/PORT').text.to_i rescue nil
# DATA: TODO: get also spice port
if cid && port
# Do not add port if the VM is in one of these states:
# * init
# * pending
# * hold
# * stopped
# * undeployed
if cid && port && ![0, 1, 2, 4, 9].include?(state)
cluster_vnc[cid] ||= Set.new
cluster_vnc[cid] << port
end