Changes

Jump to navigation Jump to search
116 bytes added ,  19:20, 21 September 2016
m
Line 6: Line 6:     
LXC upstream has begun to integrate checkpoint/restore support through the lxc-checkpoint tool. This functionality has been in the recent released version of LXC---LXC 1.1.0 , you can install the LXC 1.1.0 or you can check out the development version on Ubuntu by doing:  
 
LXC upstream has begun to integrate checkpoint/restore support through the lxc-checkpoint tool. This functionality has been in the recent released version of LXC---LXC 1.1.0 , you can install the LXC 1.1.0 or you can check out the development version on Ubuntu by doing:  
<pre>
+
<source lang="bash">
 
sudo add-apt-repository ppa:ubuntu-lxc/daily
 
sudo add-apt-repository ppa:ubuntu-lxc/daily
 
sudo apt-get update
 
sudo apt-get update
 
sudo apt-get install lxc
 
sudo apt-get install lxc
</pre>
+
</source>
    
Next, create a container:
 
Next, create a container:
   −
<pre>
+
<source lang="bash">
sudo lxc-create -t ubuntu -n u1 -- -r trusty -a amd64
+
sudo lxc-create -t ubuntu -n u1 -- -r trusty -a amd64
</pre>
+
</source>
    
And add the following lines (as above) to its config:
 
And add the following lines (as above) to its config:
   −
<pre>
+
<source lang="bash">
 
cat | sudo tee -a /var/lib/lxc/u1/config << EOF
 
cat | sudo tee -a /var/lib/lxc/u1/config << EOF
 
# hax for criu
 
# hax for criu
Line 27: Line 27:  
lxc.cgroup.devices.deny = c 5:1 rwm
 
lxc.cgroup.devices.deny = c 5:1 rwm
 
EOF
 
EOF
</pre>
+
</source>
    
Finally, start, and checkpoint the container:
 
Finally, start, and checkpoint the container:
   −
<pre>
+
<source lang="bash">
 
sudo lxc-start -n u1
 
sudo lxc-start -n u1
 
sleep 5s  # let the container get to a more interesting state
 
sleep 5s  # let the container get to a more interesting state
 
sudo lxc-checkpoint -s -D /tmp/checkpoint -n u1
 
sudo lxc-checkpoint -s -D /tmp/checkpoint -n u1
</pre>
+
</source>
    
At this point, the container's state is stored in /tmp/checkpoint, and the filesystem is in /var/lib/lxc/u1/rootfs. You can restore the container by doing:
 
At this point, the container's state is stored in /tmp/checkpoint, and the filesystem is in /var/lib/lxc/u1/rootfs. You can restore the container by doing:
   −
<pre>
+
<source lang="bash">
 
sudo lxc-checkpoint -r -D /tmp/checkpoint -n u1
 
sudo lxc-checkpoint -r -D /tmp/checkpoint -n u1
</pre>
+
</source>
    
And then, get your container's IP and ssh in:
 
And then, get your container's IP and ssh in:
   −
<pre>
+
<source lang="bash">
 
ssh ubuntu@$(sudo lxc-info -i -H -n u1)
 
ssh ubuntu@$(sudo lxc-info -i -H -n u1)
</pre>
+
</source>
   −
===Troubleshooting===
+
== Troubleshooting ==
 
   
 
   
 
=== Error (mount.c:805): fusectl isn't empty: 8388625 ===
 
=== Error (mount.c:805): fusectl isn't empty: 8388625 ===
Line 59: Line 59:  
CRIU doesn't yet support shared mountpoints as LXC does; make sure your rootfs is on a non-shared mount.
 
CRIU doesn't yet support shared mountpoints as LXC does; make sure your rootfs is on a non-shared mount.
   −
== See also ==
+
== External links ==
   −
* [https://www.youtube.com/watch?v=a9T2gcnQg2k&feature=youtu.be&t=18m8s The New New Thing: Turning Docker Tech into a Full Speed Hypervisor] - Talk of Tycho Andersen with demo of migration LXC container with Doom inside. [https://github.com/tych0/presentations/blob/master/ods2014.md Demo script]
+
* [https://www.youtube.com/watch?v=a9T2gcnQg2k&feature=youtu.be&t=18m8s The New New Thing: Turning Docker Tech into a Full Speed Hypervisor] - Talk of Tycho Andersen with demo of migration LXC container with Doom inside
 +
* [https://github.com/tych0/presentations/blob/master/ods2014.md Demo script]
    
[[Category: HOWTO]]
 
[[Category: HOWTO]]
 
[[Category: Live migration]]
 
[[Category: Live migration]]

Navigation menu