Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to migrate containers #2272

Merged
merged 9 commits into from
Jun 7, 2019

Commits on Jun 3, 2019

  1. Fix restore options help text and comments

    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    e0c8c14 View commit details
    Browse the repository at this point in the history
  2. Added helper functions for container migration

    This adds a couple of function in structure members needed in the next
    commit to make container migration actually work. This just splits of
    the function which are not modifying existing code.
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    a05cfd2 View commit details
    Browse the repository at this point in the history
  3. Added support to migrate containers

    This commit adds an option to the checkpoint command to export a
    checkpoint into a tar.gz file as well as importing a checkpoint tar.gz
    file during restore. With all checkpoint artifacts in one file it is
    possible to easily transfer a checkpoint and thus enabling container
    migration in Podman. With the following steps it is possible to migrate
    a running container from one system (source) to another (destination).
    
     Source system:
      * podman container checkpoint -l -e /tmp/checkpoint.tar.gz
      * scp /tmp/checkpoint.tar.gz destination:/tmp
    
     Destination system:
      * podman pull 'container-image-as-on-source-system'
      * podman container restore -i /tmp/checkpoint.tar.gz
    
    The exported tar.gz file contains the checkpoint image as created by
    CRIU and a few additional JSON files describing the state of the
    checkpointed container.
    
    Now the container is running on the destination system with the same
    state just as during checkpointing. If the container is kept running
    on the source system with the checkpoint flag '-R', the result will be
    that the same container is running on two different hosts.
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    0028578 View commit details
    Browse the repository at this point in the history
  4. Add test case for container migration

    The difference between container checkpoint/restore and container
    migration is that for migration the container which was checkpointed
    must not exist during restore. To simulate migration the container
    is remove ('podman rm -fa') before being restored. The migration test
    does following steps:
    
     * podman run
     * podman container checkpoint -l -e /tmp/checkpoint.tar.gz
     * podman rm -fa
     * podman container restore -i /tmp/checkpoint.tar.gz
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    2aa3261 View commit details
    Browse the repository at this point in the history
  5. Added bash completion for container migration

    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    7b1ab8a View commit details
    Browse the repository at this point in the history
  6. Add man-pages for container migration

    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    42e903d View commit details
    Browse the repository at this point in the history
  7. Include container migration into tutorial

    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    a4d3333 View commit details
    Browse the repository at this point in the history
  8. Also download container images during restore

    If restoring a container from a checkpoint it was necessary that the
    image the container is based was already available (podman pull).
    
    This commit adds the image download to podman container restore if it
    does not exist.
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    0e072f9 View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2019

  1. migration: add possibility to restore a container with a new name

    The option to restore a container from an external checkpoint archive
    (podman container restore -i /tmp/checkpoint.tar.gz) restores a
    container with the same name and same ID as id had before checkpointing.
    
    This commit adds the option '--name,-n' to 'podman container restore'.
    With this option the restored container gets the name specified after
    '--name,-n' and a new ID. This way it is possible to restore one
    container multiple times.
    
    If a container is restored with a new name Podman will not try to
    request the same IP address for the container as it had during
    checkpointing. This implicitly assumes that if a container is restored
    from a checkpoint archive with a different name, that it will be
    restored multiple times and restoring a container multiple times with
    the same IP address will fail as each IP address can only be used once.
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    bef83c4 View commit details
    Browse the repository at this point in the history