Nautobot v2.0¶
This document describes all new features and changes in Nautobot 2.0.
If you are a user migrating from Nautobot v1.X, please refer to the "Upgrading from Nautobot v1.X" documentation.
Release Overview¶
Added¶
Generic Role Model (#1063)¶
DeviceRole, RackRole, IPAM Role, and IPAddressRoleChoices have all been merged into a single generic Role model. A role can now be created and associated to one or more of the content-types that previously implemented role as a field. These model content-types include dcim.device, dcim.rack, virtualization.virtualmachine, ipam.ipaddress, ipam.prefix, and ipam.vlan.
Added Site Fields to Location (#2954)¶
Added Site Model Fields to Location. Location Model now has asn, comments, contact_email, contact_name, contact_phone, facility, latitude, longitude, physical_address, shipping_address and time_zone fields.
Changed¶
Collapse Region and Site Models into Location (#2517)¶
Initial Data Migration¶
The Site and Region models have been removed in v2.0 and have been replaced with Location of specific LocationType. As a result, the existing Site and Region data will be migrated to corresponding LocationType and Location objects. Here is what to expect:
- If you do not have any
SiteandRegioninstances in your existing database, running this data migration will do nothing. - If you only have
Regioninstances in your existing database, aLocationTypenamed Region will be created and for each legacyRegioninstance, a correspondingLocationinstance with the same attributes (name,description, etc.) and hierarchy will be created. -
If you only have
Siteinstances in your existing database:-
A
LocationTypenamed Site will be created and every preexisting root levelLocationTypein your database will be updated to have the new SiteLocationTypeas their parent. -
For each legacy
Siteinstance, a correspondingLocationinstance with the same attributes (name,description,tenant,facility,asn,latitude,longitude, etc.) will be created, and any preexistingLocationsin your database will be updated to have the appropriate "site"Locationsas their parents. -
Model instances that had a
sitefield (CircuitTermination,Device,PowerPanel,RackGroup,Rack,Prefix,VLANGroup,VLAN,Cluster) assigned and did not have alocationattribute assigned will be updated to have theirlocationpoint to the newLocationcorresponding to thatSite. All other attributes on these models will remain unchanged.
For Example:
-
We will start with a
Siteinstance with name AMS01 as the baseSitefor two top-levelLocationobjects with names root-01 and root-02 respectively. -
During the data migration, a
LocationTypenamed Site will be created, and aLocationof SiteLocationTypenamed AMS01 with all the information (asn,latitude, etc.) from the baseSitewill be created. -
The
Locationobjects named root-01 and root-02 will have this AMS01Locationset as theirparent.
-
-
If you have both
SiteandRegioninstances in your existing database:-
A
LocationTypenamed Region will be created. -
For each legacy
Regioninstance, a correspondingLocationinstance with the same attributes (name,description, etc.) will be created. -
A
LocationTypenamed Site will be created with the newLocationTypenamed Region set as itsparent. -
Every pre-existing root-level
LocationTypein your database will be updated to have the newLocationTypenamed Site as itsparent. -
For each legacy
Siteinstance, a corresponding "site"Locationinstance with the same attributes (name,description,tenant,facility,asn,latitude,longitude, etc.) will be created with its parent set to the corresponding "region"Locationif any.- If you have
Siteinstances in your database without aRegionassigned to them, one additionalLocationnamed Global Region ofLocationTypeRegion will be created and eachLocationofLocationTypeSite created from the legacy region-lessSiteinstances will have the Global RegionLocationas their parent.
- If you have
-
Model instances that had a
siteattribute (CircuitTermination,Device,PowerPanel,RackGroup,Rack,Prefix,VLANGroup,VLAN,Cluster) assigned and did not have alocationattribute assigned will be updated to have theirlocationpoint to the newLocationofLocationTypeSite. All other attributes on these models will remain unchanged.
For Example:
-
There are two
Siteinstances and oneRegioninstance in your existing database. TheRegionwith name America has one childSiteinstance named AMS01. And the otherSiteinstance named AUS01 is not associated with anyRegion(regionattribute is set toNone). -
The
SiteAMS01 is the baseSitefor two top-levelLocationobjects with names root-01 and root-02 respectively. -
During the data migration, a
LocationTypenamed Region and aLocationof thisLocationTypenamed America with all the same information will be created. -
The
LocationTypenamed Site with itsparentset as the newLocationTypeRegion and aLocationofLocationTypenamed AMS01 with all the same information (asn,latitude, etc.) will be created. TheLocationAMS01 will haveLocationAmerica as itsparentand each -Locationroot-01 and root-02 will haveLocationAMS01 as itsparent. -
Finally, the
Siteinstance AUS01, since it does not have aRegioninstance associated with it, its correspondingLocationAUS01 will have a newLocationnamed Global Region ofLocationTypeRegion as itsparent. -
In addition, legacy
Siteinstance with name AMS01 also has threeDeviceinstances associated with it named ams01-edge-01, ams01-edge-02, and ams01-edge-03. -
However, ams01-edge-01 only has its
siteattribute set asSiteAMS01 whereas ams01-edge-02 and ams01-edge-03 have both itssiteandlocationattributes setSiteAMS01 andLocationroot-01 respectively. -
During the data migration, ams01-edge-01's
locationattribute will point to the newLocationofLocationTypeSite with name AMS01 while devices ams01-edge-02 and ams01-edge-03 will remain unchanged.
-
Collapsed nautobot.utilities into nautobot.core (#2721)¶
nautobot.utilities no longer exists as a separate Python module or Django app. Its functionality has been collapsed into the nautobot.core app. See details at Python Code Location Changes.
Renamed Database Foreign Keys and Related Names (#2520)¶
Some Foreign Key fields have been renamed to follow a more self-consistent pattern across the Nautobot app. This change is aimed to offer more clarity and predictability when it comes to related object database operations:
For example in v1.x to create a circuit object with type "circuit-type-1", you would do:
Circuit.objects.create(
cid="Circuit 1",
provider="provider-1",
type="circuit-type-1",
status="active",
)
and to filter Circuit objects of type "circuit-type-2", you would do:
Now in v2.x, we have renamed the Foreign Key field type on Circuit Model to circuit_type, because this naming convention made it clearer that this Foregin Key field is pointing to the model CircuitType. The same operations would look like:
Circuit.objects.create(
cid="Circuit 1",
provider="provider-1",
circuit_type="circuit-type-1",
status="active",
)
Check out more Foreign Key related changes documented in the table Renamed Database Fields
In addition to the changes made to Foreign Key fields' own names, some of their related_names are also renamed:
For example in v1.x, to query Circuit objects with CircuitTermination instances located in sites ["ams01", "ams02", "atl03"], you would do:
Now in v2.x, we have renamed the Foreign Key field circuit's related_name attribute terminations on CircuitTermination Model to circuit_terminations, the same operations would look like:
Check out more related-name changes documented in the table Renamed Database Fields
Renamed Filter Fields (#2804)¶
Some filter fields have been renamed to reflect their functionalities better.
For example in v1.X, to filter FrontPorts that has a cable attached in the UI or make changes to them via Rest API, you would use the cabled filter:
/dcim/front-ports/?cabled=True
Now in v2.x, you would instead use the has_cable filter which has a more user-friendly name:
/dcim/front-ports/?has_cable=True
Check out the specific changes documented in the table at UI and REST API Filter Changes
Enhanced Filter Fields (#2804)¶
Many filter fields have been enhanced to enable filtering by both slugs and UUID primary keys.
For example in v1.X, to filter Regions with a specific parent value in the UI or make changes to them via Rest API, you are only able to input slugs as the filter values:
/dcim/regions/?parent=<slug>
Now in v2.x, you are able to filter those Regions by slugs or UUID primary keys:
/dcim/regions/?parent=<slug> or /dcim/regions/?parent=<uuid>
Check out the specific changes documented in the table at UI and REST API Filter Changes
Corrected Filter Fields (#2804)¶
There were also instances where a foreign-key related field (e.g. console_ports) was incorrectly mapped to a boolean membership filter (e.g. has_console_ports), making it impossible to filter based on specific values of the foreign key:
For example in v1.x:
/dcim/devices/?console_ports=True and /dcim/devices/?has_console_ports=True are functionally the same and this behavior is incorrect.
This has been addressed in v2.x as follows:
console_ports and similar filters are taking foreign key UUIDs as input values and can be used in this format: /dcim/devices/?console_ports=<uuid> whereas has_console_ports and similar filters remain the same.
Check out the specific changes documented in the table at UI and REST API Filter Changes
Generic Role Model (#1063)¶
The DeviceRole, RackRole, ipam.Role, and IPAddressRoleChoices have all been removed and replaced with a extras.Role model, This means that all references to any of the replaced models and choices now points to this generic role model.
In addition, the role field of the IPAddress model has also been changed from a choice field to a foreign key related field to the extras.Role model.
Removed¶
Removed Redundant Filter Fields (#2804)¶
As a part of breaking changes made in v2.X, shadowed filter/filterset fields are being removed throughout Nautobot.
In Nautobot 1.x, for some of the foreign-key related fields:
- The field was shadowed for the purpose of replacing the PK filter with a lookup-based on a more human-readable value (typically slug, if available).
- A PK-based filter was available as well, generally with a name suffixed by _id
Now these two filter fields will be replaced by a single filter field that can support both slugs and UUID primary keys as inputs; As a result, PK-based filters suffixed by _id will no longer be supported in v2.0.
For example in v1.X, to filter Devices with a specific site value in the UI or make changes to them via Rest API with a UUID primary key, you will use:
/dcim/devices/?site_id=<uuid>
Now in v2.x, that format is no longer supported. Instead, you would use:
/dcim/devices/?site=<uuid>
Check out the specific changes documented in the table at UI and REST API Filter Changes
Removed RQ support (#2523)¶
Support for RQ and django-rq, deprecated since Nautobot 1.1.0, has been fully removed from Nautobot 2.0.
v2.0.0-alpha.1 (2023-01-31)¶
Added¶
- #204 - Added style guide documentation for importing python modules in Nautobot.
- #1731 - Added missing filters to
circuitsapp. - #1733 - Added support for filtering on many more fields to the
TenantandTenantGroupfiltersets. - #2954 - Added fields (
contact_name,latitude, etc.) fromSitemodel toLocationmodel to prepare for merging all sites into locations. - #2955 - Added "Region" and "Site"
LocationTypesand their respective locations based on existingSiteandRegioninstances. - #3132 - Added the ability for apps to register their models for inclusion in the global Nautobot search.
Changed¶
- #204 - Changed imports to use module namespaces in
utilities/filters.py. - #510 - The
Region,RackGroup,TenantGroup, andInventoryItemmodels are now based ondjango-tree-queriesinstead ofdjango-mptt. This does change the API for certain tree operations on these models, for exampleget_ancestors()is nowancestors()andget_descendants()is nowdescendants(). - #510 - The UI and REST API for
Region,RackGroup, andTenantGroupnow provide only the related count of objects (e.g.site_countforRegion) that are directly related to each instance. Formerly they provided a cumulative total including objects related to its descendants as well. - #510 - Renamed field
_depthtotree_depthin the REST API forRegion,RackGroup,TenantGroup, andInventoryItem. - #510 - Renamed InventoryItem database relation
child_itemsand filter fieldschild_itemsandhas_child_itemstochildrenandhas_childrenrespectively. - #2163 -
JobLogEntry.log_object,JobLogEntry.absolute_url,ScheduledJob.queue, andWebHook.ca_file_pathno longer permit null database values; use""instead if needed. - #2822 - Collapsed
DeviceRole,RackRole, IPAMRolemodel andIPAddressRoleChoicesinto a single genericRolemodel. - #2674 - Updated development dependency
blackto~22.10.0. - #2721 - Collapsed
nautobot.utilitiesintonautobot.core. Refer to the 2.0 migration guide for details. - #2771 - Updated
jsonschemaversion to~4.17.0. - #2788 - Changed REST framework allowed versions logic to support 1.2-1.5 and 2.0+.
- #2803 - Updated
mkdocs-include-markdown-pluginto3.9.1. - #2809 - Renamed
tagfilter onTenantFilterSettotagssame as elsewhere. - #2844 - Updated development dependency
mkdocstrings-pythonto 0.8.0. - #2872 - Refactored imports in
utilitiesapp to follow new code style. - #2883 - Updated
django-taggitto3.1.0. - #2942 - Updated
django-tree-queriesto0.13.0. - #2943 - Updated dependency
richto~12.6.0. - #2955 - Changed
CircuitTermination,Device,PowerPanel,RackGroup,Rack,Prefix,VLANGroup,VLAN,Clusterinstances associated with existingSitemodel instances to use the newly created correspondingLocationsofLocationType"Site". - #2993 - Implemented initial database backend for Celery task results.
- #3027 - Updated dependencies
prometheus-client,django-storages,drf-spectacular,black,django-debug-toolbar,mkdocstrings,mkdocstrings-python,pylint,requests,selenium,watchdog. - #3068 - Renamed fields on
Circuitmodel:typetocircuit_type,terminationstocircuit_terminations,termination_atocircuit_termination_a, andtermination_ztocircuit_termination_z. - #3068 - Renamed reverse-relation
circuitterminationtocircuit_terminationson theCablePathmodel. - #3068 - Renamed
groupfield tovlan_groupon VLAN model, renamedipaddressestoip_addressesonServicemodel. - #3068 - Renamed
groupfield totenant_grouponTenantmodel. - #3069 - Renamed foreign key fields and related names in Virtualization and DCIM apps to follow a common naming convention. See v2 upgrade guide for full list of changes.
- #3177 - Updated
VLANFactoryto generate longer and more "realistic"VLANnames.
Fixed¶
- #1982 - Fixed a UI presentation/validation issue with dynamic-groups using foreign-key filters that aren't explicitly defined in the corresponding FilterForm.
- #2808 - Fixed incorrectly named filters in
circuitsapp. - #3126 - Fixed
Interfacenot raising exception when adding aVLANfrom a differentSiteintagged_vlans. - #3153 - Made integration test
CableConnectFormTestCase.test_js_functionalitymore resilient and less prone to erroneous failures. - #3167 - Fixed
ObjectChangerecords not being migrated andlegacy_role__namenot being a property inRolemigrations. - #3177 - Fixed a spurious failure in
BulkEditObjectsViewTestCase.test_bulk_edit_objects_with_constrained_permission.
Removed¶
- #510 - Removed dependency on
django-mptt. Models (Region,RackGroup,TenantGroup,InventoryItem) that previously were based on MPTT are now implemented usingdjango-tree-queriesinstead. - #1731 - Removed redundant filters from
circuitsapp. - #2163 - Removed unused
NullableCharField,NullableCharFieldFilterandMACAddressField(not to be confused withMACAddressCharField, which remains) classes. - #2523 - Removed
django-rqdependency and support for RQ workers. - #2815 - Removed
pycryptodomedependency as it is no longer used. - #2993 - Removed
NAUTOBOT_CELERY_RESULT_BACKENDenvironment variable used to customize where Celery stores task results. - #2993 - Removed optional settings documentation for
CELERY_RESULT_BACKENDas it is no longer user-serviceable. - #2993 - Removed optional settings documentation for
CELERY_RESULT_BACKEND_TRANSPORT_OPTIONSas it is no longer user-serviceable. - #3130 - Removed
CSS_CLASSESdefinitions from legacyChoiceSets.