Open todaygood opened 6 years ago
该server是一个vmware虚拟机,
[root@mycentos7 ~]# free -m
total used free shared buff/cache available
Mem: 975 289 343 6 341 475
Swap: 2047 0 2047
修改内存大小从1G到2G
[root@mycentos7 ~]# free -m
total used free shared buff/cache available
Mem: 1999 310 1344 6 344 1584
Swap: 2047 0 2047
[root@mycentos7 ~]# docker run -it hello-world
docker: Error response from daemon: OCI runtime create failed: Could not access KVM kernel module: No s
uch file or directoryfailed to initialize KVM: No such file or directory: unknown.
[root@mycentos7 ~]# modprobe kvm
[root@mycentos7 ~]# modprobe kvm_intel
[root@mycentos7 ~]# docker run -it hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://cloud.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/
看来这个clearContainers使用qemu-kvm
[root@mycentos7 ~]# ps aux |grep kvm
root 614 0.0 0.0 0 0 ? S< 10:51 0:00 [kvm-irqfd-clean]
root 12553 0.0 0.0 112668 976 pts/0 S+ 10:57 0:00 grep --color=auto kvm
[root@mycentos7 ~]# docker run -idt 196e0ce0c9fb bash
609816365e90770a99f47af38f9707e7258de74d79ded6275ce6ca1255b88c19
[root@mycentos7 ~]# ps aux |grep kvm
root 614 0.0 0.0 0 0 ? S< 10:51 0:00 [kvm-irqfd-clean]
root 12665 56.8 6.2 2361652 116044 ? Sl 10:58 0:05 /usr/local/bin/qemu-system-x86_64 -na
me pod-609816365e90770a99f47af38f9707e7258de74d79ded6275ce6ca1255b88c19 -uuid e358cad7-c3f4-4abe-aaad-f06417070b5c -machine pc,accel=kvm,kernel_irqchip,nvdimm -cpu host,pmu=off -qmp unix:/run/virtcontainers/pods/609816365e90770a99f47af38f9707e7258de74d79ded6275ce6ca1255b88c19/mon-e358cad7-c3f4,server,nowait -qmp unix:/run/virtcontainers/pods/609816365e90770a99f47af38f9707e7258de74d79ded6275ce6ca1255b88c19/ctl-e358cad7-c3f4,server,nowait -m 2048M,slots=2,maxmem=2846M -device virtio-serial-pci,disable-modern=true,id=serial0 -device virtconsole,chardev=charconsole0,id=console0 -chardev socket,id=charconsole0,path=/run/virtcontainers/pods/609816365e90770a99f47af38f9707e7258de74d79ded6275ce6ca1255b88c19/console.sock,server,nowait -device nvdimm,id=nv0,memdev=mem0 -object memory-backend-file,id=mem0,mem-path=/usr/share/clear-containers/cc-20640-agent-4186b0.img,size=134217728 -device pci-bridge,bus=pci.0,id=pci-bridge-0,chassis_nr=1,shpc=on -device virtserialport,chardev=charch0,id=channel0,name=sh.hyper.channel.0 -chardev socket,id=charch0,path=/run/virtcontainers/pods/609816365e90770a99f47af38f9707e7258de74d79ded6275ce6ca1255b88c19/hyper.sock,server,nowait -device virtserialport,chardev=charch1,id=channel1,name=sh.hyper.channel.1 -chardev socket,id=charch1,path=/run/virtcontainers/pods/609816365e90770a99f47af38f9707e7258de74d79ded6275ce6ca1255b88c19/tty.sock,server,nowait -device virtio-9p-pci,disable-modern=true,fsdev=extra-9p-hyperShared,mount_tag=hyperShared -fsdev local,id=extra-9p-hyperShared,path=/run/hyper/shared/pods/609816365e90770a99f47af38f9707e7258de74d79ded6275ce6ca1255b88c19,security_model=none -netdev tap,id=network-0,vhost=on,vhostfds=3:4:5:6:7:8:9:10,fds=11:12:13:14:15:16:17:18 -device driver=virtio-net-pci,netdev=network-0,mac=02:42:ac:11:00:02,disable-modern=true,mq=on,vectors=18 -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=discard -vga none -no-user-config -nodefaults -nographic -daemonize -kernel /usr/share/clear-containers/vmlinuz-4.9.60-84.1.container -append root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro rw rootfstype=ext4 tsc=reliable no_timer_check rcupdate.rcu_expedited=1 i8042.direct=1 i8042.dumbkbd=1 i8042.nopnp=1 i8042.noaux=1 noreplace-smp reboot=k panic=1 console=hvc0 console=hvc1 initcall_debug iommu=off cryptomgr.notests net.ifnames=0 pci=lastbus=0 quiet systemd.show_status=false init=/usr/lib/systemd/systemd systemd.unit=clear-containers.target systemd.mask=systemd-networkd.service systemd.mask=systemd-networkd.socket ip=::::::609816365e90770a99f47af38f9707e7258de74d79ded6275ce6ca1255b88c19::off:: -smp 1,cores=1,threads=1,sockets=1
root 12678 0.0 0.0 0 0 ? S 10:58 0:00 [kvm-pit/12665]
root 12715 0.0 0.0 112668 976 pts/0 R+ 10:58 0:00 grep --color=auto kvm
[root@mycentos7 ~]# cc-runtime --version
cc-runtime : 3.0.18
commit : ee89afd
OCI specs: 1.0.1
[root@mycentos7 609816365e90770a99f47af38f9707e7258de74d79ded6275ce6ca1255b88c19]# ls
609816365e90770a99f47af38f9707e7258de74d79ded6275ce6ca1255b88c19 hyper.sock network.json
agent.json hypervisor.json proxy.sock
console.sock lock state.json
ctl-e358cad7-c3f4 mon-e358cad7-c3f4 tty.sock
[root@mycentos7 609816365e90770a99f47af38f9707e7258de74d79ded6275ce6ca1255b88c19]# pwd
/run/virtcontainers/pods/609816365e90770a99f47af38f9707e7258de74d79ded6275ce6ca1255b88c19
试用clearContainer
参见Clear Container installation on Centos7
Case 运行失败