Запуск через команду run
by
Petr Fedchenkov
—
last modified
Dec 27, 2019 03:29 PM
Для rootfs, полученного при выполнении https://github.com/hyperhq/runv/blob/master/tests/go-integration/test_data/Makefile
Работает запуск через run (нестабильно)
root@xenrunv:/containerbundle# runv --debug --log_dir log run --bundle /containerbundle/busybox/ test got child pid: 6474 check whether child proc is created by libxl: 0 got child pid: 0 / # uname -a Linux shell 4.12.4-hyper+ #1 SMP Thu Jul 19 11:23:27 CST 2018 x86_64 GNU/Linux / #
Работает запуск процесса дополнительного (нестабильно)
root@xenrunv:/containerbundle# runv --debug --log_dir ../log exec test echo hello hello root@xenrunv:/containerbundle# runv --debug --log_dir ../log exec -t test sh / # echo hello hello / #
Работает отображение запущенных процессов:
root@xenrunv:~/go/src/github.com/hyperhq/runv# runv ps test PID CMD 6643 sh 6730 sh
При создании (через create) не удаётся взаимодействовать:
root@xenrunv:/containerbundle/busybox/rootfs# runv --debug --log_dir log create --bundle /containerbundle/busybox/ test I1227 15:24:31.823638 11069 sandbox.go:29] Using kernel: /var/lib/hyper/kernel; Initrd: /var/lib/hyper/hyper-initrd.img; bios: ; cbfs: ; I1227 15:24:32.490195 11069 xen.go:93] got SIGCHLD, send msg to libxl got child pid: 11080 check whether child proc is created by libxl: 0 I1227 15:24:32.517457 11069 xen.go:169] Start VM as domain 34 I1227 15:24:32.517740 11069 sandbox.go:229] newHyperstart() on socket: /var/run/hyper/vm-rikwpYYiun/kata-agent.sock I1227 15:24:32.517818 11069 sandbox.go:231] grpcSock stat: , err: &os.PathError{Op:"stat", Path:"/var/run/hyper/vm-rikwpYYiun/kata-agent.sock", Err:0x2} I1227 15:24:32.518483 11069 proxy.go:127] start proxy with argument: [runv --root /run/runv --debug --log_dir log proxy --vmid vm-rikwpYYiun --proxy-hyperstart /var/run/hyper/vm-rikwpYYiun/kata-agent.sock --hyperstart-ctl-sock unix:///var/run/hyper/vm-rikwpYYiun/hyper.sock --hyperstart-stream-sock unix:///var/run/hyper/vm-rikwpYYiun/tty.sock] I1227 15:24:32.520659 11069 proxy.go:133] createProxy succeeded with proxy pid: 11086 I1227 15:24:32.583518 11069 vm.go:568] VM[vm-rikwpYYiun] GetVm succeeded I1227 15:24:32.584936 11069 watcher.go:93] start watcher with argument: [runv --root /run/runv --debug --log_dir log watcher --watch-vm-console /var/run/hyper/vm-rikwpYYiun/console.sock --console-proto telnet --watch-hyperstart --watch-vm] I1227 15:24:32.588042 11069 watcher.go:99] createWatcher succeeded with watcher pid: 11096 I1227 15:24:32.588148 11069 vm_states.go:158] SB[vm-rikwpYYiun] startPod: sharetag:share_dir, &api.SandboxConfig{Hostname:"shell", Dns:[]string(nil), Neighbors:(*api.NeighborNetworks)(nil), DnsOptions:[]string(nil), DnsSearch:[]string(nil)} I1227 15:24:41.884847 11069 vm_states.go:161] SB[vm-rikwpYYiun] pod start successfully I1227 15:24:41.884940 11069 sandbox.go:110] vm-rikwpYYiun init sandbox successfully I1227 15:24:41.889183 11069 container.go:76] vm.AddContainer() I1227 15:24:41.889378 11069 container.go:216] SB[vm-rikwpYYiun] Con[test] all images and volume resources have been added to sandbox I1227 15:24:41.889432 11069 vm_states.go:30] SB[vm-rikwpYYiun] start sending create container I1227 15:24:41.891338 11069 vm_states.go:33] SB[vm-rikwpYYiun] sent create container I1227 15:24:41.891541 11069 shim.go:226] starting shim with args runv --root /run/runv --log_dir log/shim-test --debug shim --container test --process init --proxy-stdio --proxy-exit-code --proxy-signal --proxy-winsize I1227 15:24:41.978418 11069 container.go:140] save state id test, boundle /containerbundle/busybox/ I1227 15:24:41.978810 11069 network.go:261] get exec path /usr/local/bin/runv I1227 15:24:42.016467 11069 network.go:110] interface configuration for sandbox ns is []main.InterfaceInfo{} I1227 15:24:42.017131 11069 network.go:314] nsListener pid is 11106 I1227 15:24:42.028835 11069 xen.go:93] got SIGCHLD, send msg to libxl got child pid: 0 I1227 15:24:42.029878 11069 hypervisor.go:22] SB[vm-rikwpYYiun] main event loop got message 9(COMMAND_RELEASE) I1227 15:24:42.029922 11069 vm_states.go:214] SB[vm-rikwpYYiun] pod is running, got release command, let VM fly I1227 15:24:42.029954 11069 context.go:216] SB[vm-rikwpYYiun] state change from RUNNING to 'NONE' I1227 15:24:42.029987 11069 hypervisor.go:30] SB[vm-rikwpYYiun] main event loop exiting root@xenrunv:/containerbundle/busybox/rootfs# runv list ID PID STATUS BUNDLE CREATED OWNER test 11105 created /containerbundle/busybox/ 1970-01-01T00:00:00Z root root@xenrunv:/containerbundle/busybox/rootfs# xl list Name ID Mem VCPUs State Time(s) Domain-0 0 2048 6 r----- 954.6 vm-rikwpYYiun 34 127 1 -b---- 1.8 root@xenrunv:/containerbundle/busybox/rootfs# runv --debug exec -t test sh