Change id != routed_to_host_id to vm_host.sshable.host != cidr.network.to_s We do not consistently use the VmHost id as the primary Address id (it is not done at all for Hetzner hosts), so the next simplest way to check is check the sshable address. Existing installations that previously ran Address#populate_ipv4_addresses can be fixed using: DB[:ipv4_address].where(ip: Sshable.where(id: VmHost.select(:id)).select(Sequel.cast(:host, :inet))).delete
1.7 KiB
1.7 KiB