-
Notifications
You must be signed in to change notification settings - Fork 16
Allow restore network to have network connectivity #15
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
Allow restore network to have network connectivity #15
Conversation
Methods for checkpointing and restoring containers were added to the native driver. The LXC driver returns an error message that these methods are not implemented yet. Signed-off-by: Saied Kazemi <saied@google.com> Conflicts: daemon/execdriver/native/create.go daemon/execdriver/native/driver.go daemon/execdriver/native/init.go
Docker-DCO-1.1-Signed-off-by: Ross Boucher <rboucher@gmail.com> (github: boucher)
Support was added to the daemon to use the Checkpoint and Restore methods of the native exec driver for checkpointing and restoring containers. Signed-off-by: Saied Kazemi <saied@google.com> Conflicts: api/server/server.go daemon/container.go daemon/daemon.go daemon/networkdriver/bridge/driver.go daemon/state.go vendor/src/github.com/docker/libnetwork/ipallocator/allocator.go
Restore failed if network resource not released during checkpoint, e.g., a container with port open with -p Signed-off-by: Hui Kang <hkang.sunysb@gmail.com> Conflicts: daemon/container.go
Docker-DCO-1.1-Signed-off-by: Ross Boucher <rboucher@gmail.com> (github: boucher)
Add a basic test for checkpoint/restore to the integration tests Docker-DCO-1.1-Signed-off-by: Ross Boucher <rboucher@gmail.com> (github: boucher)
Docker-DCO-1.1-Signed-off-by: Ross Boucher <rboucher@gmail.com> (github: boucher)
Docker-DCO-1.1-Signed-off-by: Ross Boucher <rboucher@gmail.com> (github: boucher)
Docker-DCO-1.1-Signed-off-by: Ross Boucher <rboucher@gmail.com> (github: boucher)
Docker-DCO-1.1-Signed-off-by: Ross Boucher <rboucher@gmail.com> (github: boucher)
Docker-DCO-1.1-Signed-off-by: Mark Oates fl0yd@me.com (github: fl0yd)
Docker-DCO-1.1-Signed-off-by: Ross Boucher <rboucher@gmail.com> (github: boucher)
Reuse the endpoint of the checkpointed container when restore. Pass veth pair name to ciur when restore a checkpointed container. Signed-off-by: Hui Kang <hkang.sunysb@gmail.com>
|
@boucher @SaiedKazemi The solution is not perfect, but the restored network can ping "8.8.8.8". |
|
Awesome, I'll try it out in a couple of hours and report back. On Wednesday, August 19, 2015, huikang notifications@github.com wrote:
Sent from Gmail Mobile |
|
The good news is that I'm able to use the network after checkpointing and restoring with this patch! The bad news is that we're going to need to split it into 3 separate patches: one for runc, one for libnetwork, and one for docker (plus, we need to wait for the first two patches to be merged, and then upstreamed in docker, in order to use the third). |
|
@boucher Good to know it works for you. I will split the patch and try pushing them to runc and libnetwork. |
|
Excellent. Let me know if I can help. On Wednesday, August 19, 2015, huikang notifications@github.com wrote:
Sent from Gmail Mobile |
|
Hi guys! I also tested @huikang's version on a couple of my containers.. I was able to C/R successfully a tomcat container on the same host and then I was able to connect to it. I also noticed two problems...
As I noticed, when you are restoring the same container, it keeps its old IP and you can restore successfully, but when you 're restoring to a "fresh" one you've got a new IP. Maybe, this is the problem??.. Thanks |
|
What's interesting is that this has a ReleaseNetwork(true). If you do that, the tcp connection restore on your fixed 1.9 for libnetwork, tcp connectivity is lost. However if you leave it as () then you get a compilation error. Mark
|
|
@fl0yd |
|
Understood. I'm pointing out that I think the 2 patches are going to need to be modified slightly to not be in conflict due to req'd parameters. Mark
|
|
@klesgidis |
|
No, I don't think it will. You modified daemon/container_unix.go presumably you did that for a reason and want to keep that inclusion. |
|
@boucher Not at all. Please go ahead and submit them. Thanks. |
|
@fl0yd After I put The restore completes but I cannot connect from the browser.. Did you run the similar commands or can you see any stupid mistake? :P Thanks.. |
|
@klesgidis how are you trying to connect? One (unfortunate) thing to note is that the restore will force the new container's IP address to be the same as the old container. You may need to either go in and change its IP, or do some other magic, to make things actually connectable. |
|
I am trying to connect with |
|
Yes. It's worse though: docker thinks the IP is the new IP, and inside the container it will be set to the old IP. So, what I do is use the new IP and docker exec into the container to set its IP to the new IP. |
|
Yes.. I tried this solution with the previous version of docker (without the network fix), but it didn't work. I 'll give a try in a couple of hours ( i am not home right now :p) with the new one and I 'll inform you. Thanks, I apreciate your help.. :) |
|
@boucher , I was able to Restore and to reconnect to a surrogate tomcat and a mysql container using the old IP. I confirm what you said. Docker thinks that the new container has a new IP, but I was still able to connect to the old one. Connecting from browser to Cannot connect from browser to |
|
@klesgidis Semantically checkpoint/restore is different than stop/start. The regular stop/start will change the IP, while checkpoint/restore should not. However, the current C/R implementation has the limitation of adding new NAT for a new IP, which actually should not happen. |
|
Closed this PR because I rebased the changed on the recent cr-combined branch #17 |
Reuse the endpoint of the checkpointed container when restore.
Pass veth pair name to ciur when restore a checkpointed container.
Signed-off-by: Hui Kang hkang.sunysb@gmail.com