This repository hosts the code for the conntrack-migrator process.
As of today, QEMU does not migrate any connection tracking entries for the VM. With the introduction of dbus-vmstate backend in QEMU, it enables any external helper process to sync data with respect to the VM across hypervisor during VM migration. The conntrack migrator process thus acts as a helper process to QEMU to migrate VM connection tracking entries.
- On the source host, conntrack-migrator process reads the conntrack entries for the VM’s IP address and transfer them to QEMU via D-Bus. Also, post migration cleanup of these migrated conntrack entries is performed.
- On the destination host, read the data from QEMU via D-Bus and program the entries in the kernel conntrack table.
.
+-- .
| +-- include
| +-- src
| +-- tests
| +-- build (auto-generated by make)
| +-- gen (auto-generated by make)
Following libraries are required and can be easily installed using yum.
- libnetfilter_conntrack, libnetfilter_conntrack-devel
- libmnl, libmnl-devel
- glib2, glib2-devel
- gcc, make, gdbus-codegen
To compile the conntrack-migrator source:
foo@bar:~$ make all
This will create the conntrack-migrator binary in the build folder.
On the source hypervisor (SAVE MODE):
foo@bar:~$ DBUS_SYSTEM_BUS_ADDRESS=<dbus address> conntrack_migrator 2 <helper-id> <num of ip address> <space separated list of ip addresses>
foo@bar:~$ DBUS_SYSTEM_BUS_ADDRESS=unix:path=/run/system_dbus_socket conntrack_migrator 2 id1 2 1.1.1.1 2.2.2.2
On the destination hypervisor (LOAD MODE):
foo@bar:~$ DBUS_SYSTEM_BUS_ADDRESS=<dbus address> conntrack_migrator 1 <helper-id>
foo@bar:~$ DBUS_SYSTEM_BUS_ADDRESS=unix:path=/run/system_dbus_socket conntrack_migrator 2 id1
Check unit testing framework(https://libcheck.github.io/check/) is used for running the unit test.
Before starting the UTs, make sure check is installed using:
foo@bar:~$ yum install check
foo@bar:~$ make check
foo@bar:~$ make clean_secondary # cleans up the stale tests (optional)
foo@bar:~$ make build/tests/runner/<test-name>.out
For eg:
foo@bar:~$ make build/tests/runner/test_common.out
Following features are not yet supported:
- Conntrack entries having IPv6 information will not be migrated.
- Conntrack entries having zone information will not be migrated since there is no guarantee that on the destination the same zone will be allocated for the VM.
Copyright 2021, Nutanix, Inc.
Conntrack-Migrator v.1.0 is dual licensed under the BSD 3 Clause License or the GNU General Public License version 2.
See LICENSE file for detailed terms and conditions.