We are trying to design a simple VPN service that will use resource-manager to handle VPN ID. We created the new package using python-and-template skeleton. We added resource-manager as an additional package and configured resource-pool for our VPN IDs.
In the service callback function for cb_create we implemented allocating VPN_ID using two example python functions if_request and id_read.
Allocating VPN ID for the new service works fine. Allocating specific VPN ID for new service also works fine but we would like to be able to change the VPN ID. This is where it gets complicated. There is no function to return allocated ID to the pool and If I try to allocate new specific ID for the existing service, I always get initial allocated VPND_ID value returned.
So my question is:
Is changing assigned ID values even possible in resource manager?
If yes, what would be the workflow we need to do to achieve this. Deleting the service and created it again it seems like overkill.
The reason for this is that allocation is a three-step process:
1. Write request
2. Allocation is made
3. Read response
Now if you UPDATE a request the response will already be there so you will read the old response rather than the old one. This is very unfortunate, but there are some possible workarounds.
The simplest workaround is to make the key you use in id_request/id_read depend on the input. So that you might today call it vlanid_vpnX or something like that, you could instead call it vlanid_vpnX_static9 (if 9 is your static number) or vlanid_vpnX_dynamic. This will trick the system into making a new fresh allocation.
If you change the value, the service will be re-deployed and will read the new value.
- if you want your ID to be re-assigned from the pool, I guess that means that the old value is not longer valid to be used in this pool. The process then is to exclude the old value from the pool: /ralloc:resource-pols/id-pool/exclude
The resource allocation logic will react by re-allocating a new value (from the pool) and re-deploy the service.
What you describe looks like the correct Fastmap behavior.
Now, I am not very sure what you are trying to achieve, maybe something like this inside your create code, where if the vlan_id is assigned by the northbound API, it is used in the request to the resource allocator as a fix value. If no vlan_id is set, a random value from the pool is requested.
I hope this helps!
if service.vlan_id: id = service.vlan_id
id = id_allocator.id_read(tctx.username, root,
if not id:
self.log.info("Alloc not ready")
self.log.info('id = %s' % (id))
SW upgrade or migration is something you never can escape from so it's better to make it part of your process. The remaining challenge is to determine when to give up what has been working to secure your future needs. Martin and the NSO team will guide y...
There is not a single golden tool that fits all purposes simply because development processes and needs are different. Instead, pick the tooling you need from the Smörgåsbord and build your environment to suit your needs. Shashidhar will guide you throug...
How Verizon Streamlined NSO Development with Continuous Integration
This is a customer success story of how Verizon ITNUC builds a CI chain to streamline the NSO development process. The containerized NSO makes testing several NSO packages in para...
It is best practice to avoid storing your secrets (e.g., passwords and shared keys) in plain text, either on NSO or on the device. In NSO, we support multiple encrypted data types that are encrypted using a local key. Similarly, many devices such as Cisco...