[libvirt] [PATCH v2 18/18] LXC: added some doc on domxml-from-native with mention of limitations

Cédric Bosdonnat cbosdonnat at suse.com
Thu Jan 30 09:56:06 UTC 2014

 docs/drvlxc.html.in | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/docs/drvlxc.html.in b/docs/drvlxc.html.in
index 0f3efb0..7f73084 100644
--- a/docs/drvlxc.html.in
+++ b/docs/drvlxc.html.in
@@ -555,7 +555,7 @@ and LXC. For further details about usage of virsh consult its
 manual page.
-<h3><a name="usageSave">Defining (saving) container configuration></a></h3>
+<h3><a name="usageSave">Defining (saving) container configuration</a></h3>
 The <code>virsh define</code> command takes an XML configuration
@@ -702,5 +702,37 @@ host
 # virt-top -c lxc:///
+<h3><a name="usageConvert">Converting LXC container configuration</a></h3>
+The <code>virsh domxml-from-native</code> command can be used to convert
+most of the LXC container configuration into a domain XML fragment
+# virsh -c lxc:/// domxml-from-native lxc /var/lib/lxc/myguest/config
+This conversion has some limitations due to the fact that the
+domxml-from-native command output has to be independent of the host. Here
+are a few things to take care of before converting:
+Replace the fstab file referenced by <tt>lxc.mount</tt> by the corresponding
+lxc.mount.entry lines.
+Replace all relative sizes of tmpfs mount entries to absolute sizes. Also
+make sure that tmpfs entries all have a size option (default is 50%).
+Define <tt>lxc.cgroup.memory.limit_in_bytes</tt> to properly limit the memory
+available to the container. The conversion will use 64MiB as the default.

More information about the libvir-list mailing list