marcosnils / cmt

Container migration tool
MIT License
127 stars 14 forks source link

Validation error with patched criu #12

Closed washraf closed 8 years ago

washraf commented 8 years ago

Error in validation: cmt validate --src pwd --dst walid@192.168.1.12 2016/01/11 17:31:53 Error criu does not exist in dst

I am sure that the destination is the same and i tried it the other way too.

marcosnils commented 8 years ago

@washarf. Is CRIU un the PATH with the same user you're running cmt?

washraf commented 8 years ago

I don't get what you mean and I only ran the make and install commands ?

marcosnils commented 8 years ago

@washraf CMT needs CRIU and runc in other to work. Instructions are in the README file.

So, in order for CMT to work you need to make sure that both CRIU and runC are available in the PATH of the user that executes CMT.

washraf commented 8 years ago

yes both are .. walid@ubuntu:~$ echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/go/src/bin walid@ubuntu:~$ which criu /usr/local/sbin/criu walid@ubuntu:~$ which runc /usr/local/bin/runc

marcosnils commented 8 years ago

@washraf what do you get if you do ssh walid@192.168.1.12 bash -c "which criu"

washraf commented 8 years ago

It doesn't give a response neither an error not with the criu command but also with some basic ones like "ls"

marcosnils commented 8 years ago

@washraf please try

ssh walid@192.168.1.12 "bash -c 'which criu'" (note quoting)

washraf commented 8 years ago

walid@ubuntu:~$ ssh walid@192.168.1.12 "bash -c 'which criu'" /usr/local/sbin/criu

marcosnils commented 8 years ago

@washraf the machine where you're running CMT has the identity key in the ssh-agent right?. Basically, can you connect to the destination host without typing the password?

washraf commented 8 years ago

yes, I have configured it already before i started testing

marcosnils commented 8 years ago

@washraf just realized something, try this please:

ssh walid@192.168.1.12 "bash -c 'sudo which criu'"

Both runC and criu need to be in the PATH using sudo from the user you're using.

washraf commented 8 years ago

btw, you forget the -t option, it worked and it sure asked for the root password.

walid@ubuntu:~$ ssh -t walid@192.168.1.12 "bash -c 'sudo which criu'"
[sudo] password for walid: 
/usr/local/sbin/criu
Connection to 192.168.1.12 closed.
marcosnils commented 8 years ago

@washraf that's the problem you need to configure SUDO so the walid user can execute runC and CRIU without entering the password.

washraf commented 8 years ago

validation succeeded ... thanks very much :+1: :smile: I will close the issue ..

washraf commented 8 years ago

when i cd in the real container folder (I am using ubuntu container) when i try to migrate it i get an error.

walid@ubuntu:~$ cmt validate --src `pwd` --dst walid@192.168.1.12
Validation succeded
walid@ubuntu:~$ cd goapp/ 
walid@ubuntu:~/goapp$ cmt validate --src `pwd` --dst walid@192.168.1.12
2016/01/12 14:49:51 Error dumping CPU info
walid@ubuntu:~/goapp$ cmt migrate --src `pwd` --dst walid@192.168.1.12:/home/walid/goapp
2016/01/12 14:49:59 Performing validations
2016/01/12 14:49:59 Error dumping CPU info
marcosnils commented 8 years ago

@washraf try criu cpuinfo dump in the src machine.

washraf commented 8 years ago
walid@ubuntu:~/goapp$ sudo criu cpuinfo dump
walid@ubuntu:~/goapp$ ls
checkpoint  config.json  cpuinfo.img  rootfs  runtime.json  ubuntu_latest.tar
marcosnils commented 8 years ago

Try without sudo plz

sent from mobile On Jan 13, 2016 12:59 PM, "washraf" notifications@github.com wrote:

walid@ubuntu:~/goapp$ sudo criu cpuinfo dump walid@ubuntu:~/goapp$ ls checkpoint config.json cpuinfo.img rootfs runtime.json ubuntu_latest.tar

— Reply to this email directly or view it on GitHub https://github.com/marcosnils/cmt/issues/12#issuecomment-171341917.

washraf commented 8 years ago
walid@ubuntu:~/goapp$ criu cpuinfo dump
Error (image.c:319): Unable to open cpuinfo.img: Permission denied
marcosnils commented 8 years ago

That's the issue

sent from mobile On Jan 13, 2016 1:11 PM, "washraf" notifications@github.com wrote:

walid@ubuntu:~/goapp$ criu cpuinfo dump Error (image.c:319): Unable to open cpuinfo.img: Permission denied

— Reply to this email directly or view it on GitHub https://github.com/marcosnils/cmt/issues/12#issuecomment-171345418.

washraf commented 8 years ago

walid@ubuntu:~/test-criu$ cmt migrate --src pwd --dst walid@192.168.1.12:/home/walid/test-criu 2016/01/13 22:34:00 Performing validations 2016/01/13 22:34:01 Preparing everything to do a checkpoint 2016/01/13 22:34:01 Performing the checkpoint predump = false 2016/01/13 22:34:02 Error performing checkpoint:exit status 1 walid@ubuntu:~/test-criu$ criu cpuinfo dump walid@ubuntu:~/test-criu$ ls config.json cpuinfo.img images rootfs runtime.json ubuntu_latest.tar

washraf commented 8 years ago

@marcosnils any feed back on this after updates ??

marcosnils commented 8 years ago

hey @washraf can you check please the dump logs to see what's the error when trying to checkpoint. There should be somewhere in /var/run/opencontainer/runc/.....

washraf commented 8 years ago

there are no log files ... only state files .. But when I run:

sudo runc checkpoint 
criu failed: type DUMP errno 0
log file: /run/opencontainer/containers/test-criu/criu.work/dump.log

and here is the error description. (00.001246) Error (proc_parse.c:827): SECCOMP_MODE_FILTER not currently supported (00.001249) Error (proc_parse.c:840): Error parsing proc status file (00.001296) Unfreezing tasks into 1 (00.001300) Unseizing 5729 into 1 (00.001307) Error (ptrace.c:43): Unable to detach from 5729: No such process (00.001312) Unlock network (00.001314) Unfreezing tasks into 1 (00.001315) Unseizing 5729 into 1 (00.001316) Error (ptrace.c:43): Unable to detach from 5729: No such process (00.001343) Error (cr-dump.c:1617): Dumping FAILED.

and P.s. Runc only runs as a sudo ??

marcosnils commented 8 years ago

@washraf got it to work?

washraf commented 8 years ago

no I implemented my own migration automation over runc and NFS file system

washraf commented 8 years ago

Put I have a quick question runc takes the terminal and I want to run it in a go program to be able to measure its performance. Even though I am using the -d option it still take the terminal

command := exec.Command("runc","start","-d","redis","& >/dev/null </dev/null")
command.Dir = "/containers/redis"
start := time.Now() 
command.CombinedOutput()
duration:= time.Since(start)/time.Millisecond
fmt.Println(duration) 

its the same for the restore command