Skip to content
Permalink
Browse files

api: Vps::Migrate::Base: fix removal of old IP addresses

When replacing IP addresses during a migration to a different location,
the old addresses have to be removed on the destination node. This is
because VPS configs are copied from the source node, including the IP
addresses that have to be removed. Removing them on the source node
at this point was pointless.
  • Loading branch information...
aither64 committed Apr 9, 2019
1 parent 1dee9f4 commit 6f5f2ed9248dfbd0c014b536bcb4938f758ed477
Showing with 3 additions and 3 deletions.
  1. +3 −3 api/models/transaction_chains/vps/migrate/base.rb
@@ -312,10 +312,10 @@ def migrate_ip_addresses(netif)
dst_host_addrs = dst_ip.host_ip_addresses.where(order: nil).to_a
all_dst_host_addrs.concat(dst_host_addrs)

# Remove addresses from the source node
# Remove old addresses on the target node
append_t(
Transactions::NetworkInterface::DelRoute,
args: [netif, src_ip, false],
args: [dst_netif, src_ip, false],
urgent: true,
) do |t|
t.edit(src_ip, network_interface_id: nil)
@@ -326,7 +326,7 @@ def migrate_ip_addresses(netif)
end
end

# Add addresses on the target node
# Add new addresses on the target node
append_t(
Transactions::NetworkInterface::AddRoute,
args: [dst_netif, dst_ip],

0 comments on commit 6f5f2ed

Please sign in to comment.
You can’t perform that action at this time.