Intel Clear Containers

2015-05-20 14:04:48 +08:00
 efi

与内核紧耦合的透明虚拟机。

启动速度150毫秒菊快无比。

安全性完爆Docker。

试用:

$ sh boot-cow.sh
  # lkvm run -k ./vmlinux.container -m 1024 -c 6 --name guest-28299
  Warning: ./vmlinux.container is not a bzImage. Trying to load it as a flat binary...
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 4.0.0-16.container (mockbuild@kojibuild03) (gcc version 4.9.2 (Clear Linux Software for Intel Architecture) ) #1 SMP Tue May 12 17:20:44 UTC 2015
[    0.000000] Command line: noapic noacpi pci=conf1 reboot=k panic=1 i8042.direct=1 i8042.dumbkbd=1 i8042.nopnp=1 console=ttyS0 earlyprintk=serial i8042.noaux=1 rw tsc=reliable no_timer_check noreplace-smp  root=/dev/plkvm0p3  init=/usr/lib/systemd/systemd initcall_debug rootfstype=ext4 rootflags=dax,data=ordered dhcp rcupdate.rcu_expedited=1 console=hvc0 quiet dhcp
[    0.000000] KERNEL supported cpus:
[    0.000000]   Intel GenuineIntel
[    0.000000] e820: BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[    0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000ffffe] reserved
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000003fffffff] usable
[    0.000000] bootconsole [earlyser0] enabled
Check discovery
Discovery
Check discovery
Check response
Response

Clear Linux Software for Intel Architecture clr hvc0
clr login:

实现原理见 http://lwn.net/SubscriberLink/644675/5be656c24083e53b/

主页 https://clearlinux.org/ Clear Linux是Intel结合OpenStack搞得一些虚拟化花样。核心就是kvmtool,几个内核patch,和malloc_trim()。

6411 次点击
所在节点    Linux
32 条回复
pH
2015-05-20 14:53:47 +08:00
0=0 好高端,表示基本上没看的懂的
Kabie
2015-05-20 15:10:18 +08:00
囧……早上没仔细看。。。还以为是类似CoreOS那样的发行版而已。。。
liwei
2015-05-20 15:31:31 +08:00
你订阅了LWN?为啥通过这个URL就可以访问需要订阅的内容?
jiang42
2015-05-20 16:36:55 +08:00
@efi 弃用QEMU是指原来clear Linux用的QEMU吧?我印象里Docker用的是Linux Namespaces和Linux CGroup
est
2015-05-20 16:44:48 +08:00
http://erlangonxen.org/ 这帮人已经做到一个请求一个操作系统实例了。

1秒钟之内,新分配一个Xen操作系统实例,载入web代码进程,执行,返回结果,销毁OS实例。
zhicheng
2015-05-20 18:37:22 +08:00
@est 技术的倒退。
immjun
2015-05-20 20:00:20 +08:00
关注一下~
yuelang85
2015-05-20 20:12:39 +08:00
弃用QEMU,转kvmtool省略无用虚拟硬件,省略BIOS层,直接mmap内核镜像

好妖的做法。。。。
efi
2015-05-20 23:09:44 +08:00
@est 既没用过erlang也没用过xen,太偏门了,kvm加普通distro应该是非常好用的玩具。

麻痹的,我发个state of the art无人能应,看来v2ex的水平限于“linux下使用cp指令遇到问题”
est
2015-05-20 23:50:30 +08:00
@efi 挖坑失败,打回重挖。。。。。。。。。。。。。自动挖坑机器人算法有缺陷。
est
2015-05-20 23:52:52 +08:00
@zhicheng 你说对了。倒退到mainframe的时间分片系统去了。这是云计算的大趋势。。。。
zhuang
2015-05-21 01:05:19 +08:00
@efi 你自己还挂着 trolling is art 呢,别沉不住气啊,说得多的多数是水。其实 est 那个回复看上去像是 troll,反倒本身是回复里唯一看到本质的,就是个虚拟化的粒度问题。

不过 Intel 家的东西吧,多数逃不过展品的命运,虽然背后的技术可能之后会通用化。

qemu free 倒是不新鲜,我记得几年前就有了,可能当初 intel 做这个的时候没往这方面想。现在 container 取代 vm 不就是因为性能好么,既然目标都是 linux,就犯不着虚拟个 pc 平台出来了,砍了 qemu 之后性能就不是问题了。

内存方面的技术不太懂,不过 intel cpu 集成内存控制器的,这方面优势应该挺大。至于外部 io,存储和网络的,我觉得取决于应用场景,安全性和性能不能兼得,是个取舍问题。
twl007
2015-05-21 01:15:44 +08:00
这东西跟docker有本质不同吧 docker建立在linux自身之上 调用Linux的功能来实现自己的功能 而这个就是一个轻量虚拟机 看了看介绍用了很多新的技术 然后自己实现的native kvm tools相比qemu还有功能缺失 没有图形化支持 不支持网络以及SMP

外加DAX是设计给NVM的 他靠模拟来实现我很怀疑最终能有多少提升 而且只支持在4.0内核

这个东西怎么看都是一个轻量虚拟机 跟docker完全是不同的技术实现 虚拟机的安全性再比docker低就不用活了 因为docker构建于linux上才导致现在没法完全隔离的
efi
2015-05-21 01:23:37 +08:00
@zhuang 偶尔发个干货来检验一下水平,大失所望

本质不是粒度,是现在钱多了,要虚拟化一切,什么微内核外内核单内核万内核复古朋克都出来了

我用过的Intel产品就有Wayland,MESA,DRM,Beignet/OpenCL,TianoCore/UEFI,Powertop这些是。没用过的不列。
efi
2015-05-21 01:29:56 +08:00
@twl007
> 自己实现的native kvm tools相比qemu还有功能缺失 没有图形化支持 不支持网络以及SMP
> 他靠模拟来实现我很怀疑最终能有多少提升
> 虚拟机的安全性再比docker低就不用活了
您RTFA了吗
twl007
2015-05-21 01:46:25 +08:00
@efi http://lwn.net/Articles/438182/

The native tool is able to boot a kernel which can talk over a serial console. It lacks graphics support, networking, SMP support, and much more, but it can get to a login prompt when run inside a terminal emulator.
twl007
2015-05-21 01:48:43 +08:00
@twl007 然后底下更新的是靠着kvm virtio实现的网络 换句话说它本身还是不支持
twl007
2015-05-21 01:50:53 +08:00
@efi http://lwn.net/Articles/610174/

DAX was originally designed for fast flash-like storage that shows up as memory to the CPU; but in a virtual-machine environment, this type of storage is easy to emulate. All we need to do on the host is map the disk image file into the guest's physical memory, and use a small device driver in the guest kernel that exposes this memory region to the kernel as a DAX-ready block device.

Do not they emulate the DAX?
Andiry
2015-05-21 02:08:23 +08:00
这里用DAX只是少了一次memcpy而已,底下还是disk file的mmap。性能上不能跟真正基于NVM的DAX比。
efi
2015-05-21 02:29:13 +08:00
@twl007
> http://lwn.net/Articles/438182/
April 12, 2011

你是没用过就开始胡扯吧。知道kvmtool代码放哪的吗?

> map the disk image file into the guest's physical memory, and use a small device driver in the guest kernel that exposes this memory region to the kernel as a DAX-ready block device
理解这句话吗?这个实现是要提升什么性能?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/192451

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX