Some Modest Virtualization Observations
Elliott Mitchell
ehem+openwrt at m5p.com
Sat Mar 18 17:09:21 PDT 2023
On Tue, Mar 14, 2023 at 03:23:11PM -0300, Luiz Angelo Daros de Luca wrote:
>
> Yes, docs are quite outdated, mostly because everything now runs out
> of the box. The x86/64 target does not have the embedded restrictions
> in mind and the kernel has all VM drivers for most hypervisors
> built-in (see: https://github.com/openwrt/openwrt/blob/master/target/linux/x86/64/config-5.15).
> It's just like any other modern appliance.
Yet this loses some of the most important benefits of OpenWRT and VMs.
The drivers for *all* hypervisors are built-in, instead of merely loading
the appropriate ones as needed. Hence the recommendation of 256MB of
memory, instead of the 128MB recommended for device purchases. Most
hypervisor machines can handle this, but let the small VMs run loose and
you'll be out of memory instantly.
This fails as a developer simulcrum for an embedded device since too much
memory is consumed to support all devices. Using modules for portions of
the hypervisor support should cut down significantly.
The kernel configurations also need work. Notice CONFIG_FB=y? For a
router/AP you really don't need that feature. I suppose someone might
need that in some circumstance, yet for production use that is major
overhead.
Speaking of support for all hypervisors. I notice
"# CONFIG_XEN_BACKEND is not set". Most Xen device backends might be
unnecessary, but CONFIG_XEN_NETDEV_BACKEND certainly seems worthwhile.
> I run openwrt both in test and production using xen, qemu and
> virtualbox and there is not much extra TODOs other than use the image
> as a virtual disk, add some virtual NICs and have fun. The extra tips
> also applies to any x86 target like "resize your image and its
> partitions before flashing/upgrading if you need more room" or "a
> custom grub, like from sles xen, might look for a config at a
> different path (/boot/grub vs /boot/grub2)". Hyper V might work out of
> the box, but I never used it.
I'm trying to guess whether your network is rather complicated, versus
"production" not being very stable for you. Using OpenWRT under all
those for production at the same time seems odd.
The real weakness in the documentation is it assumes a single virtual
storage device. Whereas in a more advanced configuration one would have
a read-only squashfs root in the VM. Then a separate virtual device for
writeable data.
There is no guidance for the how much space to allocate for writeable
space for a x86 OpenWRT VM.
--
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/)
\BS ( | ehem+sigmsg at m5p.com PGP 87145445 | ) /
\_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
More information about the openwrt-devel
mailing list