mirror of
https://github.com/OpenNebula/one.git
synced 2026-12-05 14:41:43 +09:00
M #-: nodeport post needs deactivate (#1237)
When resuming a VM powered-off from guest OS (and it is monitored as
powered-off by the OpenNebula monitor), it fails because 'ip route add'
fails when an already existing route is configured. If 'ip route add' is
changed by 'ip route replace' (idempotent) the problem is solved;
however, duplicated iptables rules are added. Therefore, to have this
working for all scenarios a deactivate is called on driver to clean the
VM route and the all the iptables rules previos to the call to activate.
Signed-off-by: Ricardo Diaz <rdiaz@opennebula.io>
(cherry picked from commit cc2ae9ef7b)
This commit is contained in:
1 parent
97355eea97
commit
ab9cf86310
2 files changed
+5
-2
No files matched your search
@@ -100,9 +100,9 @@ class NodePortDriver < VNMMAD::VNMDriver
|
||||
"#{nic[:bridge]} | true"
|
||||
cmds.add :iptables, '-t nat -D PREROUTING -p tcp --dport ' \
|
||||
"#{nic[:external_port_range]} -j DNAT --to " \
|
||||
"#{nic[:ip]}:#{nic[:internal_port_range]}"
|
||||
"#{nic[:ip]}:#{nic[:internal_port_range]} | true"
|
||||
cmds.add :iptables, '-t nat -D POSTROUTING -j MASQUERADE ' \
|
||||
"-s #{nic[:ip]}"
|
||||
"-s #{nic[:ip]} | true"
|
||||
end
|
||||
|
||||
if rc != false
|
||||
|
||||
@@ -31,6 +31,9 @@ begin
|
||||
xpath_filter,
|
||||
deploy_id,
|
||||
false)
|
||||
|
||||
drv.deactivate
|
||||
|
||||
filter_driver.activate(true) if drv.activate == 0
|
||||
rescue Exception => e
|
||||
OpenNebula.log_error(e.message)
|
||||
|
||||
Reference in new issue
Block a user