cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1556
Views
0
Helpful
2
Replies

rename device with services attached

ryan-hitch
Level 4
Level 4

Is there a way to rename a device that has python services attached without removing the device from the service?

I have tried the following, but my Python service code seems to not like it:

rename devices device originalname newname

rename vpn-environment VPN1 site originalname newname

commit no-networking

Aborted: Python cb_create error. item does not exist (1): No capabilities found for device: newname. Has a sync-from the device been performed?

Is there a way around this without causing a service interruption by removing/re-adding the device to associates services?

I see that this question has been raised before and the recommendation of changing the device name and then "commit no-networking" appears to be the way to go, however my service code seems to be having trouble with this.

How to copy/rename device from cli?

I can do the following, but have an issue with the id-allocator:

- rename device

- remove associated services with "commit no-networking"

- fetch-host-keys and sync-from new device name

- re-add device to services, however because I have a service that uses id-allocator to allocate IDs it may not be assigned the same IDs which will be an issue

Or I could do the following which would cause a service interruption:

- rename device

- remove associated service with "commit"

- fetch-host-keys and sync-from new device name

- re-add device to services

1 Accepted Solution

Accepted Solutions

ryan-hitch
Level 4
Level 4

I went ahead and did the following, which works, but is a bit cumbersome:

- Make sure to note allocated IDs from associated id-pool

- Delete associated services, then "commit no-networking"

- Rename device(s), then "commit no-networking"

- Fetch ssh keys and sync-from the new devices

- Re-add services, manually specifying the IDs from the previous id-pools so that the same IDs get assigned, then "commit no-networking"

- Activate services, checking with a "commit dry-run" to make sure that I got everything right and NSO does not need to push any changes to the devices

View solution in original post

2 Replies 2

ryan-hitch
Level 4
Level 4

I went ahead and did the following, which works, but is a bit cumbersome:

- Make sure to note allocated IDs from associated id-pool

- Delete associated services, then "commit no-networking"

- Rename device(s), then "commit no-networking"

- Fetch ssh keys and sync-from the new devices

- Re-add services, manually specifying the IDs from the previous id-pools so that the same IDs get assigned, then "commit no-networking"

- Activate services, checking with a "commit dry-run" to make sure that I got everything right and NSO does not need to push any changes to the devices

Hi Ryan

      Any clue if this rename action is exposed through RESTCONF as well by NSO ?
So that users can call this API from outside NSO through RESTCONF?