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

config-mgmt: T5976: add option for commit-confirm to use 'soft' rollback #4128

Merged
merged 4 commits into from
Oct 8, 2024

Conversation

jestabro
Copy link
Contributor

@jestabro jestabro commented Oct 4, 2024

Change Summary

Allow commit-confirm to use (a version of) 'soft' rollback. This adds a configurable option
['system', 'config-management', 'commit-confirm'] (reload|reboot)
The setting will apply the method revert_soft in the case of unconfirmed commits, using the same techniques as those of soft rollback, making a reboot unnecessary. The default setting is the traditional reboot, so it must be configured to take effect.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

vyos/vyos-documentation#1558
vyos/vyatta-cfg#93

Component(s) name

Proposed changes

How to test

Smoketest result

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@jestabro jestabro self-assigned this Oct 4, 2024
@jestabro jestabro requested a review from a team as a code owner October 4, 2024 17:20
Copy link

github-actions bot commented Oct 4, 2024

👍
No issues in PR Title / Commit Title

@jestabro jestabro changed the title Commit confirm soft rollback T5976: Allow commit-confirm to use soft-rollback instead of reboot Oct 4, 2024
Copy link

github-actions bot commented Oct 4, 2024

✅ No issues found in unused-imports check.. Please refer the workflow run

@jestabro jestabro changed the title T5976: Allow commit-confirm to use soft-rollback instead of reboot config-mgmt: T5976: add option for commit-confirm to use 'soft' rollback Oct 4, 2024
Commit-confirm will restore a previous configuration if a confirmation
is not received in N minutes. Traditionally, this was restored by a
reboot into the last configuration on disk; add a configurable option to
reload the last completed commit without a reboot. The default setting
is to reboot.
Copy link
Member

@dmbaturin dmbaturin left a comment

Choose a reason for hiding this comment

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

I think we should rename the option to commit-confirm action, and I think it's a good idea because we can also add other options there, such as commit-confirm timeout and commit-confirm force (if someone wants to make every commit a confirmed commit).

@jestabro
Copy link
Contributor Author

jestabro commented Oct 7, 2024

Changes made following discussion in meeting as summarized by @dmbaturin above.

@sever-sever
Copy link
Member

  1. Commit-confirm still says reboot which can confuse
vyos@r14# commit-confirm 
Possible completions:
  <Enter>	Commit, rollback/reboot in 10 minutes if no confirm
  <N>		Commit, rollback/reboot in N minutes if no confirm
  comment	Comment for commit log

I expect to use commit-confirm just for reload, as Juniper implemented it, for example.
I do not see any sense in using the reboot command for the rollback configs.

  1. The rollback silently does a rollback, I expecting some output if the rollback is done
vyos@r14# run show int  
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface    IP Address         MAC                VRF        MTU  S/L    Description
-----------  -----------------  -----------------  -------  -----  -----  -------------
eth0         192.168.122.14/24  52:54:00:5e:a8:24  default   1500  u/u
eth1         -                  52:54:00:d7:d8:3a  default   1500  u/u
eth2         -                  52:54:00:0c:24:26  default   1500  u/u
lo           127.0.0.1/8        00:00:00:00:00:00  default  65536  u/u
             ::1/128
veth0        -                  aa:0f:a7:24:ab:a2  default   1500  u/u
[edit]
vyos@r14# 
[edit]
vyos@r14# compare 
[interfaces ethernet eth0]
+ description "WAN"

[edit]
vyos@r14# commit-confirm 1

commit-confirm will automatically reload previous config in 1 minutes
unless changes are confirmed.
Proceed ? [Y/n] y
Initialized commit-confirm; 1 minutes to confirm before reload
[edit]
vyos@r14# 
[edit]
vyos@r14# 

But yes we can see it in the log:

Oct 08 10:06:37 r14 systemd[1]: Started commit-confirm.service - /usr/bin/sg vyattacfg /usr/bin/config-mgmt revert_soft.
Oct 08 10:06:38 r14 sudo[7052]:     root : PWD=/ ; USER=root ; COMMAND=/usr/bin/sh -c '/usr/sbin/vyshim VYOS_TAGNODE_VALUE=\'eth0\' /usr/libexec/vyos/conf_mode/interfaces_ethernet.py'

Will be cool to add a message to the vyos console print/logger/etc

@jestabro
Copy link
Contributor Author

jestabro commented Oct 8, 2024

Added display message on soft revert, and adjusted completion hint:
vyos/vyatta-cfg#93

Copy link

github-actions bot commented Oct 8, 2024

CI integration ❌ failed!

Details

CI logs

  • CLI Smoketests (no interfaces) ❌ failed
  • CLI Smoketests (interfaces only) 👍 passed
  • Config tests 👍 passed
  • RAID1 tests 👍 passed
  • TPM tests 👍 passed

@jestabro jestabro merged commit 3bc9007 into vyos:current Oct 8, 2024
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants