dyweb / papers-notebook

:page_facing_up: :cn: :page_with_curl: 论文阅读笔记(分布式系统、虚拟化、机器学习)Papers Notebook (Distributed System, Virtualization, Machine Learning)
https://github.com/dyweb/papers-notebook/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+-label%3ATODO-%E6%9C%AA%E8%AF%BB
Apache License 2.0
2.12k stars 244 forks source link

VMSH: hypervisor-agnostic guest overlays for VMs #290

Open gaocegege opened 2 years ago

gaocegege commented 2 years ago

https://github.com/Mic92/vmsh

https://dl.acm.org/doi/abs/10.1145/3492321.3519589

EuroSys'22

Shell into a virtualized Linux, with your own tools

gaocegege commented 2 years ago

这篇文章的核心观察是传统的 VM 提供了非常多的能力,但是为了部署方便,快速启停,现在业界的 FaaS 等都在追求 Lightweight VM。

但是轻量级 VM 都存在一个问题,就是缺少一些功能,这些功能可能在部署时不需要,但是在调试和开发的时候是需要的。这个时候你需要通过 ssh,配置 key 等等,最后到 VM 中操作。非常复杂。而如果是 docker 的话,就可以通过 docker exec 直接 attach 进去操作。

因此这个工作就是解决这样一个问题。为 attach & debug inside vm 提供更好的体验

To this end, we ask the following research question: Can lightweight VMs be extended with external functionality on demand and non-disruptively?

To address this problem, we propose VMSH, which provides an abstraction for accessing KVM-based VMs for tasks such as inspection, debugging, or modification. VMSH enables users to add functionality to VMs non-disruptively and connect to newly attached programs via a console

gaocegege commented 2 years ago

文章的贡献主要是三点:

gaocegege commented 2 years ago

VMSH 跟 KVM,VirtIO 有很大相关性。KVM 是硬件辅助的虚拟化的标准抽象了,而且已经合并在内核中。使用 KVM 的接口和能力实现的 Hypervisor 包括 QEMU,firecracker,crosvm 等。VMSH 支持这些 KVM-based Hypervisor。

VirtIO 定义了一套通用的接口,来在 VM 中模拟硬件设备,如网卡,硬盘等。VirtIO 通过共享内存的方式,在 Hypervisor 管理下的 device 以及装在 Guest 中的 driver 之间交换数据。VirtIO 有两种机制,memory mapped IO (MMIO) or on the PCI standard,VMSH 实现了前者,它在 MicroVM 里更常用。

gaocegege commented 2 years ago

VMSH 的典型使用场景:

gaocegege commented 2 years ago

image

gaocegege commented 2 years ago

在设计上,VMSH 需要在 Host 上启动一个进程,跟 Hypervisor 相当于是在相同级别。它会 attach 到 Hypervisor 中,并且基于 Guest Kernel 启动一个 file system overlay 在 kernel 上的容器,这个容器的进程都跑在 user space。