[CRIU] [PATCH 6/6] p.haul: implement iterative disks migration for vz module

Nikita Spiridonov nspiridonov at odin.com
Mon Oct 12 10:32:21 PDT 2015


Implement iterative disks migration for Virtuozzo containers
using libploop python module (python bindings for ploop).

At the present moment use default private path from global config
on destination side as migrated ploop disposition, it
will be fixed in upcoming commits.

Signed-off-by: Nikita Spiridonov <nspiridonov at odin.com>
---
 phaul/p_haul_vz.py |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/phaul/p_haul_vz.py b/phaul/p_haul_vz.py
index a781bd5..e159221 100644
--- a/phaul/p_haul_vz.py
+++ b/phaul/p_haul_vz.py
@@ -10,7 +10,7 @@ import p_haul_cgroup
 import p_haul_module
 import util
 import fs_haul_shared
-import fs_haul_subtree
+import fs_haul_ploop
 import pycriu.rpc
 
 vz_global_conf = "/etc/vz/vz.conf"
@@ -217,13 +217,22 @@ class p_haul_type:
 		if rootfs == "nfs":
 			return fs_haul_shared.p_haul_fs()
 		if rootfs == "ext3" or rootfs == "ext4":
-			return fs_haul_subtree.p_haul_fs(self._ct_priv)
+			ddxml_path = os.path.join(self._ct_priv, "root.hdd",
+				"DiskDescriptor.xml")
+			return fs_haul_ploop.p_haul_fs(ddxml_path, fs_sk)
 
 		logging.info("Unknown CT FS")
 		return None
 
 	def get_fs_receiver(self, fs_sk=None):
-		return None
+		# Grab default private path from global config
+		with open(vz_global_conf) as ifd:
+			global_config = parse_vz_config(ifd.read())
+		default_private = expand_veid_var(global_config["VE_PRIVATE"],
+			self._ctid)
+		# Create receiver
+		fname_path = os.path.join(default_private, "root.hdd", "root.hds")
+		return fs_haul_ploop.p_haul_fs_receiver(fname_path, fs_sk)
 
 	def restored(self, pid):
 		self.__apply_cg_config()
-- 
1.7.1



More information about the CRIU mailing list