10 July 2020

Brocade config - CLI


Below are basic commands for Brocade SAN switches to name ports, create aliases, configure zone, add zone to configuration, enable and save configuration.
In below example SAN is connected to port 0 and 1, ESX host is connectred to port 2

Run switchshow to check wwn on active ports


brocade-01:admin> switchshow

switchName:     brocade-01

switchType:     170.0

switchState:    Online   

switchMode:     Native

switchRole:     Principal

switchDomain:   5

switchId:       fffc05

switchWwn:      10:00:85:36:46:ea:d4:b4

zoning:         ON (default)

switchBeacon:   OFF

HIF Mode:       OFF


Index Port Address  Media Speed   State       Proto

==================================================

   0   0   050000   id    16G     Online      FC  F-Port  50:0a:09:80:0e:13:be:80 

   1   1   050100   id    16G     Online      FC  F-Port  10:00:00:10:9b:87:45:f4 

   2   2   050200   id    16G     Online      FC  F-Port  10:00:00:10:9b:87:45:f4 

   3   3   050300   id    16G     No_Light    FC  

   4   4   050400   id    16G     No_Light    FC 

   5   5   050500   id    16G     No_Light    FC  

   6   6   050600   id    16G     No_Light    FC 

   7   7   050700   id    16G     No_Light    FC  

   8   8   050800   id    16G     No_Light    FC 

   9   9   050900   id    16G     No_Light    FC 

  10  10   050a00   id    16G     No_Light    FC 

  11  11   050b00   id    16G     No_Light    FC  

  12  12   050c00   id    16G     No_Light    FC  

  13  13   050d00   id    16G     No_Light    FC 

  14  14   050e00   id    16G     No_Light    FC  

  15  15   050f00    id    16G     No_Light    FC 

  16  16   051000   id    16G     No_Module    FC 

  17  17   051100   id    16G     No_Module    FC 

  18  18   051200   id    16G     No_Module    FC 

  19  19   051300   id    16G     No_Module    FC 

  20  20   051400   id    16G     No_Module    FC

  21  21   051500   id    16G     No_Module    FC  

  22  22   051600   id    16G     No_Module    FC  

  23  23   051700   id    16G     No_Module    FC 



Run below commands to change name of the ports 0-2


portname 0 -n "SAN_SPA_FC4"

portname 1 -n "SAN_SPB_FC4"

portname 2 -n "ESX_01_HBA"


Run portname to check if port names has been applied corerctly


brocade-01:admin> portname

port  0: SAN_SPA_FC4

port  1: SAN_SPB_FC4

port  2: ESX_01_HBA

port  3: port3

port  4: port4

port  5: port5

port  6: port6

port  7: port7

port  8: port8

port  9: port9

port 10: port10

port 11: port11

port 12: port12

port 13: port13

port 14: port14

port 15: port15

port 16: port16

port 17: port17

port 18: port18

port 19: port19

port 20: port20

port 21: port21

port 22: port22

port 23: port23



Run below commands to create alias for SAN front end ports connected to switch port 0 & 1


alicreate "SAN_FE","21:00:00:34:00:3c:c2:01"

aliadd "SAN_FE", "21:00:00:34:00:3c:c2:02"


Run alishow "SAN_FE" to check if alias for SAN front end ports has been crfeated correctly


brocade-01:admin> alishow SAN_FE

 alias: SAN_FE

                21:00:00:34:00:3c:c2:01

                21:00:00:34:00:3c:c2:02



Run below commands to create zone to allow traffice between SAN and ESX_01, as you can see you can use wwn and/ or alias


zonecreate "ESX_01_to_SAN_FE", "21:00:00:24:ff:3c:c2:39" 

zoneadd "ESX_01_to_SAN_FE", "SAN_FE" 


Run zoneshow "ESX_01_to_SAN_FE" to check if zone has been created correctly


brocade-01:admin> zoneshow ESX_01_to_SAN_FE

 zone:  ESX_01_to_SAN_FE

                21:00:00:24:ff:3c:c2:39SAN_FE



Run switchshow to check your active configuration, on our switch it is "default"


brocade-01:admin> switchshow

switchName:     brocade-01

switchType:     170.0

switchState:    Online   

switchMode:     Native

switchRole:     Principal

switchDomain:   5

switchId:       fffc05

switchWwn:      10:00:85:36:46:ea:d4:b4

zoning:         ON (default)

switchBeacon:   OFF

HIF Mode:       OFF


Index Port Address  Media Speed   State       Proto

==================================================

   0   0   050000   id    16G     Online      FC  F-Port  50:0a:09:80:0e:13:be:80 

   1   1   050100   id    16G     Online      FC  F-Port  10:00:00:10:9b:87:45:f4 

   2   2   050200   id    16G     Online      FC  F-Port  10:00:00:10:9b:87:45:f4 

   3   3   050300   id    16G     No_Light    FC  

   4   4   050400   id    16G     No_Light    FC 

   5   5   050500   id    16G     No_Light    FC  

   6   6   050600   id    16G     No_Light    FC 

   7   7   050700   id    16G     No_Light    FC  

   8   8   050800   id    16G     No_Light    FC 

   9   9   050900   id    16G     No_Light    FC 

  10  10   050a00   id    16G     No_Light    FC 

  11  11   050b00   id    16G     No_Light    FC  

  12  12   050c00   id    16G     No_Light    FC  

  13  13   050d00   id    16G     No_Light    FC 

  14  14   050e00   id    16G     No_Light    FC  

  15  15   050f00    id    16G     No_Light    FC 

  16  16   051000   id    16G     No_Module    FC 

  17  17   051100   id    16G     No_Module    FC 

  18  18   051200   id    16G     No_Module    FC 

  19  19   051300   id    16G     No_Module    FC 

  20  20   051400   id    16G     No_Module    FC

  21  21   051500   id    16G     No_Module    FC  

  22  22   051600   id    16G     No_Module    FC  

  23  23   051700   id    16G     No_Module    FC 



Run below command to add "ESX_01_to_SAN_FE" zone to "default" configuration


cfgadd "default", "ESX_01_to_SAN_FE" 


Run below command to check if "ESX_01_to_SAN_FE zone has been succesfuly added to "default" configuration


cfgshow default 


Run below command to enable new "default" configuration

 

cfgenable default 


You should run below command to save switch configuration - only on Brocade switches with old FOS


cfgsave


08 July 2020

PowerCLI on Linux

I've decided to create Linux VM with PowerCLI on it to make my VMware scripting easier and portable.
Below is few easy steps to complete the task:

1. Create VM (private or public cloud)/ physical server and install Linux distribution of your choice, I've installed CentOS 8 

2. Install PowerShell on your Linux server

You can download PowerShell and find installation instructions here:

On CentOS 8 you have to download appropriate rpm and then install it with below command:

[virtworld@centos8 ~]$ sudo dnf install powershell-lts-7.0.2-1.centos.8.x86_64.rpm -y

3. On your linux server go to PowerShell prompt by typing "pwsh" command and install PowerCLI as below:

PS /home/virtworld> Find-Module -Name VMware.PowerCLI
PS /home/virtworld> Install-Module -Name VMware.PowerCLI

4. (Optional) For your home lab you may want to disable SSL cert verification to be able to connect to your vCenter Server (as by default uses self-signed cert)

PS /home/virtworld> Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false

Happy scripting

Popular