cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
738
Views
5
Helpful
2
Replies

Change de key of a List

Gastonper
Level 1
Level 1

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?

2 Accepted Solutions

Accepted Solutions

Gastonper
Level 1
Level 1

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

 

View solution in original post

rogaglia
Cisco Employee
Cisco Employee

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.

View solution in original post

2 Replies 2

Gastonper
Level 1
Level 1

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

 

rogaglia
Cisco Employee
Cisco Employee

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.

Getting Started

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: