Repository navigation
Conversation
Signed-off-by: Andreas Fritzler <andreas.fritzler@sap.com>
afritzler
force-pushed
the
enh/cell-active
branch
from
October 27, 2026 12:51
61faced to
a9016d2
Compare
afritzler
marked this pull request as ready for review
October 28, 2026 09:31
hardikdr
reviewed
Oct 29, 2026
hardikdr
left a comment
Member
There was a problem hiding this comment.
Thanks for the PR @afritzler, dropped few comments inline.
| const ( | ||
| ProviderName = "sonic" | ||
| doneFlagFile = "/etc/sonic/fabric-cell.done" | ||
| stateFile = "/etc/sonic/fabric-cell.state" |
Member
There was a problem hiding this comment.
Optional: Would it help if we called it fabric-cell-vlan.state since it's only storing the states of the VLANs at the moment?
| } | ||
| vlans = append(vlans, fmt.Sprintf("Vlan%d", portNum/4+1001)) | ||
| } | ||
| return os.WriteFile(r.stateFilePath, []byte(strings.Join(vlans, "\n")), 0o644) |
Member
There was a problem hiding this comment.
I suspect that if runScript() has already written doneFile and executed reboot, the code might not get a chance to write the stateFile. Is this understanding correct?
In that case, it might be helpful to move the state-file writing block before runScript. wdyt?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
CellStatusonsonic.ScriptRuntimepreviously just checked for/etc/sonic/fabric-cell.done, so a cell reportedActivethe moment the provisioning script ran, long before the switch finished rebooting and BGP came up. This makes the phase check reflect real readiness:/proc/uptime; if the flag is newer than the last boot, the scripted reboot hasn't happened yet → staysCreated.Establishedvs configured neighbors viavtysh -c "show bgp neighbors json"; not all up →Created./sys/class/net; any down →Created. The VLAN list is persisted to/etc/sonic/fabric-cell.stateatApplyCelltime (removed onDeleteCell) so status doesn't re-derive it from the API.Only when all three pass does the cell go
Active.No changes to the provisioning/reset scripts themselves.
Fixes #27