Page MenuHomeVyOS Platform

9p Virtio Kernel modules
Closed, ResolvedPublicFEATURE REQUEST

Description

VyOS works well under QEMU in GNS3, but GNS3 projects get very large due to storing a (copy on write snapshot of a) disk image for each virtual router in the topology, when all we really need is one disk image and a config file for each router.

https://wiki.qemu.org/Documentation/9psetup

QEMU has a nice feature where the guest OS can mount a directory on the host using the 9p protocol and virtio. This could be used to mount /config so that the actual config files can be stored in plain text on the host machine rather than in the disk image. Even just a snapshot (delta) of the disk image can get to hundreds of megabytes per router; in a complex topology with multiple routers this adds up quickly. Storing just the config files instead of the entire disk image this way would have a number of benefits, such as:

  • The disk image snapshot could be discarded when the router shuts down, keeping only the config, so that more GNS3 projects could be stored
  • Sharing GNS3 projects would be much easier due to the smaller size
  • (maybe?) GNS3 projects could be managed in revision control such as git.

The problem is that VyOS lacks the 9p kernel modules. Please would you consider including them in the stock image, even if they are disabled by default. If the modules were included there, hopefully it would be as simple as configuring QEMU and adding an entry in /etc/fstab to mount /config on boot.

I have tried building a modified VyOS iso with these modules as a proof of concept but am getting errors building it. When I tried building from the current branch fails with some error relating to initrd. I also tried checking out commits from when vyos-1.2.0-20171115-amd64-vrrp6.iso was built but I think this fails because the iso building process is looking for files on the apt repo that have changed.

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close

Event Timeline

@syncer if it's inside the stock kernel, we should enable it ....

config NET_9P_VIRTIO
        depends on VIRTIO
        tristate "9P Virtio Transport"
        help
          This builds support for a transports between
          guest partitions and a host partition.

I think this is the way to do it:

diff --git a/arch/x86/configs/x86_64_vyos_defconfig b/arch/x86/configs/x86_64_vyos_defconfig
index 4be327e98393..61df1aae9f49 100644
--- a/arch/x86/configs/x86_64_vyos_defconfig
+++ b/arch/x86/configs/x86_64_vyos_defconfig
@@ -1376,7 +1376,8 @@ CONFIG_RFKILL_LEDS=y
 # CONFIG_RFKILL_INPUT is not set
 CONFIG_RFKILL_REGULATOR=m
 # CONFIG_RFKILL_GPIO is not set
-# CONFIG_NET_9P is not set
+CONFIG_NET_9P=m
+CONFIG_NET_9P_VIRTIO=m
 # CONFIG_CAIF is not set
 CONFIG_CEPH_LIB=m
 # CONFIG_CEPH_LIB_PRETTYDEBUG is not set
@@ -4662,6 +4663,10 @@ CONFIG_SUNRPC_XPRT_RDMA=m
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
+CONFIG_9P_FS=m
+CONFIG_9P_FSCACHE=y
+CONFIG_9P_FS_POSIX_ACL=y
+CONFIG_9P_FS_SECURITY=y
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="utf8"
 CONFIG_NLS_CODEPAGE_437=m

It's an ACK from my side and can be easily done. @syncer ACK/NACK?

Ok, as this is a rather minimal change I just added it and triggered the CI build. Will be in the next rolling release...

Sorry @c-po i think it will not hurt

syncer claimed this task.
syncer triaged this task as Low priority.