Bug 258164 - net-mgmt/netbox: can not assign net interface to virtual machine
Summary: net-mgmt/netbox: can not assign net interface to virtual machine
Status: Closed Works As Intended
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Kai Knoblich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-30 08:02 UTC by O. Hartmann
Modified: 2022-02-19 16:58 UTC (History)
0 users

See Also:
kai: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2021-08-30 08:02:58 UTC
net-mgmt/netbox v2.11.11 as of today fails since a couple of months for now to be capable of assigning a network interface to a virtual machine.

I can't say when this has been "introduced" to FreeBSD's port. A couple of months ago, we created VMs in netbox an we were capable of assigning a vNIC and then the appropriate IP. This is no longer possible.
Comment 1 Kai Knoblich freebsd_committer freebsd_triage 2021-08-30 09:08:47 UTC
(In reply to O. Hartmann from comment #0)

Thank you for the report.  I tried to reproduce it in my test environment, but it worked fine for me with NetBox 2.11.11 so far.

I was able to create a new VM with a NIC and assign an IP address to it via the web interface.  But I do remember, however, that NetBox 2.9 had a significant change related to VM interfaces.

In order to better isolate the problem, I need a few more information:

- Does the problem occur via the web interface or via scripting?

- What is the error message that is being generated?
Comment 2 Kai Knoblich freebsd_committer freebsd_triage 2021-11-22 13:06:22 UTC
(In reply to O. Hartmann from comment #0)

I haven't received any further info yet (see comment #1).  NetBox 3.0 has been in the Ports tree for a while and maybe that release solves the reported issue?
Comment 3 Kai Knoblich freebsd_committer freebsd_triage 2021-12-19 14:51:52 UTC
I will now close this with "Unable to reproduce". If the issue still persists, please re-open this bug.
Comment 4 O. Hartmann 2021-12-20 11:51:55 UTC
I opened the problem, since it is persistent on a couple of boxes and still present with the latest port upgrade of netbox.

The problem seems to be related to all databses/installations of netbox prior to a certain date and the phenomenon is the same: newly created virtual machines do not have any knob/requester/menu to assign a NIC and therefore I can not assign any IP. Even if cloning from those virtual machines were i was able to assign a NIC and IP, the options vanishes on the new VM.

Since this is not a unique problem to one box, I guess there is a major problem when the netbox installation is migrated smoothly with the suggested procedures.
Comment 5 Kai Knoblich freebsd_committer freebsd_triage 2021-12-20 13:53:45 UTC
(In reply to O. Hartmann from comment #4)

If I understand you correctly then the following scenario is present:

a) VMs that already exist -> NICs can be added/modified without issues (= menu button is present)

b) VMs that were newly created -> No NICs can be added (= menu button to add interfaces is missing)

c) New VMs that were cloned from existing ones -> Same issue as in b) above

d) NetBox release in use: 3.0.12


Could you please tell me the last known good NetBox release, which worked fine for you, as well?  I would then try to take a closer look at the relevant database migrations of the individual NetBox releases.
Comment 6 O. Hartmann 2022-01-10 09:37:55 UTC
(In reply to Kai Knoblich from comment #5)

Hello,
thank you for assisting.

Existing VMs prior to some obscure changes making netbox behave like reportet do have the option to add IPs and interfaces. That option is completely missing in newly created VMs.

I regret, I can't tell when the last version of netbox worked, but it is quite a time that has passed. But the problem persitet a long time prior to this report (about months ...).

Searching github for some similar problems revealed, that there was a change somewhere in 2020, when the model of a host and vm has changed.
Comment 7 O. Hartmann 2022-02-16 11:09:49 UTC
The problem has been identified and seems to be related to the access rights given to a certain group. I guess in the vain of development and progress the handling of several ACL has been changed since the last thing I changed was the ACL for a administrative group.
By accessing the netbox via superuser I was able to add an interface to a VM and netbox works in that part as intended.
Accessing the the netbox as an user with "superuser rights" (checked explicitely) now gives this user the ability to add interfaces, too.
I guess the progress in versions fixed some sloppy checking on that or we made a mistake unnoticed so far.

Closing the PR with "works as intended".
My fault.

Kind regards,
oh
Comment 8 Kai Knoblich freebsd_committer freebsd_triage 2022-02-19 16:58:00 UTC
(In reply to O. Hartmann from comment #7)

That's interesting and I'm happy to hear that the issue could be resolved.  Thanks for sharing of the solution!