Open Vesnica opened 4 years ago
Hi @Vesnica! Firecracker does not support macvtap yet. What is your exact usecase ? Macvtap simplifies the networking setup, but otherwise you can still use tap + bridge.
@sandreim Using a bridge requires me to reconfig my network (move ip to bridge etc), using macvtap can avoid these troubles.
I'm looking forward to this feature.
To accepting macvtap devices you can either require them to be in the format /dev/tapXY
and then opening here https://github.com/firecracker-microvm/firecracker/blob/49003d0f2f8573f6e1af6d22232c0917a0253189/src/devices/src/virtio/net/tap.rs#L113 and skipping that step https://github.com/firecracker-microvm/firecracker/blob/49003d0f2f8573f6e1af6d22232c0917a0253189/src/devices/src/virtio/net/tap.rs#L123
Actually it would be nicer if the XY
number for /dev/tapXY
is detected from its interface name via something like let mut ifreq = ifreq_for(name);; ifreq_ioctl(socketfd, &mut ifreq, SIOCGIFINDEX).map(|ifindex| ifindex as usize);
Here is a small helper script for testing during development. It uses the passthru mode to forward the current default NIC to the VM (temporarily blocking access of the kernel network stack). This also works when on a WiFi (but not for too long since wpa_supplicant can't renew the authentification while the VM uses the NIC).
#!/bin/bash
set -euo pipefail
if [ $# = 1 ]; then
IFN="$1"
else
IFN="$(ip route get 1 | grep -o 'dev.*' | cut -d ' ' -f 2)"
echo "Detected $IFN based on default route"
fi
TAP="$IFN"pass
echo "Creating macvtap is passthru mode for $IFN (normal kernel network access will be blocked)"
echo "When done using it, delete with:"
echo " sudo ip link delete $TAP"
sudo ip link add link "$IFN" name "$TAP" type macvtap mode passthru
MAC="$(cat "/sys/class/net/$IFN/address")"
sudo ip link set "$TAP" address "$MAC" up
DEV="/dev/tap$(cat "/sys/class/net/$TAP/ifindex")"
sudo chown "$USER:$USER" "$DEV"
echo "Ready! MAC: $MAC DEV: $DEV IFACE: $TAP"
I am renaming this item and I'm adding it on the Firecracker roadmap as a research item.
@raduweiss - just following up on our slack chat. This is essential for the solution for DT and it would be good if this could be released before next year as we are planning a poc in Jan 22.
I'm really hoping to see macvtap supported in firecracker. The business reason is simplicity.
I'm really hoping to see macvtap supported in firecracker. The business reason is simplicity.
@bootrino - we currently use this feature from the feature branch. As its no released, we have a fork where we've merged 1.0.0 with the macvtap branch so that we aren't blocked.
@richardcase Do you have benchmarks? Also, would you mind rebasing the branch? (it conflicts with main)
Hi, we've been looking for a firecracker manager and the work being made by weaveworks with flintlock and @richardcase is looking great. Is there any perspective on having MacVTap supported and merged? Would be happy to contribute.
BTW, @majek weaveworks have been maintaining a fork with macvtap here https://weaveworks-liquidmetal.github.io/flintlock/docs/getting-started/firecracker/
If you want, you can comment on https://github.com/firecracker-microvm/firecracker/issues/1933 with your usecase, to see if it can gain some traction again :)
Following up from #2217 - I can explain my specific use case, if needed (which involves nested KVM firecrackers), but I actually think the best argument for implementing macvtap support is that it greatly lowers the barrier-to-entry for someone new to try out firecracker, because it greatly simplifies the initial networking configuration. If a goal is get more people using firecracker, then lowering the barrier-to-entry is a "big deal." (From personal experience, I put firecracker on the back burner several times before actually getting it working because the network config was frustrating, and I didn't want to make global changes to my system - e.g. enabling forwarding, just to try it out.)
Hi @dzenc and @ccrvlh ,
Thanks for your messages and sorry for the late reply. I am the manager of Firecracker so feel free to reach me out on slack if you need anything. In mid 2022 we tried to resume this work and try to find a way to merge it on main with @richardcase considering weaveworks was having it on a feature branch from a while, but i think the communication channel broke because ended up de prioritized by both parties. This work require someone to mainly:
So if there are people interested in 1 and 2, we can sync with item 3 and see the best path forward. We were also considering the opportunity to add a new network device in Firecracker to improve performances and flexibility overall (if that was a drive). @majek posted an issue on vhost-net #3707 where there is a bit of chat on the topic.
@xmarcalx - i'm no longer at Weaveworks but i'd be interested in helping to get this feature in and could help with 1 & 2.
Hi @richardcase (et all),
thanks for the reply, and sorry for the late reply, it has been holiday and therefore OOO season.
It is great that we count on your help for 1 & 2, thanks for that.
As i was citing in my previous message, seems there is a lot of interest in modifying the networking backed of Firecracker among all of us. There are multiple initiatives in this direction: this macVtap, the proposal on vhost-net, and our idea to use vhost-user-net in line with the recent effort to use that technology for the block device. I think we need to stay true to our tenets and try to understand if we can catch all the needs and usecases with just one implementation of the three. This will keep the code simpler and also unify our effort and cycles spent in this area, hopefully satisfying everyone. If not, then kick off the streams of work previously cited.
To better understand the usecase (also because some time passed from when the issue was opened 😢 ), I have some questions:
Anyway, we decided to track the effort to rethink about Firecracker network backed in our roadmap such that we are going to make a decision and implementation hopefully within 2024 and we do not delay this or any other networking decision further.
Thanks a lot as usual for your contribution.
Removing tracking from roadmap since we are tracking network improvements already as part of #4364 and we still do not have clear datapoint on previous questions
I'm following the getting started guide, and trying to bind a macvtap to guest, which always give me this:
I use following command to create macvtap and try to setup network for guest:
firecracker version:
0.21.1