I am trying to find an easy way to remove a device from NSO when the device is assigned to certain device groups or services. We are using NSO to manage a client's network and we recently started deploying services to push configuration changes. As the client's network is a brownfield, there are devices that need to be decommissioned. When that happens we need to remove them from NSO.
If I try using the command
no devices device <device-name>
after I run
I get an error saying.
Aborted: illegal reference 'devices device-group <group-name> device-name'
The same happens with devices associated with services. It seems like NSO is asking me to remove the device from the services and the device groups first, and then remove the device from NSO. That seems quite cumbersome when we are trying to deploys several services to devices and we may find ourselves decommissioning devices in the future.
Is there a command or a script that can be used to remove a device and all of its references in one go from NSO?
you have to remove the device from the group <group-name> first, by updating the device-group:
(config) devices device-group <group-name> device-name [ device1 device2 device3 ]
@atriyant, that is actually what we already figured out and where our issue stands. Because of the large network that we help manage, we will devices belonging to several device groups and services, so if one device needs to be removed, it could take some time to identify and remove the device form those groups and services.
Our plan is to create a script that can do this operation automatically, but before doing that we wanted to check if someone in the community had already worked on this.
It would be interesting for us/me to understand what sort of behavior you would have expected. NSO will never tolerate a configuration that violates the YANG model (e.g. with dangling pointers), so what would you have liked the system to do in this situation?
The behavior that we were expecting was for NSO to automatically recognize what dangling pointers a change would create and ask the user if it was OK to remove them, rather than having the user manually find them and remove them before removing the device. That would preserve the YANG model and provide a useful feature to users that need to remove devices from NSO. It is possible for us to script that functionality ourselves, but I wanted to check if it was already available. From our prospective, this is a very common use case, but if that is not the case from your prospective, I can understand why it was not implemented.