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

Outdated vlab gen default values #294

Open
pau-hedgehog opened this issue Jan 4, 2025 · 2 comments · May be fixed by #299
Open

Outdated vlab gen default values #294

pau-hedgehog opened this issue Jan 4, 2025 · 2 comments · May be fixed by #299
Assignees

Comments

@pau-hedgehog
Copy link
Contributor

pau-hedgehog commented Jan 4, 2025

According to:

ubuntu@vlab-pau:~/hhfab$ hhfab vlab gen -v
14:52:44 INF Hedgehog Fabricator version=v0.30.3
14:52:44 INF Building VLAB wiring diagram fabricMode=spine-leaf
14:52:44 INF >>> spinesCount=2 fabricLinksCount=2
14:52:44 INF >>> eslagLeafGroups=2
14:52:44 INF >>> mclagLeafsCount=2 mclagSessionLinks=2 mclagPeerLinks=2
14:52:44 INF >>> orphanLeafsCount=1 vpcLoopbacks=2
14:52:44 INF >>> mclagServers=2 eslagServers=2 unbundledServers=1 bundledServers=1
14:52:44 INF Generated wiring file name=vlab.generated.yaml

Some default values in the vlab gen help seem outdated:

ubuntu@vlab-pau:~/hhfab$ hhfab vlab gen -h | grep default
   --bundled-servers value      number of bundled servers to generate for switches (only for one of the second switch in the redundancy group or orphan switch) (default: 1)
   --eslag-servers value        number of ESLAG servers to generate for ESLAG switches (default: 2)
   --fabric-links-count value   number of fabric links if fabric mode is spine-leaf (default: 0)  <----------------------------------------------------
   --mclag-leafs-count value    number of mclag leafs (should be even) (default: 0)  <----------------------------------------------------
   --mclag-peer-links value     number of mclag peer links for each mclag leaf (default: 0)  <----------------------------------------------------
   --mclag-servers value        number of MCLAG servers to generate for MCLAG switches (default: 2)
   --mclag-session-links value  number of mclag session links for each mclag leaf (default: 0)
   --no-switches                do not generate any switches (default: false)
   --orphan-leafs-count value   number of orphan leafs (default: 0)  <--------------------------------------------
   --spines-count value         number of spines if fabric mode is spine-leaf (default: 0)  <----------------------------------------------------
   --unbundled-servers value    number of unbundled servers to generate for switches (only for one of the first switch in the redundancy group or orphan switch) (default: 1)
   --vpc-loopbacks value        number of vpc loopbacks for each switch (default: 0)
   --brief, -b      brief output (only warn and error) (default: false) [$HHFAB_BRIEF]
   --cache-dir DIR  use cache dir DIR for caching downloaded files (default: "/home/ubuntu/.hhfab-cache") [$HHFAB_CACHE_DIR]
   --verbose, -v    verbose output (includes debug) (default: false) [$HHFAB_VERBOSE]
   --workdir PATH   run as if hhfab was started in PATH instead of the current working directory (default: "/home/ubuntu/hhfab") [$HHFAB_WORK_DIR]

Observed in Beta1:

ubuntu@vlab-pau:~/hhfab$ hhfab -V
hhfab version v0.30.3
@pau-hedgehog pau-hedgehog self-assigned this Jan 7, 2025
pau-hedgehog added a commit that referenced this issue Jan 8, 2025
Fixes #294

Signed-off-by: Pau Capdevila <[email protected]>
@pau-hedgehog pau-hedgehog linked a pull request Jan 8, 2025 that will close this issue
@pau-hedgehog
Copy link
Contributor Author

I was looking at the cause of the CI failure:

ERR generating VLAB wiring diagram: fabric links not supported for collapsed core fabric mode
https://github.com/githedgehog/fabricator/actions/runs/12671039890/job/35312479260

I found where the defaults are actually hardcoded:

func (b *VLABBuilder) Build(ctx context.Context, l *apiutil.Loader, fabricMode meta.FabricMode) error {
        if l == nil {
                return errors.Errorf("loader is nil")
        }
        b.data = l

        if fabricMode == meta.FabricModeSpineLeaf {
                if !b.NoSwitches {
                        if b.SpinesCount == 0 {
                                b.SpinesCount = 2
                        }
                        if b.FabricLinksCount == 0 {
                                b.FabricLinksCount = 2
                        }
                        if b.MCLAGLeafsCount == 0 && b.OrphanLeafsCount == 0 && b.ESLAGLeafGroups == "" {
                                b.MCLAGLeafsCount = 2
                                b.ESLAGLeafGroups = "2"
                                b.OrphanLeafsCount = 1
                        }
                }
        } else if fabricMode == meta.FabricModeCollapsedCore {
                if b.SpinesCount > 0 {
                        return errors.Errorf("spines not supported for collapsed core fabric mode")
                }
                if b.FabricLinksCount > 0 {
                        return errors.Errorf("fabric links not supported for collapsed core fabric mode")
                }

@Frostman, I know this PR is very low value. When you can, please comment if you think it's worth progressing it

The hhfab defaults are focused on the spine-leaf case. We could set FabricLinksCount to 0 if CollapsedCore

@Frostman
Copy link
Member

Frostman commented Jan 9, 2025

@pau-hedgehog I've responded partially on PR - I think it just needs a rework, we've been discussing it a few times with Logan before and I think it overlaps with making default VLAB setup work nicely for laptops, I'll take a look on what needs to be changed

@Frostman Frostman self-assigned this Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants