为了节约存储空间和方便系统升级,将虚拟机镜像中的系统数据和用户数据分离存储是云计算中心内常见的做法。目前主流的使用方法是以系统镜像启动虚拟机,再将用户数据以磁盘形式挂载,但这种粗粒度的融合方式导致数据分离对用户可见,同时用户数据无法覆盖系统数据,系统缺乏灵活性。针对这些问题,通过分析系统镜像和用户镜像合并启动和使用的原理,提出了一种将多个镜像文件细粒度混合到运行时文件系统的方案,并借助于UnionFS文件系统工具,在KVM虚拟机环境下实现了多镜像在文件目录级别上的完全混合。实验结果表明,其实现了设计预期功能,同时对于KVM虚拟机开机启动时间和文件系统读写性能没有较明显的负面影响。
The separate storage of system data and user data in virtual machine images is common practice in cloud computing centers to save storage space and for easier system upgrading. The current mainstream method is to boot virtual machine with a system image and mount user data in the format of a disk. But this coarse-gained method results in separation of data visible to users,inability to override system data and lack of system flexibility. For these problems,this paper proposed a solution based on fine-grained data mixing from multiple image files into a run-time system through analyzing merging,booting and using virtual machine images. With the help of UnionFS,it designed and implemented a directory-level multiple image system on KVM. The experiment results show that this system fully realizes the desired functionality and has little impact on boot time and file system performance of KVM.