-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a SONiC configuration management service #3227
Conversation
Signed-off-by: Rajendra Dendukuri <rajendra.dendukuri@broadcom.com>
Signed-off-by: Rajendra Dendukuri <rajendra.dendukuri@broadcom.com>
retest broadcom please |
config-setup post migration hooks help user to migrate configurations from old image to new image. If the installed hooks are user defined they will not be part of the newly installed image. So these hooks have to be migrated to new image and only then they can be executing when the new image is booting. The changes in this fix migrate config-setup post-migration hooks and ensure that any hooks with the same filename in newly installed image are not overwritten. It is expected that users install new hooks as per their requirement and not edit existing hooks. Any changes to existing hooks need to be done as part of new image and not post bootup.
PR#3549 - enhance update graph handling
reload_minigraph() | ||
{ | ||
echo "Reloading minigraph..." | ||
if [ ! -f /etc/sonic/init_cfg.json ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't the command "config reload or config load -m <>" be used ?
This code here replicated steps from load_minigraph() function in sonic-utilities/config/main.py
If someone updates that part, they should also be updating it here. Doing it like this opens doorway to config load getting out of sync between "config load" and through ztp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scope of this change was to move the code from graphservice to config-setup service keeping the functionality as is for most part. Changing logic to use "config load" and "config load_mingraph" can be done as part of a different PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rameshsanth Can you please let me know if we have an agreement on this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @rameshsanth , created an issue #3227 to merge load_minigraph in config-setup and update_minigraph and assigned to you. @rajendra-dendukuri
retest vsimage please |
…#715) Used "config-setup backup" command to take a backup copy of current SONiC configuration. Refer to sonic-net/SONiC#433 and sonic-net/sonic-buildimage#3227 for more information Added skip_migration option to "sonic_installer install" command to allow user to install an image with factory default configuration. Signed-off-by: Rajendra Dendukuri <rajendra.dendukuri@broadcom.com>
* Create a SONiC configuration management service * Perform config db migration after loading config_db.json to redis DB * Migrate config-setup post migration hooks on image upgrade config-setup post migration hooks help user to migrate configurations from old image to new image. If the installed hooks are user defined they will not be part of the newly installed image. So these hooks have to be migrated to new image and only then they can be executing when the new image is booting. The changes in this fix migrate config-setup post-migration hooks and ensure that any hooks with the same filename in newly installed image are not overwritten. It is expected that users install new hooks as per their requirement and not edit existing hooks. Any changes to existing hooks need to be done as part of new image and not post bootup.
@rajendra-dendukuri any suggestion about how to add a customer hook scripts? by the way, I didn't see a folder "/etc/config-setup/" and it's subfolders on a sonic switch with the latest 201911 image installed? |
@keboliu That is correct. The provision has been added but there are no hook scripts that have been added as of now. Something like below can be added to files/build_templates/sonic_debian_extension.j2. https://gist.github.com/rajendra-dendukuri/8481dc4025b8329416cfd91deca2d1a6 |
…c-net#3227) * Create a SONiC configuration management service * Perform config db migration after loading config_db.json to redis DB * Migrate config-setup post migration hooks on image upgrade config-setup post migration hooks help user to migrate configurations from old image to new image. If the installed hooks are user defined they will not be part of the newly installed image. So these hooks have to be migrated to new image and only then they can be executing when the new image is booting. The changes in this fix migrate config-setup post-migration hooks and ensure that any hooks with the same filename in newly installed image are not overwritten. It is expected that users install new hooks as per their requirement and not edit existing hooks. Any changes to existing hooks need to be done as part of new image and not post bootup.
# is created | ||
# - If updategraph is enabled and ZTP is disabled, updategraph initializes | ||
# configuration | ||
do_config_intialization() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
intialization looks like a typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing it out. I created below PR to fix this issue.
…c-net#3227) * Create a SONiC configuration management service * Perform config db migration after loading config_db.json to redis DB * Migrate config-setup post migration hooks on image upgrade config-setup post migration hooks help user to migrate configurations from old image to new image. If the installed hooks are user defined they will not be part of the newly installed image. So these hooks have to be migrated to new image and only then they can be executing when the new image is booting. The changes in this fix migrate config-setup post-migration hooks and ensure that any hooks with the same filename in newly installed image are not overwritten. It is expected that users install new hooks as per their requirement and not edit existing hooks. Any changes to existing hooks need to be done as part of new image and not post bootup.
… (#715) Used "config-setup backup" command to take a backup copy of current SONiC configuration. Refer to sonic-net/SONiC#433 and sonic-net/sonic-buildimage#3227 for more information Added skip_migration option to "sonic_installer install" command to allow user to install an image with factory default configuration. Signed-off-by: Rajendra Dendukuri <rajendra.dendukuri@broadcom.com>
Refer to sonic-net/SONiC#433 for more information.
Signed-off-by: Rajendra Dendukuri rajendra.dendukuri@broadcom.com
- What I did
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)