Closed Ddnirvana closed 8 years ago
Hi @Ddnirvana , what's the version of runV and hyperstart are you working on?
Hi @gnawux ,thanks for your replying! They are both 0.6.0 version.
Hello, Do you modify hyperstart or kernel yourself? Some outputs in logs are not consist with codes, such as
I0717 11:01:44.029241 7328 init_comm.go:68] [console] sigchld in hyper_init_sigchld
I0717 11:01:44.030862 7328 init_comm.go:68] [console] pod init enter infinite loop
@gao-feng sorry forget mention that, as I said I tried many efforts to fix this problem by myself. So to better understanding the codes I added some log print code in the hyperstart and runv. But I am very sure the results and other log Infos are totally the same as previous unmodified one.
@gao-feng I re-run the command runv --debug --kernel kernel --initrd hyper-initrd.img --driver=qemu start -b /mycontainer/ test
using unmodified version 0.6.0 hyperstart and runv and the log infos are:
I0718 10:02:38.195179 20539 vm.go:260] Get the response from VM, VM id is vm-jSdTQgbOCv!
I0718 10:02:38.195605 20539 init_comm.go:68] [console] channel sh.hyper.channel.1, directory sh.hyper.channel.0
I0718 10:02:38.195687 20539 init_comm.go:68] [console]
I0718 10:02:38.196077 20539 init_comm.go:68] [console] open hyper channel /dev/vport0p2
I0718 10:02:38.196217 20539 qmp_handler.go:103] got a message {"timestamp": {"seconds": 1468807358, "microseconds": 196142}, "event": "VSERPORT_CHANGE", "data": {"open": true, "id": "channel1"}}
I0718 10:02:38.196235 20539 qmp_handler.go:107] got event: VSERPORT_CHANGE
I0718 10:02:38.196252 20539 qmp_handler.go:323] got QMP event VSERPORT_CHANGE
I0718 10:02:38.196824 20539 init_comm.go:68] [console] hyper_init_event hyper channel event 0x615580, ops 0x6153a0, fd 3
I0718 10:02:38.197231 20539 init_comm.go:68] [console] hyper_add_event add event fd 3, 0x6153a0
I0718 10:02:38.197801 20539 init_comm.go:68] [console] hyper_init_event hyper ttyfd event 0x615548, ops 0x615360, fd 4
I0718 10:02:38.198208 20539 init_comm.go:68] [console] hyper_add_event add event fd 4, 0x615360
I0718 10:02:38.198497 20539 init_comm.go:68] [console] hyper_loop epoll_wait 1
I0718 10:02:38.199065 20539 init_comm.go:68] [console] hyper_handle_event get event 1, de 0x615580, fd 3. ops 0x6153a0
I0718 10:02:38.199626 20539 init_comm.go:68] [console] hyper_handle_event event EPOLLIN, de 0x615580, fd 3, 0x6153a0
I0718 10:02:38.199841 20539 init_comm.go:68] [console] hyper_event_read
I0718 10:02:38.200128 20539 init_comm.go:68] [console] already read 8 bytes data
I0718 10:02:38.200426 20539 init_comm.go:68] [console] hyper send type 14, len 4
I0718 10:02:38.200494 20539 init_comm.go:106] read 8/8 [length = 0]
I0718 10:02:38.200506 20539 init_comm.go:110] data length is 12
I0718 10:02:38.200509 20539 init_comm.go:96] trying to read 4 bytes
I0718 10:02:38.200515 20539 init_comm.go:106] read 12/12 [length = 12]
I0718 10:02:38.200522 20539 init_comm.go:96] trying to read 8 bytes
I0718 10:02:38.200531 20539 init_comm.go:190] got cmd:14
I0718 10:02:38.200535 20539 init_comm.go:253] get command NEXT
I0718 10:02:38.200539 20539 init_comm.go:256] send 67, receive 8
I0718 10:02:38.200662 20539 init_comm.go:68] [console] get length 67
I0718 10:02:38.201013 20539 init_comm.go:68] [console] read 59 bytes data, total data 67
I0718 10:02:38.201294 20539 init_comm.go:68] [console] hyper send type 14, len 4
I0718 10:02:38.201363 20539 init_comm.go:106] read 8/8 [length = 0]
I0718 10:02:38.201367 20539 init_comm.go:110] data length is 12
I0718 10:02:38.201370 20539 init_comm.go:96] trying to read 4 bytes
I0718 10:02:38.201374 20539 init_comm.go:106] read 12/12 [length = 12]
I0718 10:02:38.201380 20539 init_comm.go:96] trying to read 8 bytes
I0718 10:02:38.201387 20539 init_comm.go:190] got cmd:14
I0718 10:02:38.201391 20539 init_comm.go:253] get command NEXT
I0718 10:02:38.201394 20539 init_comm.go:256] send 67, receive 67
I0718 10:02:38.202938 20539 init_comm.go:68] [console] 0 0 0 1 0 0 0 43 7b 22 68 6f 73 74 6e 61 6d 65 22 3a 22 73 68 65 6c 6c 22 2c 22 63 6f 6e 74 61 69 6e 65 72 73 22 3a 5b 5d 2c 22 73 68 61 72 65 44 69 72 22 3a 22 73 68 61 72 65 5f 64 69 72 22 7d
I0718 10:02:38.203347 20539 init_comm.go:68] [console] hyper_channel_handle, type 1, len 67
I0718 10:02:38.204260 20539 init_comm.go:68] [console] call hyper_start_pod, json {"hostname":"shell","containers":[],"shareDir":"share_dir"}., len 59
I0718 10:02:38.205288 20539 init_comm.go:68] [console] call hyper_start_pod, json {"hostname":"shell","containers":[],"shareDir":"share_dir"}., len 59
I0718 10:02:38.205637 20539 init_comm.go:68] [console] jsmn parse successed, n is 7
I0718 10:02:38.205958 20539 init_comm.go:68] [console] token 0, type is 1, size is 3
I0718 10:02:38.206282 20539 init_comm.go:68] [console] token 1, type is 3, size is 1
I0718 10:02:38.206533 20539 init_comm.go:68] [console] hostname is shell
I0718 10:02:38.206863 20539 init_comm.go:68] [console] token 3, type is 3, size is 1
I0718 10:02:38.207093 20539 init_comm.go:68] [console] container count 0
I0718 10:02:38.207421 20539 init_comm.go:68] [console] token 5, type is 3, size is 1
I0718 10:02:38.208269 20539 init_comm.go:68] [console] random: busybox urandom read with 8 bits of entropy available
I0718 10:02:38.208639 20539 init_comm.go:68] [console] share tag is share_dir
I0718 10:02:38.208905 20539 init_comm.go:68] [console] create directory /tmp
I0718 10:02:38.209226 20539 init_comm.go:68] [console] create directory /tmp/hyper
I0718 10:02:38.209574 20539 init_comm.go:68] [console] create directory /tmp/hyper/proc
I0718 10:02:38.210055 20539 init_comm.go:68] [console] finish rescan
I0718 10:02:38.210543 20539 init_comm.go:68] [console] create directory /tmp/hyper/shared
I0718 10:02:38.213417 20539 init_comm.go:68] [console] pod init pid 325
I0718 10:02:38.213746 20539 init_comm.go:68] [console] hyper send type 8, len 0
I0718 10:02:38.213977 20539 init_comm.go:68] [console] uptime 0.33 0.02
I0718 10:02:38.214078 20539 init_comm.go:68] [console]
I0718 10:02:38.214345 20539 init_comm.go:68] [console] hyper send type 9, len 0
I0718 10:02:38.214462 20539 init_comm.go:106] read 8/8 [length = 0]
I0718 10:02:38.214470 20539 init_comm.go:110] data length is 8
I0718 10:02:38.214479 20539 init_comm.go:96] trying to read 8 bytes
I0718 10:02:38.214495 20539 init_comm.go:190] got cmd:9
I0718 10:02:38.214505 20539 init_comm.go:209] ack got, clear pong timer
I0718 10:02:38.214517 20539 hypervisor.go:29] vm vm-jSdTQgbOCv: main event loop got message 31(COMMAND_ACK)
I0718 10:02:38.214533 20539 vm_states.go:499] [starting] got init ack to &{1 859531731840 [] 859533565952}
I0718 10:02:38.214766 20539 init_comm.go:68] [console] pid 324 exit normally, status 0
I0718 10:02:38.214962 20539 context.go:211] VM vm-jSdTQgbOCv: state change from STARTING to 'RUNNING'
I0718 10:02:38.214969 20539 vm_states.go:515] pod start success
I0718 10:02:38.214982 20539 vm.go:260] Get the response from VM, VM id is vm-jSdTQgbOCv!
I0718 10:02:38.214992 20539 hyperpod.go:296] result: code 0 Start POD success
I0718 10:02:38.214997 20539 hyperpod.go:162] get exec path /usr/local/bin/runv
I0718 10:02:38.215424 20539 init_comm.go:68] [console] can not find exec whose pid is 324
I0718 10:02:38.215450 20539 init_comm.go:68] [console] hyper_loop epoll_wait -1
I0718 10:02:38.232033 20539 hypervisor.go:29] vm vm-jSdTQgbOCv: main event loop got message 24(COMMAND_SHUTDOWN)
I0718 10:02:38.232045 20539 vm_states.go:327] got shutdown command, shutting down
I0718 10:02:38.232057 20539 context.go:211] VM vm-jSdTQgbOCv: state change from RUNNING to 'TERMINATING'
I0718 10:02:38.232065 20539 init_comm.go:190] got cmd:4
I0718 10:02:38.232074 20539 init_comm.go:281] send command 4 to init, payload: 'null'.
I0718 10:02:38.232098 20539 init_comm.go:294] write 12 to init, payload: '\00\00\00\00\00\00null'.
I0718 10:02:38.232104 20539 init_comm.go:299] message sent, set pong timer
I0718 10:02:38.232654 20539 init_comm.go:68] [console] hyper_loop epoll_wait 1
I0718 10:02:38.233604 20539 init_comm.go:68] [console] hyper_handle_event get event 1, de 0x615580, fd 3. ops 0x6153a0
I0718 10:02:38.234530 20539 init_comm.go:68] [console] hyper_handle_event event EPOLLIN, de 0x615580, fd 3, 0x6153a0
I0718 10:02:38.234855 20539 init_comm.go:68] [console] hyper_event_read
I0718 10:02:38.235298 20539 init_comm.go:68] [console] already read 8 bytes data
I0718 10:02:38.235731 20539 init_comm.go:68] [console] hyper send type 14, len 4
I0718 10:02:38.235838 20539 init_comm.go:106] read 8/8 [length = 0]
I0718 10:02:38.235848 20539 init_comm.go:110] data length is 12
I0718 10:02:38.235857 20539 init_comm.go:96] trying to read 4 bytes
I0718 10:02:38.235874 20539 init_comm.go:106] read 12/12 [length = 12]
I0718 10:02:38.235901 20539 init_comm.go:96] trying to read 8 bytes
I0718 10:02:38.235923 20539 init_comm.go:190] got cmd:14
I0718 10:02:38.235930 20539 init_comm.go:253] get command NEXT
I0718 10:02:38.235937 20539 init_comm.go:256] send 12, receive 8
I0718 10:02:38.236113 20539 init_comm.go:68] [console] get length 12
I0718 10:02:38.236542 20539 init_comm.go:68] [console] read 4 bytes data, total data 12
I0718 10:02:38.236987 20539 init_comm.go:68] [console] hyper send type 14, len 4
I0718 10:02:38.237059 20539 init_comm.go:106] read 8/8 [length = 0]
I0718 10:02:38.237065 20539 init_comm.go:110] data length is 12
I0718 10:02:38.237070 20539 init_comm.go:96] trying to read 4 bytes
I0718 10:02:38.237079 20539 init_comm.go:106] read 12/12 [length = 12]
I0718 10:02:38.237086 20539 init_comm.go:96] trying to read 8 bytes
I0718 10:02:38.237098 20539 init_comm.go:190] got cmd:14
I0718 10:02:38.237105 20539 init_comm.go:253] get command NEXT
I0718 10:02:38.237111 20539 init_comm.go:256] send 12, receive 12
I0718 10:02:38.237518 20539 init_comm.go:68] [console] 0 0 0 4 0 0 0 c 6e 75 6c 6c
I0718 10:02:38.237990 20539 init_comm.go:68] [console] hyper_channel_handle, type 4, len 12
I0718 10:02:38.238389 20539 init_comm.go:68] [console] get DESTROYPOD message
I0718 10:02:38.238925 20539 init_comm.go:68] [console] Sending SIGTERM
I0718 10:02:38.239203 20539 init_comm.go:68] [console] kill process 325
I0718 10:02:38.239555 20539 init_comm.go:68] [console] kill process 323
I0718 10:02:38.239858 20539 init_comm.go:68] [console] kill process 322
I0718 10:02:38.240171 20539 init_comm.go:68] [console] kill process 65
I0718 10:02:38.240512 20539 init_comm.go:68] [console] kill process 64
I0718 10:02:38.240751 20539 init_comm.go:68] [console] kill process 63
I0718 10:02:38.241067 20539 init_comm.go:68] [console] kill process 62
I0718 10:02:38.241316 20539 init_comm.go:68] [console] kill process 61
I0718 10:02:38.241626 20539 init_comm.go:68] [console] kill process 60
I0718 10:02:38.241913 20539 init_comm.go:68] [console] kill process 59
I0718 10:02:38.242201 20539 init_comm.go:68] [console] kill process 58
I0718 10:02:38.242498 20539 init_comm.go:68] [console] kill process 57
I0718 10:02:38.242739 20539 init_comm.go:68] [console] kill process 56
I0718 10:02:38.243036 20539 init_comm.go:68] [console] kill process 55
I0718 10:02:38.243340 20539 init_comm.go:68] [console] kill process 54
I0718 10:02:38.243599 20539 init_comm.go:68] [console] kill process 53
I0718 10:02:38.243843 20539 init_comm.go:68] [console] kill process 52
I0718 10:02:38.244139 20539 init_comm.go:68] [console] kill process 51
I0718 10:02:38.244403 20539 init_comm.go:68] [console] kill process 50
I0718 10:02:38.244704 20539 init_comm.go:68] [console] kill process 49
I0718 10:02:38.244964 20539 init_comm.go:68] [console] kill process 48
I0718 10:02:38.245176 20539 init_comm.go:68] [console] kill process 47
I0718 10:02:38.245437 20539 init_comm.go:68] [console] kill process 37
I0718 10:02:38.245688 20539 init_comm.go:68] [console] kill process 23
I0718 10:02:38.245940 20539 init_comm.go:68] [console] kill process 22
I0718 10:02:38.246191 20539 init_comm.go:68] [console] kill process 21
I0718 10:02:38.246451 20539 init_comm.go:68] [console] kill process 20
I0718 10:02:38.246701 20539 init_comm.go:68] [console] kill process 19
I0718 10:02:38.246953 20539 init_comm.go:68] [console] kill process 18
I0718 10:02:38.247204 20539 init_comm.go:68] [console] kill process 17
I0718 10:02:38.247466 20539 init_comm.go:68] [console] kill process 16
I0718 10:02:38.247717 20539 init_comm.go:68] [console] kill process 15
I0718 10:02:38.247968 20539 init_comm.go:68] [console] kill process 14
I0718 10:02:38.248222 20539 init_comm.go:68] [console] kill process 13
I0718 10:02:38.248484 20539 init_comm.go:68] [console] kill process 12
I0718 10:02:38.248743 20539 init_comm.go:68] [console] kill process 11
I0718 10:02:38.248994 20539 init_comm.go:68] [console] kill process 10
I0718 10:02:38.249237 20539 init_comm.go:68] [console] kill process 9
I0718 10:02:38.249489 20539 init_comm.go:68] [console] kill process 8
I0718 10:02:38.249732 20539 init_comm.go:68] [console] kill process 7
I0718 10:02:38.249974 20539 init_comm.go:68] [console] kill process 6
I0718 10:02:38.250214 20539 init_comm.go:68] [console] kill process 5
I0718 10:02:38.250467 20539 init_comm.go:68] [console] kill process 4
I0718 10:02:38.250707 20539 init_comm.go:68] [console] kill process 3
I0718 10:02:38.250948 20539 init_comm.go:68] [console] kill process 2
I0718 10:02:38.993768 20539 init_comm.go:68] [console] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x2f75b1eac7a, max_idle_ns: 440795210882 ns
I0718 10:02:48.232263 20539 hypervisor.go:29] vm vm-jSdTQgbOCv: main event loop got message 3(EVENT_VM_TIMEOUT)
W0718 10:02:48.232299 20539 vm_states.go:650] VM did not exit in time, try to stop it
E0718 10:02:48.232566 20539 vm_states.go:293] Shutting down because of an exception: vm terminating timeout
I0718 10:02:48.232695 20539 qmp_handler.go:296] got new session
I0718 10:02:48.232735 20539 qmp_handler.go:225] Begin process command session
I0718 10:02:48.232755 20539 qmp_handler.go:243] sending command (1) {"execute":"quit"}
I0718 10:02:48.232816 20539 vm.go:298] Got response: 7: vm terminating timeout
I0718 10:02:48.233293 20539 qmp_handler.go:103] got a message {"return": {}}
I0718 10:02:48.233353 20539 qmp_handler.go:103] got a message {"timestamp": {"seconds": 1468807368, "microseconds": 233233}, "event": "SHUTDOWN"}
I0718 10:02:48.233374 20539 qmp_handler.go:107] got event: SHUTDOWN
I0718 10:02:48.233383 20539 qmp_handler.go:152] Shutdown, quit QMP receiver
I0718 10:02:48.233394 20539 qmp_handler.go:323] got QMP event SHUTDOWN
I0718 10:02:48.233401 20539 qmp_handler.go:325] got QMP shutdown event, quit...
I0718 10:02:48.233411 20539 hypervisor.go:29] vm vm-jSdTQgbOCv: main event loop got message 1(EVENT_VM_EXIT)
I0718 10:02:48.233419 20539 vm_states.go:622] Got VM shutdown event while terminating, go to cleaning up
I0718 10:02:48.233425 20539 vm_states.go:36] VM has exit...
I0718 10:02:48.233435 20539 devicemap.go:93] All resource being released, someone is waiting for us...
I0718 10:02:48.233440 20539 context.go:198] no more device to release/remove/umount, quit
I0718 10:02:48.233464 20539 qemu_process.go:19] quit watch dog.
I0718 10:02:48.233480 20539 vm.go:298] Got response: 2: VM shut down
I0718 10:02:48.233491 20539 hyperpod.go:319] StopPod fail: QEMU response data is nil
I0718 10:02:48.233497 20539 hyperpod.go:309] start ns listener fail: EOF
I0718 10:02:48.233504 20539 supervisor.go:168] createHyperPod() returns
E0718 10:02:48.238242 20539 init_comm.go:99] read init data failed
E0718 10:02:48.238244 20539 tty.go:90] read tty data failed
I0718 10:02:48.238272 20539 tty.go:151] tty socket closed, quit the reading goroutine EOF
I0718 10:02:48.238282 20539 tty.go:428] Input byte chan closed, close the output string chan
I0718 10:02:48.238300 20539 init_comm.go:70] console output end
I0718 10:02:48.238309 20539 tty.go:118] tty chan closed, quit sent goroutine
@Ddnirvana Thanks! it seems like some wrong in containerd-nslistener, Can you apply the below patch to tell us what's wrong.
diff --git a/supervisor/hyperpod.go b/supervisor/hyperpod.go
index 9b92419..e504e9a 100644
--- a/supervisor/hyperpod.go
+++ b/supervisor/hyperpod.go
@@ -290,6 +290,7 @@ func (hp *HyperPod) startNsListener() (err error) {
glog.Infof("get exec path %s", path)
parentPipe, childPipe, err = newPipe()
if err != nil {
+ glog.Errorf("create pipe for containerd-nslistener failed: %v", err)
return err
}
@@ -304,7 +305,7 @@ func (hp *HyperPod) startNsListener() (err error) {
cmd.Args[0] = "containerd-nslistener"
cmd.ExtraFiles = append(cmd.ExtraFiles, childPipe)
if err = cmd.Start(); err != nil {
- glog.Error(err)
+ glog.Errorf("start containerd-nslistener failed %v", err)
return err
}
@@ -328,6 +329,7 @@ func (hp *HyperPod) startNsListener() (err error) {
/* Make sure nsListener create new netns */
var ready string
if err = dec.Decode(&ready); err != nil {
+ glog.Errorf("Get ready message from containerd-nslistener failed: %v", err)
return err
}
OMG......Firstly I find your patch is based on the codes in the git(which is the most recently version). Actually it's a bit different than the version 0.6.0 code in the release package(which version I am using now). So I just think maybe I should try pulling the latest code instead of downloading the release package. And I find it just works fine! @gao-feng I really really appreciate your help! But I still wonder why it failed when I use the code in the release packages......
@Ddnirvana Good news! I think it may be runv-0.6 doesn't support nslistener(https://github.com/hyperhq/runv/blob/v0.6.0/main.go#L51), the latest code adds the support.(https://github.com/hyperhq/runv/blob/master/main.go#L57)
I'm sorry that troubled you.
Hi, I am trying to run runv on Ubuntu 14.04,but it just failed. I run the flowing commands:
And I get the following warnings(the container ended without execution)
Some logs from runv-namespaced.INFO:
From the log, I find something weird is that
after getting the log info "pod start success",we also get the log info "main event loop got message 24(COMMAND_SHUTDOWN)" I think maybe the problem is because of this SHUTDOWN COMMAND. I have tried many efforts on running runv :( Any ideas to fix this ? Looking forward to any help!~