Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for Netbox 2.7 #209

Merged
merged 8 commits into from
Jan 20, 2020
Merged

Prepare for Netbox 2.7 #209

merged 8 commits into from
Jan 20, 2020

Conversation

cimnine
Copy link
Collaborator

@cimnine cimnine commented Dec 16, 2019

Related Issue: N/A

New Behavior

Netbox 2.7 will support different Redis instances for caching and webhook queuing.
Therefore a second Redis server is added for caching.
This second Redis server does not persist it's data.

Contrast to Current Behavior

Currently only one Redis server serves both purposes, caching and webhook queuing.
But the two purposes have different requirements for the Redis server.
E.g. we don't want the webhooks to be lost when "the power goes out". Yet for the caching Redis we don't care about persistence, as the cache can be (and probably has to be) re-populated anyways.

Then the caching Redis is local to one instance of Netbox, whereas the webhook queue Redis is shared by at least two clients, the Netbox web instance and the Netbox rqworker instance.

The updated configuration is made in a backward-compatible way, so that users upgrading from previous versions of Netbox Docker, that don't update the docker-compose.yml file, should not have to adjust anything in their setup, although I would recommend anyone to do so.

Discussion: Benefits and Drawbacks

The drawbacks with two Redis's is of course that it takes a little bit more compute resources and the architecture became a little bit more complex to understand.
But at least from this project's perspective, if a user is getting started, he/she will not have to care about that, because it will just work out of the box, as it did in the past.

Changes to the Wiki

None. It is technically not even a breaking change.

@cimnine cimnine added this to the 0.17.0 milestone Dec 16, 2019
@cimnine cimnine changed the title Prepare for Netbox 2.7 WIP: Prepare for Netbox 2.7 Dec 16, 2019
@cimnine cimnine added the maintenance The issue describes a maintenance task, such as upgrading a dependency to a certain version. label Dec 20, 2019
@TeroPihlaja
Copy link

Any change of getting this merged?

@cimnine
Copy link
Collaborator Author

cimnine commented Jan 17, 2020

I know that 2.7 of Netbox was released and that Netbox Docker doesn't work out of the box with it right now. We will try to get it out as soon as possible.

But frist, we'll merge #212 to release 0.20.0 of this project. Then we'll begin merging other PRs in the develop branch. But there is no ETA since this work is all voluntary and we all have day-jobs as well.

What you can do in the meantime is to build your own Docker Image. Switch to the branch of this PR (git switch 2.7-prep) and follow the guide to extend the base image. I.e. you create a new Dockerfile 27workaround.Dockerfile, add something like the following, and run docker build -f 27workaround.Dockerfile -t netbox:2.7-fixed ..

FROM netboxcommunity/netbox:v2.7

COPY configuration/configuration.py /etc/netbox/config/configuration.py

@cimnine cimnine force-pushed the 2.7-prep branch 3 times, most recently from 29495be to d74e1a3 Compare January 17, 2020 16:28
@cimnine
Copy link
Collaborator Author

cimnine commented Jan 17, 2020

This afternoon I was working hard on getting out scripts and configurations ready for Netbox 2.7.
On my local machine, Netbox 2.7 starts when built from this branch and all the initializers do their job.

That is, there are several breaking changes to the initializers themselves. But I believe that they will be more stable now, as they don't rely on iterating through special lists anymore. This should make our initializers more generic and therefore more robust when future changes occur upstream.

Note: This PR should be rebased onto develop once #221 and #222 are merged.

This was referenced Jan 18, 2020
The custom field database model has changed in Netbox 2.7.
Therefore the initializer code, that was used before, broke.
As a user, you will need to update your custom_fields.yml file as
follows:

- type must be lowercase
  - the `selection` type was changed to `select`
- the filter_logic must be lower case

This is to achieve compatibility with the naming schema that
Netbox uses internally. It allows us to become forward compatible
in case Netbox ever introduces a new type for custom fields.

See the diff of this commit for further information how this is meant.
The rack database model has changed in Netbox 2.7.
Therefore the initializer code, that was used before, broke.
As a user, you will need to update your racks.yml file as follows:

- Rack types must match one of the 5 rack types given, e.g.
  '4-post-cabinet'.
- Rack width must match one of the 2 rack widths given, i.e. '19' or
  '23'.

See the diff of this commit for further information how this is meant.
The device database model has changed in Netbox 2.7.
Therefore the initializer code, that was used before, broke.
As a user, you will need to update your devices.yml file as
follows:

- Make sure the rack face is spelled lowercase.

See the diff of this commit for further information how this is meant.
The VLAN database model has changed in Netbox 2.7.
Therefore the initializer code, that was used before, broke.
As a user, you will need to update your vlans.yml file as follows:

- Make sure the status is spelled lowercase.

See the diff of this commit for further information how this is meant.
The vm database model has changed in Netbox 2.7.
Therefore the initializer code, that was used before, broke.
As a user, you will need to update your virtual_machines.yml
file as follows:

- Make sure the status is spelled lowercase.

See the diff of this commit for further information how this is meant.
The interface database model has changed in Netbox 2.7.
Therefore the initializer code, that was used before, broke.
As a user, you will need to update your dcim_interfaces.yml
file as follows:

- Make sure the type is a value out of the possible choices.

See the diff of this commit for further information how this is meant.
The ip address database model has changed in Netbox 2.7.
Therefore the initializer code, that was used before, broke.
As a user, you will need to update your ip_addresses.yml
file as follows:

- Make sure the status is written in lower case.

See the diff of this commit for further information how this is meant.
@cimnine cimnine changed the title WIP: Prepare for Netbox 2.7 Prepare for Netbox 2.7 Jan 20, 2020
@cimnine
Copy link
Collaborator Author

cimnine commented Jan 20, 2020

This PR was now rebased onto #221 and #222. The tests for python 3.9 fail, but that doesn't matter at the moment because this is an issue with Netbox and Python 3.9 won't be GA for a while.

Given that, I believe this PR is ready to be merged.

@cimnine cimnine requested a review from tobiasge January 20, 2020 07:58
@cimnine cimnine mentioned this pull request Jan 20, 2020
@cimnine cimnine merged commit 8caf755 into develop Jan 20, 2020
@cimnine cimnine deleted the 2.7-prep branch January 20, 2020 09:26
@cimnine cimnine mentioned this pull request Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance The issue describes a maintenance task, such as upgrading a dependency to a certain version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants