NEmu

Network Emulator for Mobile Universes

Documentation - Virtual Nodes Live Migration

It is possible to perform a live migration (i.e. the VNode can be started and can make some operations during the migration) of a VNode from one session to another. In order to perform this action, the VNode should have the exact same configuration on both sessions. Considering the hard drives, there are two cases :

  1. The same disk image is used by the two sessions. Therefore, it is suitable to use a copy-on-write of this image (c.f. VFs documentation) on both sessions. Consequently, you can perform an incremental migration which is the fastest way to perform the live migration.
  2. The original disk image is not available on the destination session. Therefore, you have to assume that the size of the disk image of the VNode in the destination session is sufficient. Consequently, you can only perform a full migration which is slower compared to the first strategy.

MigrateVNode(name, addr, port, incremental, speed)

This function peforms a live migration of a VNode living on a session to another VNode belonging to another session. The destination session is hosted at the addr IP address. This other VNode is waiting for the incoming migration on the TCP port port. The incremental parameter should be setup to True only if you are with a configuration compliant to the first case. Finally, the speed parameter indicates the maximum bandwidth that can be used by the live migration process (default: 1 Gbit/second).

Here is an incremental configuration example :

# Source Session [192.168.0.1]

VHost("alice", hds=[VFs('/var/img/debian.img', type='cow')
             , nics=[VNic(hw="0a:55:78:32:e5:7e")]
             , cpu='core2duo', m=1024, localtime=None)

MigrateVNode("alice", addr="192.168.0.2", port=4444, incremental=True)
# Destinantion Session [192.168.0.2]

VHost("alice", hds=[VFs('/var/img/debian.img', type='cow')
             , nics=[VNic(hw="0a:55:78:32:e5:7e")]
             , cpu='core2duo', m=1024, localtime=None
             , incoming="tcp:192.168.0.1:4444")

Here is a non-incremental configuration example :

# Source Session [192.168.0.1]

VHost("alice", hds=[VFs('/var/img/debian.img', type='cow')
             , nics=[VNic(hw="0a:55:78:32:e5:7e")]
             , cpu='core2duo', m=1024, localtime=None)

MigrateVNode("alice", addr="192.168.0.2", port=4444)
# Destinantion Session [192.168.0.2]

VHost("alice", hds=[EmptyFs('debian.img', size='2G', type='raw')]
             , nics=[VNic(hw="0a:55:78:32:e5:7e")]
             , cpu='core2duo', m=1024, localtime=None
             , incoming="tcp:192.168.0.1:4444")