Skip to content
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

Merged
merged 7 commits into from
Dec 4, 2019

Conversation

rajendra-dendukuri
Copy link
Contributor

  • Configuration initialization and migration service for SONiC

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)

Signed-off-by: Rajendra Dendukuri <rajendra.dendukuri@broadcom.com>
Signed-off-by: Rajendra Dendukuri <rajendra.dendukuri@broadcom.com>
@rajendra-dendukuri
Copy link
Contributor Author

retest broadcom please

rajendra-dendukuri and others added 5 commits August 19, 2019 10:41
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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rameshsanth

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.

Copy link
Contributor Author

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.

Copy link
Collaborator

@lguohan lguohan Dec 4, 2019

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

@lguohan
Copy link
Collaborator

lguohan commented Dec 3, 2019

retest vsimage please

@lguohan lguohan merged commit cda6129 into sonic-net:master Dec 4, 2019
lguohan pushed a commit to sonic-net/sonic-utilities that referenced this pull request Dec 4, 2019
…#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>
abdosi pushed a commit that referenced this pull request Jan 21, 2020
* 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.
@keboliu
Copy link
Collaborator

keboliu commented Feb 24, 2020

@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?

@rajendra-dendukuri
Copy link
Contributor Author

@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

pphuchar pushed a commit to SONIC-DEV/sonic-buildimage that referenced this pull request Mar 9, 2020
…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()
Copy link
Contributor

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

Copy link
Contributor Author

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.

#4388

tiantianlv pushed a commit to SONIC-DEV/sonic-buildimage that referenced this pull request Apr 24, 2020
…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.
malletvapid23 added a commit to malletvapid23/Sonic-Utility that referenced this pull request Aug 3, 2023
… (#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants