Fabric Shrink/Expand
This section provides a brief overview of how to add or remove switches within the fabric using Hedgehog Fabric API, and how to manage connections between them.
Manipulating API objects is done with the assumption that target devices are correctly cabled and connected.
This article uses terms that can be found in the Hedgehog Concepts, the User Guide documentation, and the Fabric API reference.
Add a switch to the existing fabric
In order to be added to the Hedgehog Fabric, a switch should have a corresponding Switch object. An example on how to define
this object is available in the User Guide. If the switch is
being added to an existing fabric the user needs to supply the ASN, and IPv4
address for the switch. For a leaf switch, increment the largest ASN by one. If
a spine is being added, it shares the same ASN as the existing spines. For an
IPv4 address increment the largest IP by one, keep the same netmask.
Note
If theSwitch will be used in ESLAG or MCLAG groups, appropriate groups should exist. Redundancy groups should
be specified in the Switch object before creation.
Expanding Example
A good place to start expanding the fabric is to extract the YAML configuration for a switch in the role (spine or leaf) that matches the switch to be added. A good starting point is to take the highest numbered or most recently added switch of the matching role and increment the IP addresses and numbers by 1.
- on a control node:
kubectl get switch/leaf-05 -o yaml > new_switch.yaml - Edit new resulting YAML file
kubectl apply -f new_switch.yaml
- The file can be used to remove the new switch,
kubectl delete -f new_switch.yamlif needed
After the Switch object has been created, you can define and create dedicated device Connections. The types of the
connections may differ based on the Switch role given to the device. For more details, refer to Connections
section.
Note
Switch devices need to be booted in ONIE installation mode to install SONiC OS and configure the Fabric
Agent.
Ensure the management port of the switch is connected to fabric management network.
Remove a switch from the existing fabric
Before you decommission a switch from the Hedgehog Fabric, several preliminary steps are necessary.
- If the
Switchis aLeafswitch (includingMixedandBorderleaf configurations), remove allVPCAttachmentsbound to all switchesConnections. - If the
Switchwas used forExternalPeering, remove allExternalAttachmentobjects that are bound to theConnectionsof theSwitch. - Remove all connections of the
Switch. - At last, remove the
SwitchandAgentobjects.
Replace a switch from the existing fabric
To replace a switch in the fabric, you do not need to remove and re-add it. Instead:
- Edit the existing switch object to update the
MACaddress orSerialnumber of the new hardware. - Reinstall the switch, following the boot
ONIEprocess used when it was first added to the fabric.