vsock on nested virtualization

root@zfs:~#scp -P2222 tinyP.img localhost:/root/

pass: clinton

root@TINY: vi /usr/bin/vmstart2

Change the IP range to 10.0.3

set the path to /root and image tinyPQ.img

alias sshe="/usr/bin/ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i /root/id_vm"

Launch top when the cpu goes 50% idle or less the VMs should have finished booting *Check if the VMs are accessible via ssh

root@TINY: vmstart --check

vm1 ---->  10.0.3.1
vm2 ---->  10.0.3.2
vm3 ---->  10.0.3.3

See the different speed between TCP/IP access and vsock.

Note the context switches

root@TINY:~# time -v vsock_cli 3 1961 -cmd 'uname -a;ip a |grep /24;df -h'

Linux vm1 4.20.7-max #1 SMP PREEMPT Fri Feb 8 09:17:11 GMT 2019 x86_64 GNU/Linux
    inet 10.0.3.1/24 scope global eth0
Filesystem                Size      Used Available Use% Mounted on
devtmpfs                110.2M         0    110.2M   0% /dev
tmpfs                   116.7M         0    116.7M   0% /dev/shm
tmpfs                   116.7M         0    116.7M   0% /tmp
tmpfs                   116.7M     20.0K    116.7M   0% /run

	Command being timed: "vsock_cli 3 1961 -cmd uname -a;ip a |grep /24;df -h"
	User time (seconds): 0.00
	System time (seconds): 0.00
	Percent of CPU this job got: 37%
	Elapsed (wall clock) time (h:mm:ss or m:ss): 0m 0.02s
	Average shared text size (kbytes): 0
	Average unshared data size (kbytes): 0
	Average stack size (kbytes): 0
	Average total size (kbytes): 0
	Maximum resident set size (kbytes): 10992
	Average resident set size (kbytes): 0
	Major (requiring I/O) page faults: 0
	Minor (reclaiming a frame) page faults: 565
	Voluntary context switches: 4
	Involuntary context switches: 8
	Swaps: 0
	File system inputs: 0
	File system outputs: 0
	Socket messages sent: 0
	Socket messages received: 0
	Signals delivered: 0
	Page size (bytes): 4096
	Exit status: 0

root@TINY:~# time -v ssh -i id_vm 10.0.3.1 'uname -a;ip a |grep /24;df -h'

Linux vm1 4.20.7-max #1 SMP PREEMPT Fri Feb 8 09:17:11 GMT 2019 x86_64 GNU/Linux
    inet 10.0.3.1/24 scope global eth0
Filesystem                Size      Used Available Use% Mounted on
devtmpfs                110.2M         0    110.2M   0% /dev
tmpfs                   116.7M         0    116.7M   0% /dev/shm
tmpfs                   116.7M         0    116.7M   0% /tmp
tmpfs                   116.7M     20.0K    116.7M   0% /run
	Command being timed: "ssh -i id_vm 10.0.3.1 uname -a;ip a |grep /24;df -h"
	User time (seconds): 0.01
	System time (seconds): 0.01
	Percent of CPU this job got: 13%
	Elapsed (wall clock) time (h:mm:ss or m:ss): 0m 0.19s
	Average shared text size (kbytes): 0
	Average unshared data size (kbytes): 0
	Average stack size (kbytes): 0
	Average total size (kbytes): 0
	Maximum resident set size (kbytes): 12528
	Average resident set size (kbytes): 0
	Major (requiring I/O) page faults: 0
	Minor (reclaiming a frame) page faults: 176
	Voluntary context switches: 14
	Involuntary context switches: 18
	Swaps: 0
	File system inputs: 0
	File system outputs: 0
	Socket messages sent: 0
	Socket messages received: 0
	Signals delivered: 0
	Page size (bytes): 4096
	Exit status: 0