Incus and sriov issue: Error: No value found in "sriov"

I’m trying to setup an sriov device using the following command line

$ incus config device add router eth0 nic sriov parent=ens1f0v1 mtu=9000

But it return "Error: No value found in “sriov” . Any idea how to setup it using incus. I have tried using the network but this one doesn’t accept the mtu setting (which it should according the doc). What is wrong in my command ?

I fixed the error but still can’t set the mtu :frowning:

benoitc@hv1:~$ incus config device add router eth0 nic nictype=sriov parent=ens1f0v1 mtu=9000
Error: Invalid devices: Device validation failed for "eth0": Invalid device option "mtu"

The says we can though

Is this a virtual machine?

There is currently a check which disables the mtu property for virtual machines, likely because there was no good way to provide that MTU value to the guest. This has changed these days as we have agent.nic_config which when enabled allows passing that data through.

I’ll make sure that the MTU property does make it through to the agent in the normal case and if that’s true, I’ll remove that check for sriov.

@stgraber that’s correct, this is a virtual machine. OK in between i am attempting to set it manually when the machines comes :slight_smile:

Yeah, even with the fix, it’s basically what will happen, the agent will start on boot and set the MTU for you, but systemd-networkd, network-manager or anything else may still go and mess it up afterwards, so putting the correct value in your config to begin with is likely preferred.

I’ve confirmed that in non-sriov case this works fine, so the check can safely be removed, I’ll send a PR.

1 Like