04-16-2021 06:50 AM - edited 04-16-2021 06:57 AM
Hi,
I need to be able to change the keys of a service instance. Since its not possible to change the keys of a list in yang, i made an action that create a new instance of the service with the new keys and same elements, and delete the old one.
This action has no impact on the network, since the keys of mi list are only for identification, and are not used for configuration in any way.
The problem is this:
- If I use two transaction in the action, one for delete the old service, and one to create the new one: NSO delete the configuration in the network and create it again with the same comands. Wich it works, but is not very effective.
- If I use the same transaction: The order of ejecution in the transaction seems to be alphabetical, so it may happen that NSO try to configurate the new service before deleting the old one, giving error (My service do a verification that dont allows two or more service use the same resources)
Is any way of telling NSO that always delete the service A before creating the service B, but do all in the same transaction?
Solved! Go to Solution.
04-16-2021 08:52 AM
Ok, so I find a solution, so I will answer myself for the record:
I did it witth 3 transactions:
1 - Delete service A with commit-no-networking param.
2 - Create service B with commit-no-networking param.
3 - Do a partial-sync-from and then a redeploy
04-19-2021 06:47 AM
On this:
"- If I use the same transaction: The order of ejecution in the transaction seems to be alphabetical, so it may happen that NSO try to configurate the new service before deleting the old one, giving error (My service do a verification that dont allows two or more service use the same resources)"
If this is a pure FASTMAP service and you "delete an instance and create a new one", it is one of the magic that NSO perform automatically and only the min changes are pushed to the devices in the right order. In your case, no changes. So, your "verification" code may be to blame. Moreover, you should be using "validation" callbacks that would work without this problem.
04-16-2021 08:52 AM
Ok, so I find a solution, so I will answer myself for the record:
I did it witth 3 transactions:
1 - Delete service A with commit-no-networking param.
2 - Create service B with commit-no-networking param.
3 - Do a partial-sync-from and then a redeploy
04-19-2021 06:47 AM
On this:
"- If I use the same transaction: The order of ejecution in the transaction seems to be alphabetical, so it may happen that NSO try to configurate the new service before deleting the old one, giving error (My service do a verification that dont allows two or more service use the same resources)"
If this is a pure FASTMAP service and you "delete an instance and create a new one", it is one of the magic that NSO perform automatically and only the min changes are pushed to the devices in the right order. In your case, no changes. So, your "verification" code may be to blame. Moreover, you should be using "validation" callbacks that would work without this problem.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: