07-02-2018 10:33 AM - edited 03-01-2019 04:11 AM
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
Solved! Go to Solution.
07-03-2018 06:07 AM
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
07-03-2018 06:07 AM
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
11-24-2021 12:26 AM
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?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide