-
Notifications
You must be signed in to change notification settings - Fork 1
create new cli flags [RHOSRFE-61] #4
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
base: main
Are you sure you want to change the base?
Conversation
This change would create several new CLI flags: current-config, rollback, no-abort, and add functionality to detect ip duplicates when using --noop. --current-config Be able to remove interfaces without using the overly disruptive --cleanup option, and pass os-net the existing configuration file as well as the new one so that a delta may be calculated and applied accordingly. --rollback In the event of failure to apply the network, revert back to the previous configuration. --no-abort Continue to try and apply the rest of the configuration, even if one interface fails, and exit with a special return code in this case. --noop Change behavior so that when using --noop os-net-config would attempt to detect if any of the IP addresses are already in use on hosts other than the current host. This would allow a trial run to predict whether any IP conflicts would occur during a production run.
This spec proposes several new CLI flags which will improve the workflow to allow for rollbacks, better error handling and more graceful response to errors encountered during configuration, and proactive duplicate error detection during a dry run using --noop.
new os-net-config cli flags [RHOSRFE-61]
| of the --cleanup flag to limit cleanup to only removing interface configurations which were | ||
| present in the --current-config configuration provided but are not present in the new config | ||
| template which is being applied. | ||
| 2. Add the --rollback flag which would either support rolling back to the original configuration |
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.
Instead of a complete rollback, can we consider configuring the minimal networks needed to enable ssh and other bare minimum tasks ?
| template which is being applied. | ||
| 2. Add the --rollback flag which would either support rolling back to the original configuration | ||
| or to the --current-config template which is specified on the command-line. | ||
| 3. Add the --no-abort flag which would modify the workflow to not abort when a single interface |
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.
This is the current design as well. The errors in applying the configurations does not break the flow usually.
|
May I suggest a different design option for removing interfaces in nmstate?
This design will have no change to CLI command thus user don't need to be involved in interface deletion. This design will let nmstate handling of removing interface using --cleanup flag, the same way as ifcfg. |
|
We have a recent patch [1] where the cleanup is done only for interfaces not defined in config.yaml with the exceptions that OVS interface, ovs bridges and SRIOV Pfs cannot be removed even when these are not defined in config.yaml |
|
@karthiksundaravel so what exactly it is to cleanup on nmstate cleanup? It will still cleanup interfaces that was not initially created by os-net-config right? |
|
@karthiksundaravel the issue is with using netinfo.show_running_config()[Interface.KEY], this gave all interfaces including the ones not configured by os-net-config (i.e. never was in the config.yaml) |
|
Based on your recent submission, we can add the support of deletion of existing interfaces that were in current config.yaml but not in new config.yaml. This will ensure we only delete interfaces that were configured by os-net-config
|
|
@yiytan The |
|
@karthiksundaravel --cleanup flag is used to remove the interfaces that's not defined in os-net-config's config.yaml However, in nmstate, we mistakenly deleted the interfaces that's not even configured by os-net-config, i.e. interfaces that was not in previous config.yaml got deleted. I created this PR to restrict --cleanup to remove only interfaces that were configured by os-net-config. Please review it. |
This spec would create several new CLI flags: current-config,
rollback, no-abort, and add functionality to detect ip duplicates
when using --noop.
--current-config
Be able to remove interfaces without using the
overly disruptive --cleanup option, and pass os-net the existing
configuration file as well as the new one so that a delta may be
calculated and applied accordingly.
--rollback
In the event of failure to apply the network, revert back to the
previous configuration.
--no-abort
Continue to try and apply the rest of the configuration, even if one
interface fails, and exit with a special return code in this case.
--noop
Change behavior so that when using --noop os-net-config would
attempt to detect if any of the IP addresses are already in use on
hosts other than the current host. This would allow a trial run to
predict whether any IP conflicts would occur during a production
run.