<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
Hi Stefano</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
I think we'll need a more complex solution [1] (unless someone else has a better patch).</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
Here [1] you can find a version of kata-runtime that supports all namespaces (yes, including mnt namespace!!) unlike upstream kata-runtime<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
Since you want to use it for testing net ns, I just enabled it, but if you need other namespace, just uncomment it out from the list [2]<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
I only tested v1 (no netmom, no vmtemplating) with docker</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
let me know if it works for you<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
[1] - <a href="https://github.com/devimc/kata-runtime/tree/nodelete/namespaces">https://github.com/devimc/kata-runtime/tree/nodelete/namespaces</a></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
[2] - <a href="https://github.com/devimc/kata-runtime/blob/556f11ec6e8a5f98973b9023f1746888f5b69725/pkg/katautils/main.c#L117-L126">
https://github.com/devimc/kata-runtime/blob/556f11ec6e8a5f98973b9023f1746888f5b69725/pkg/katautils/main.c#L117-L126</a></div>
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Stefano Garzarella <sgarzare@redhat.com><br>
<b>Sent:</b> Tuesday, December 17, 2019 6:47 AM<br>
<b>To:</b> Montes, Julio <julio.montes@intel.com><br>
<b>Cc:</b> Boeuf, Sebastien <sebastien.boeuf@intel.com>; kata-dev@lists.katacontainers.io <kata-dev@lists.katacontainers.io>; Peng Tao <tao.peng@linux.alibaba.com><br>
<b>Subject:</b> Re: [kata-dev] vsock & network namespaces in Kata</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi Julio,<br>
<br>
On Mon, Dec 16, 2019 at 09:51:56PM +0000, Montes, Julio wrote:<br>
> Hi Stefano<br>
> <br>
> This patch [1] moves the runtime to the sandbox's (qemu) net namespace.<br>
> This patch is a hotfix that should be used only for testing<br>
<br>
Thanks for the patch!<br>
<br>
I tried it, but I have the same behaviour (v1 doesn't work, v2 works).<br>
<br>
I did a minimal debugging with the old vsock modules, where v1 works well,<br>
checking the netns:<br>
$ ip netns<br>
cnitest-3c2d7774-b4e1-1901-6c8a-fb20b857898b (id: 0)<br>
$ ip netns pids cnitest-3c2d7774-b4e1-1901-6c8a-fb20b857898b<br>
1343<br>
1357<br>
$ ps -p 1357 1343<br>
  PID TTY      STAT   TIME COMMAND<br>
 1343 ?        Sl     0:21 /usr/bin/qemu-vanilla-system-x86_64 -name sandbox-b00b4ff14f15714027d76221d316ad778cfda3cb5e104421c5942c2e04adc752 -uuid 1cee59f0-ff07-4602-af2e-d25962de412f -machine pc,accel=kvm,kernel_irqchip,nvdimm -cpu host,pmu=off -qmp unix:/run/vc/vm/b00b4ff14f15714027d76221d316ad778cfda3cb5e104421c5942c2e04adc752/qmp.sock,server,nowait
 -m 2048M,slots=10,maxmem=8979M -device pci-bridge,bus=pci.0,id=pci-bridge-0,chassis_nr=1,shpc=on,addr=2,romfile= -device virtio-serial-pci,disable-modern=true,id=serial0,romfile= -device virtconsole,chardev=charconsole0,id=console0 -chardev socket,id=charconsole0,path=/run/vc/vm/b00b4ff14f15714027d76221d316ad778cfda3cb5e104421c5942c2e04adc752/console.sock,server,nowait
 -device nvdimm,id=nv0,memdev=mem0 -object memory-backend-file,id=mem0,mem-path=/usr/share/kata-containers/kata-containers-image_clearlinux_1.10.0-alpha1_agent_c87f497312.img,size=134217728 -device virtio-scsi-pci,id=scsi0,disable-modern=true,romfile= -object
 rng-random,id=rng0,filename=/dev/urandom -device virtio-rng,rng=rng0,romfile= -device vhost-vsock-pci,disable-modern=true,vhostfd=3,id=vsock-1011671291,guest-cid=1011671291,romfile= -device virtio-9p-pci,disable-modern=true,fsdev=extra-9p-kataShared,mount_tag=kataShared,romfile=
 -fsdev local,id=extra-9p-kataShared,path=/run/kata-containers/shared/sandboxes/b00b4ff14f15714027d76221d316ad778cfda3cb5e104421c5942c2e04adc752,security_model=none -netdev tap,id=network-0,vhost=on,vhostfds=4,fds=5 -device driver=virtio-net-pci,netdev=network-0,mac=02:42:ac:11:00:02,disable-modern=true,mq=on,vectors=4,romfile=
 -global kvm-pit.lost_tick_policy=discard -vga none -no-user-config -nodefaults -nographic -daemonize -object memory-backend-ram,id=dimm1,size=2048M -numa node,memdev=dimm1 -kernel /usr/share/kata-containers/vmlinuz-4.19.75.55-59.1.container -append 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 console=hvc0 console=hvc1 iommu=off cryptomgr.notests net.ifnames=0 pci=lastbus=0 root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro
 ro rootfstype=ext4 quiet systemd.show_status=false panic=1 nr_cpus=4 agent.use_vsock=true systemd.unit=kata-containers.target systemd.mask=systemd-networkd.service systemd.mask=systemd-networkd.socket -pidfile /run/vc/vm/b00b4ff14f15714027d76221d316ad778cfda3cb5e104421c5942c2e04adc752/pid
 -smp 1,cores=1,threads=1,sockets=4,maxcpus=4<br>
 1357 pts/2    Ssl+   0:00 /usr/libexec/kata-containers/kata-shim -agent vsock://1011671291:1024 -container b00b4ff14f15714027d76221d316ad778cfda3cb5e104421c5942c2e04adc752 -exec-id b00b4ff14f15714027d76221d316ad778cfda3cb5e104421c5942c2e04adc752 -terminal<br>
<br>
It seems that only qemu and kata-shim are in the same netns.<br>
Maybe I did something wrong, can you double check?<br>
<br>
If you want, I can provide you a Fedora VM with new vsock kernel<br>
modules.<br>
<br>
Thanks,<br>
Stefano<br>
<br>
</div>
</span></font></div>
</body>
</html>