mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03: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>
This commit is contained in:
parent
7078b8d298
commit
cc2ae9ef7b
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user