Introduction à la commande switch-profile
Quand un switch FEX Nexus 2000 est connecté à deux switchs Nexus 5000 configurés en mode vPC, la configuration du Nexus 2000 apparait dans le fichier de configuration des deux switchs Nexus 5000.
Il est donc possible de configurer le Nexus 2000 à partir de l’un ou l’autre des deux switchs Nexus 5000.
Pour que la configuration du Nexus 2000 soit identique sur chacun des Nexus 5000, on utilise la commande switch-profile.
La commande switch-profile va synchroniser les modifications de configuration d’un switch Nexus 2000 faites à partir d’un Nexus 5000 sur l’autre Nexus 5000.
Configuration du profile
Sur chaque switch, le nom du profil est identique. L’adresse IP dans la commande est celle du switch distant.
Configuration du premier Nexus 5k
switchN5K-1# conf t Enter configuration commands, one per line. End with CNTL/Z. switchN5K-1(config)# ex switchN5K-1(config)# cfs ipv4 distribute switchN5K-1# configure sync Enter configuration commands, one per line. End with CNTL/Z. switchN5K-1(config-sync)# switch-profile profile-test Switch-Profile started, Profile ID is 1 switchN5K-1(config-sync-sp)# sync-peers destination 10.0.0.2 switchN5K-1(config-sync-sp)# sh switch-profile ---------------------------------------------------------- Profile-name Config-revision ---------------------------------------------------------- profile-test 1 switchN5K-1(config-sync-sp)#
Configuration du deuxième Nexus 5k
switchN5K-2# conf t Enter configuration commands, one per line. End with CNTL/Z. switchN5K-2(config)# ex switchN5K-2(config)# cfs ipv4 distribute switchN5K-2# configure sync Enter configuration commands, one per line. End with CNTL/Z. switchN5K-2(config-sync)# switch-profile profile-test Switch-Profile started, Profile ID is 1 switchN5K-2(config-sync-sp)# sync-peers destination 10.0.0.1
Commande de test
switchN5K-2# sh switch-profile ---------------------------------------------------------- Profile-name Config-revision ---------------------------------------------------------- profile-test 1 switchN5K-1# sh switch-profile profile-test status switch-profile : profile-test ---------------------------------------------------------- Start-time: 754383 usecs after Tue Jun 16 10:57:37 2015 End-time: 90668 usecs after Tue Jun 16 10:57:41 2015 Profile-Revision: 1 Session-type: Initial-Exchange Session-subtype: Init-Exchange-All Peer-triggered: Yes Profile-status: Sync Success Local information: ---------------- Status: Commit Success Error(s): Peer information: ---------------- IP-address: 10.0.0.2 Sync-status: In sync Status: Commit Success Error(s):
switchN5K-1# sh switch-profile peer switch-profile : profile-test ---------------------------------------------------------- Peer-IP-address : 10.0.0.2 Peer-sync-status : In sync Peer-status : Commit Success Peer-error(s) : switchN5K-2#
Exemple de modification de la configuration d’un port du Nexus 2000
On se connecte au switch Nexus 5k puis dans le contexte configure sync.
Le vlan est modifié pour les ports du Nexus 2k puis les commandes sont vérifiées et validées.
switchN5K-1# configure sync Enter configuration commands, one per line. End with CNTL/Z. switchN5K-1(config-sync)# switch-profile profile-test Switch-Profile started, Profile ID is 1 switchN5K-1(config-sync-sp)# interface eth 101/1/1-32 switchN5K-1(config-sync-sp-if-range)# switchport access vlan 3 switchN5K-1(config-sync-sp-if-range)# ex switchN5K-1(config-sync-sp)# verify Verification Successful switchN5K-1(config-sync-sp)# commit Verification successful... Proceeding to apply configuration. This might take a while depending on amount of configuration in buffer. Please avoid other configuration changes during this time. Commit Successful switchN5K-1(config-sync)#
Commande de debug
Pour voir ce qu’il y a dans le buffer (avant validation):
switchN5K-1(config-sync-sp)# sh switch-profile buffer
Pour supprimer les commandes contenues dans le buffer:
switchN5K-1(config-sync-sp)# buffer-delete all
Affichage de la configuration prise en compte par le profil:
switchN5K-1# sh startup-config switch-profile