项目作者: PowerAruba

项目描述 :
PowerShell module to manage ArubaCX switches
高级语言: PowerShell
项目地址: git://github.com/PowerAruba/PowerArubaCX.git
创建时间: 2018-07-26T15:01:01Z
项目社区:https://github.com/PowerAruba/PowerArubaCX

开源协议:Apache License 2.0

下载


PowerArubaCX



















This is a Powershell module for configure an ArubaCX Switch.



With this module (version 0.6.0) you can manage:

There is some extra feature

More functionality will be added later.

Tested with ArubaCX 8400 and 832x, 6x00 (using >= 10.06.xx firmware) on Windows/Linux/macOS

Usage

All resource management functions are available with the Powershell verbs GET, ADD, SET, REMOVE.

For example, you can manage Vlans with the following commands:

  • Get-ArubaCXVlans
  • Add-ArubaCXVlans
  • Set-ArubaCXVlans
  • Remove-ArubaCXVlans

Requirements

  • Powershell 7 (Core) or 5 (If possible get the latest version)
  • An ArubaCX Switch (with firmware >= 10.06.xx) and REST API enable

Instructions

Install the module

  1. # Automated installation (Powershell 5 and later):
  2. Install-Module PowerArubaCX
  3. # Import the module
  4. Import-Module PowerArubaCX
  5. # Get commands in the module
  6. Get-Command -Module PowerArubaCX
  7. # Get help
  8. Get-Help Invoke-ArubaCXRestMethod -Full

Examples

Connecting to the Aruba Switch

The first thing to do is to connect to an ArubaCX Switch with the command Connect-ArubaCX:

  1. # Connect to the Aruba CX Switch
  2. Connect-ArubaCX 192.0.2.1
  3. #we get a prompt for credential

Vlans Management

You can create a new Vlan Add-ArubaCXVlans, retrieve its information Get-ArubaCXVlans, modify its properties Set-ArubaCXVlans, or delete it Remove-ArubaCXVlans.

  1. # Create a vlan
  2. Add-ArubaCXVlans -id 85 -Name 'PowerArubaCX'
  3. [...]
  4. admin : up
  5. clear_ip_bindings :
  6. description :
  7. [...]
  8. id : 85
  9. [...]
  10. name : PowerArubaCX
  11. nd_snoop_config : @{enable=False; ra_drop_enable=False}
  12. nd_snooping_prefix : {}
  13. oper_state : down
  14. oper_state_reason : no_member_port
  15. [...]
  16. type : static
  17. voice : False
  18. vsx_sync : {}
  19. # Get information about vlan
  20. Get-ArubaCXVlans -id 85 -attributes admin, description, id, name, type, voice | Format-Table
  21. admin description id name type voice
  22. ----- ----------- -- ---- ---- -----
  23. up 85 PowerArubaCX static False
  24. # Change settings of a vlan (Description and voice)
  25. Get-ArubaCXVlans -id 85 | Set-ArubaCXVlans -description "Add via PowerArubaCX" -voice
  26. [...]
  27. admin : up
  28. clear_ip_bindings :
  29. description : Add via PowerArubaCX
  30. [...]
  31. id : 85
  32. [...]
  33. name : PowerArubaCX
  34. nd_snoop_config : @{enable=False; ra_drop_enable=False}
  35. nd_snooping_prefix : {}
  36. oper_state : down
  37. oper_state_reason : no_member_port
  38. [...]
  39. type : static
  40. voice : True
  41. vsx_sync : {}
  42. # Remove a vlan
  43. Get-ArubaCXVlans -name PowerArubaCX | Remove-ArubaCXVlans

For configure a vlan to an interface, need to use Set-ArubaCXInterfaces

Invoke API

for example to get ArubaCX System Configuration

  1. # get Aruba CX System configuration using API
  2. Invoke-ArubaCXRestMethod -method "get" -uri "system" -selector configuration
  3. aaa : @{fail_through=False; login_lockout_time=300; radius_auth=pap; radius_retries=1;
  4. radius_timeout=5; ssh_passkeyauthentication_enable=True;
  5. ssh_publickeyauthentication_enable=True; tacacs_auth=pap; tacacs_timeout=5}
  6. all_user_copp_policies : {}
  7. arp_config : @{gc_threshold=131072; timeout=30}
  8. bfd_detect_multiplier : 5
  9. bfd_echo_disable : False
  10. bfd_enable : False
  11. bfd_min_echo_rx_interval : 500
  12. bfd_min_rx_interval : 3000
  13. bfd_min_tx_interval : 3000
  14. checkpoint_post_config : @{disable=False; timeout=300}
  15. dhcp_config :
  16. dlog_destination :
  17. dns_servers : {}
  18. ecmp_config :
  19. hostname : PowerArubaCX-SW1
  20. hpe_rda_enable : False
  21. icmp_redirect_disable : False
  22. icmp_unreachable_disable : False
  23. icmp_unreachable_ratelimit : 1000
  24. [...]
  25. # get only Aruba CX System hostname and dns servers
  26. Invoke-ArubaCXRestMethod -method "get" -uri "system" -attributes hostname, dns_servers
  27. dns_servers hostname
  28. ----------- --------
  29. {} PowerArubaCX-SW1

to get API uri, go to ArubaCX Swagger (https://ArubaCX-IP/api/v10.04/)

And choice a service (for example System)

Interface

On ArubaCX, on interface, there is all type of interface physical/system and virtual (LAG, Loopback, Vlans)

You can create a new interface (LAG, Loopback, Vlans) Add-ArubaCXInterfaces, retrieve its information Get-ArubaCXInterfaces, modify its properties Set-ArubaCXInterfaces or delete it Remove-ArubaCXInterfaces. There is also extra cmdlets for Add Add-ArubaCXInterfacesVlansTrunks / Remove Remove-ArubaCXInterfacesVlansTrunks Vlans trunks on interface (physical or LAG) or for Add Add-ArubaCXInterfacesLagInterface or Remove Remove-ArubaCXInterfacesLagInterface member (physical) interface on LAG.

Interface Physical (System)

  1. #Get interface 1/1/1 configuration
  2. Get-ArubaCXInterfaces 1/1/1 -selector configuration
  3. aaa_auth_precedence :
  4. aclmac_in_cfg :
  5. aclmac_in_cfg_version :
  6. aclmac_out_cfg :
  7. aclmac_out_cfg_version :
  8. aclv4_in_cfg :
  9. aclv4_in_cfg_version :
  10. aclv4_out_cfg :
  11. aclv4_out_cfg_version :
  12. aclv6_in_cfg :
  13. aclv6_in_cfg_version :
  14. aclv6_out_cfg :
  15. aclv6_out_cfg_version :
  16. admin : up
  17. [...]
  18. #Get name, admin state and link state of interface
  19. Get-ArubaCXInterfaces 1/1/1 -attributes name, admin_state, link_state
  20. admin_state link_state name
  21. ----------- ---------- ----
  22. down down 1/1/1
  23. #Configure interface 1/1/1 (Description, admin and routing)
  24. Get-ArubaCXInterfaces 1/1/1 | Set-ArubaCXInterfaces -description "Changed by PowerArubaCX" -admin up -routing:$false
  25. [...]
  26. admin : up
  27. [...]
  28. description : Changed by PowerArubaCX
  29. [...]
  30. name : 1/1/1
  31. [...]
  32. routing : False
  33. [...]
  34. #Configure interface 1/1/1 on vlan access 85
  35. Get-ArubaCXInterfaces -interface 1/1/1 | Set-ArubaCXInterfaces -vlan_mode access -vlan_tag 85
  36. name : 1/1/1
  37. [...]
  38. vlan_mode : access
  39. vlan_tag : @{85=/rest/v10.04/system/vlans/85}
  40. [...]
  41. #Configure interface 1/1/1 on native-untagged mode with vlan 85 and tagged vlan 44
  42. Get-ArubaCXInterfaces -interface 1/1/1 | Set-ArubaCXInterfaces -vlan_mode native-untagged -vlan_tag 85 -vlan_trunks 44
  43. name : 1/1/1
  44. [...]
  45. vlan_mode : native-untagged
  46. vlan_tag : @{85=/rest/v10.04/system/vlans/85}
  47. vlan_trunks : @{44=/rest/v10.04/system/vlans/44}
  48. #Configure interface 1/1/1 and add vlan 45 to trunks
  49. Get-ArubaCXInterfaces -interface 1/1/1 | Add-ArubaCXInterfacesVlanTrunks -vlan_trunks 45
  50. name : 1/1/1
  51. [...]
  52. vlan_mode : native-untagged
  53. vlan_tag : @{85=/rest/v10.04/system/vlans/85}
  54. vlan_trunks : @{44=/rest/v10.04/system/vlans/44; 45=/rest/v10.04/system/vlans/45}
  55. [...]
  56. #Configure interface 1/1/1 with a IPv4 address
  57. Get-ArubaCXInterfaces -interface 1/1/1 | Set-ArubaCXInterfaces -ip4_address 192.0.2.1 -ip4_mask 24
  58. name : 1/1/1
  59. [...]
  60. ip4_address : 192.0.2.1/24
  61. [...]

Interface LAG

  1. #Add LAG 1 with member interface 1/1/1
  2. Add-ArubaCXInterfaces -lag_id 1 admin up -interfaces 1/1/3 -lacp active
  3. name : lag1
  4. [...]
  5. interfaces : @{1/1/3=/rest/v10.09/system/interfaces/1%2F1%2F3}
  6. [...]
  7. lacp : active
  8. [...]
  9. #Configure Access vlan 44 on LAG 1
  10. Get-ArubaCXInterfaces lag1 | Set-ArubaCXInterfaces -vlan_tag 44 -vlan_mode access
  11. name : lag1
  12. [...]
  13. vlan_mode : access
  14. vlan_tag : @{44=/rest/v10.09/system/vlans/44}
  15. [...]
  16. #Configure Trunk vlan 44,45 on LAG 1
  17. Get-ArubaCXInterfaces lag1 | Set-ArubaCXInterfaces -vlan_tag 1 -vlan_trunks 44,45 -vlan_mode native-untagged
  18. name : lag1
  19. [...]
  20. vlan_mode : native-untagged
  21. vlan_tag : @{1=/rest/v10.09/system/vlans/1}
  22. vlan_trunks : @{44=/rest/v10.09/system/vlans/44; 45=/rest/v10.09/system/vlans/45}
  23. [...]
  24. #Add interface 1/1/2 on LAG 1
  25. Get-ArubaCXInterfaces lag1 | Add-ArubaCXInterfacesLagInterfaces -interfaces 1/1/2
  26. name : lag1
  27. [...]
  28. interfaces : @{1/1/2=/rest/v10.09/system/interfaces/1%2F1%2F2; 1/1/3=/rest/v10.09/system/interfaces/1%2F1%2F3}
  29. [...]
  30. lacp : active
  31. [...]
  32. #Remove interface 1/1/3 on LAG 1
  33. Get-ArubaCXInterfaces lag1 | Remove-ArubaCXInterfacesLagInterfaces -interfaces 1/1/3
  34. name : lag1
  35. [...]
  36. interfaces : @{1/1/2=/rest/v10.09/system/interfaces/1%2F1%2F2}
  37. [...]
  38. lacp : active
  39. [...]
  40. #Remove LAG 1
  41. Get-ArubaCXInterfaces lag1 | Remove-ArubaCXInterfaces
  42. Confirm
  43. Are you sure you want to perform this action?
  44. Performing the operation "Remove interface" on target "lag1".
  45. [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y

Interface Loopback

  1. #Add interface loopback 1 with a IPv4 Address (you need to add vlan before)
  2. Add-ArubaCXInterfaces -loopback_id 1 -ip4_address 192.0.2.44 -ip4_mask 24
  3. name : loopback1
  4. [...]
  5. active_ip4_address : 192.0.2.44/24
  6. [...]
  7. ip4_address : 192.0.2.44/24
  8. [...]
  9. #Change IP Address of interface loopback 1
  10. Get-ArubaCXInterfaces loopback1 | Set-ArubaCXInterfaces -ip4_address 192.0.2.254 -ip4_mask 24
  11. name : loopback1
  12. [...]
  13. active_ip4_address : 192.0.2.254/24
  14. [...]
  15. ip4_address : 192.0.2.254/24
  16. [...]
  17. #Set VRF Blue on interface loopback 1(need to create vrf before)
  18. Get-ArubaCXInterfaces loopback1 | Set-ArubaCXInterfaces -vrf blue
  19. name : loopback1
  20. [...]
  21. vrf : @{blue=/rest/v10.09/system/vrfs/blue}
  22. [...]
  23. #Remove interface loopback 1
  24. Get-ArubaCXInterfaces loopback1 | Remove-ArubaCXInterfaces
  25. Confirm
  26. Are you sure you want to perform this action?
  27. Performing the operation "Remove interface" on target "loopback1".
  28. [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y

Interface Vlans

  1. #Add interface vlan 44 with a IPv4 Address (you need to add vlan before)
  2. Add-ArubaCXInterfaces -vlan_id 44 -ip4_address 192.0.2.44 -ip4_mask 24
  3. name : vlan44
  4. [...]
  5. active_ip4_address : 192.0.2.44/24
  6. [...]
  7. ip4_address : 192.0.2.44/24
  8. [...]
  9. #Change IP Address of interface vlan 44
  10. Get-ArubaCXInterfaces vlan44 | Set-ArubaCXInterfaces -ip4_address 192.0.2.254 -ip4_mask 24
  11. name : vlan44
  12. [...]
  13. active_ip4_address : 192.0.2.254/24
  14. [...]
  15. ip4_address : 192.0.2.254/24
  16. [...]
  17. #Set VRF Blue on interface vlan 44 (need to create vrf before)
  18. Get-ArubaCXInterfaces vlan44 | Set-ArubaCXInterfaces -vrf blue
  19. name : vlan44
  20. [...]
  21. vrf : @{blue=/rest/v10.09/system/vrfs/blue}
  22. [...]
  23. #Remove interface vlan 44
  24. Get-ArubaCXInterfaces vlan44 | Remove-ArubaCXInterfaces
  25. Confirm
  26. Are you sure you want to perform this action?
  27. Performing the operation "Remove interface" on target "vlan44".
  28. [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y

LLDP Neighbor

  1. #Get LLDP Neighbor of All Ports
  2. Get-ArubaCXLLDPNeighbor
  3. %2F1%2F8 1%2F1%2F9
  4. --------- ---------
  5. @{08:00:09:0d:2d:06,1/1/9=/rest/v10.09/system/interfaces/1%2F1%2F8/lldp_neighbors/08%3A00%3A09%3A0d%3A2d%3A06,1%2F1%2F9} @{08:00:09:0d:2d:06,1/1/8=/rest/v10.09/system/interfaces/1%2F1%2F9/lldp_neighbors/08%3A00%3A09%3
  6. #Get LLDP Neighbor of port 1/1/8 with depth 2
  7. Get-ArubaCXLLDPNeighbor 1/1/8 -depth 2
  8. 08:00:09:0d:2d:06,1/1/9
  9. -----------------------
  10. @{chassis_id=08:00:09:0d:2d:06; dcbx_cee_status=; mac_addr=08:00:09:0d:2d:06; med_network_policy=; neighbor_info=; neighbor_info_organizational=; port_id=1/1/9}
  11. #To Get all info, you can use
  12. (Get-ArubaCXLLDPNeighbor 1/1/8 -depth 2).'08:00:09:0d:2d:06,1/1/9'
  13. chassis_id : 08:00:09:0d:2d:06
  14. dcbx_cee_status :
  15. mac_addr : 08:00:09:0d:2d:06
  16. med_network_policy :
  17. neighbor_info : @{associated_poe_tlv_for_pd=dot3; chassis_capability_available=Bridge, Router; chassis_capability_enabled=Bridge, Router; chassis_description=Aruba ABC123 Virtual.10.09.0002;
  18. chassis_id_len=6; chassis_id_subtype=link_local_addr; chassis_index=1; chassis_name=switch; chassis_protocol=LLDP; chassis_refcount=2; chassis_ttl=120; eee_wake_time_fallback=0;
  19. eee_wake_time_rx=0; eee_wake_time_rx_echo=0; eee_wake_time_tx=0; eee_wake_time_tx_echo=0; macphy_autoneg_advertised=Other; macphy_autoneg_enabled=0; macphy_autoneg_support=0;
  20. macphy_mau_type= ; mgmt_iface_list=33554433; mgmt_iface_oid_list=1.3.6.1.2.1.31.1.1.1.1.33554433; mgmt_ip_list=192.0.2.44; pd_dot3_ext_tlv_advertised=False; pd_dot3_tlv_advertised=False;
  21. pd_med_tlv_advertised=False; port_description=1/1/9; port_hidden_in=0; port_hidden_out=0; port_id_len=5; port_id_subtype=if_name;port_lastchange=61ed751e; port_lastupdate=61ed764a;
  22. port_mfs=0; port_protocol=LLDP; power_allocated=0; power_allocated_pair_a=0; power_allocated_pair_b=0; power_class=Class0; power_devicetype=PSE; power_enabled=1; power_paircontrol=0;
  23. power_pairs=SIGNAL; power_powertype=None; power_priority=Unknown; power_requested=0; power_requested_pair_a=0; power_requested_pair_b=0; power_source=Unknown; power_supported=1;
  24. remote_index=2}
  25. neighbor_info_organizational : @{1=; 2=; 3=}
  26. port_id : 1/1/9
  27. #and for neighbor info
  28. (Get-ArubaCXLLDPNeighbor 1/1/8 -depth 2).'08:00:09:0d:2d:06,1/1/9'.neighbor_info
  29. associated_poe_tlv_for_pd : dot3
  30. chassis_capability_available : Bridge, Router
  31. chassis_capability_enabled : Bridge, Router
  32. chassis_description : Aruba ABC123 Virtual.10.09.0002
  33. chassis_id_len : 6
  34. chassis_id_subtype : link_local_addr
  35. chassis_index : 1
  36. chassis_name : switch
  37. chassis_protocol : LLDP
  38. chassis_refcount : 2
  39. chassis_ttl : 120
  40. eee_wake_time_fallback : 0
  41. eee_wake_time_rx : 0
  42. eee_wake_time_rx_echo : 0
  43. eee_wake_time_tx : 0
  44. eee_wake_time_tx_echo : 0
  45. macphy_autoneg_advertised : Other
  46. macphy_autoneg_enabled : 0
  47. macphy_autoneg_support : 0
  48. macphy_mau_type :
  49. mgmt_iface_list : 33554433
  50. mgmt_iface_oid_list : 1.3.6.1.2.1.31.1.1.1.1.33554433
  51. mgmt_ip_list : 192.0.2.44
  52. pd_dot3_ext_tlv_advertised : False
  53. pd_dot3_tlv_advertised : False
  54. pd_med_tlv_advertised : False
  55. port_description : 1/1/9
  56. port_hidden_in : 0
  57. port_hidden_out : 0
  58. port_id_len : 5
  59. port_id_subtype : if_name
  60. port_lastchange : 61ed751e
  61. port_lastupdate : 61ed7686
  62. port_mfs : 0
  63. port_protocol : LLDP
  64. power_allocated : 0
  65. power_allocated_pair_a : 0
  66. power_allocated_pair_b : 0
  67. power_class : Class0
  68. power_devicetype : PSE
  69. power_enabled : 1
  70. power_paircontrol : 0
  71. power_pairs : SIGNAL
  72. power_powertype : None
  73. power_priority : Unknown
  74. power_requested : 0
  75. power_requested_pair_a : 0
  76. power_requested_pair_b : 0
  77. power_source : Unknown
  78. power_supported : 1
  79. remote_index : 2

Firmware

Tor Get Firmware information on Aruba CX Switch

  1. #Get Firmware info
  2. Get-ArubaCXFirmware -attribute current_version -Verbose
  3. current_version : FL.10.09.0002
  4. primary_version : FL.10.09.0002
  5. secondary_version : FL.10.09.0002
  6. default_image : primary
  7. booted_image : primary
  8. #Get Firmware Status
  9. Get-ArubaCXFirmware -status
  10. date reason status
  11. ---- ------ ------
  12. 0 none none

System

for example to get/set ArubaCX System settings

  1. #Get ALL system settings
  2. Get-ArubaCXSystem
  3. aaa : @{dot1x_auth_enable=False; dot1x_remote_auth_method=eap-radius; fail_through=False; login_lockout_time=300;
  4. mac_auth_address_format=no-delimiter; mac_auth_enable=False; mac_auth_radius_auth_method=chap;
  5. portaccess_local_accounting_enable=False; radius_auth=pap; radius_retries=1; radius_timeout=5;
  6. radius_tracking_time_interval=300; radius_tracking_user_name=radius-tracking-user; tacacs_auth=pap;
  7. tacacs_timeout=5; tacacs_tracking_time_interval=300; tacacs_tracking_user_name=tacacs-tracking-user}
  8. aaa_accounting_attributes : /rest/v10.04/system/aaa_accounting_attributes
  9. aaa_server_group_prios : /rest/v10.04/system/aaa_server_group_prios
  10. aaa_server_groups : /rest/v10.04/system/aaa_server_groups
  11. acl_object_groups : /rest/v10.04/system/acl_object_groups
  12. acls : /rest/v10.04/system/acls
  13. admin_password_set : True
  14. [...]
  15. #Get hostname and timezone system settings
  16. Get-ArubaCXSystem -attribute hostname, timezone
  17. hostname timezone
  18. -------- --------
  19. switch UTC
  20. #Set hostname
  21. Set-ArubaCXSystem -hostname PowerArubaCX-Switch
  22. [...]
  23. hostname : PowerArubaCX-Switch
  24. [...]
  25. #Set timezone
  26. Set-ArubaCXSystem -timezone Europe/Paris
  27. [...]
  28. timezone : Europe/Paris
  29. [...]
  30. #Set a setting don't have (yet) parameter (usb_disable)
  31. $system = Get-ArubaCXSystem -selector writable
  32. $system.usb_disable = $true
  33. $system | Set-ArubaCXSystem -use_pipeline
  34. [...]
  35. usb_disable : True
  36. [...]

Users

You can get Users (local account) of Aruba CX

  1. #Get ALL local user
  2. Get-ArubaCXUsers
  3. admin
  4. -----
  5. /rest/v10.09/system/users/admin
  6. #Get info about admin local user
  7. Get-ArubaCXUsers -user admin
  8. authorized_keys :
  9. name : admin
  10. origin : built-in
  11. password : AQBapU0TkclkN5abVvBfWakRLdEwQAuF4jP3oqWRlwxj4avqYgAAAFw0UPMjwXH1xvCD00IaJ5YMo+OxvaA853gdPSu4cjkzvYlKIuQvQ52v6YH1wtxbBIU5nht+RMM2thytQZO7PNut4PNFnNwUP22h0Aq16IdEy2Oc2ma0csZ00l+TaGa4o8Ja
  12. user_group : @{administrators=/rest/v10.09/system/user_groups/administrators}

VRF

You can create a new VRF Add-ArubaCXVrfs, retrieve its information Get-ArubaCXVrfs, modify its properties Set-ArubaCXVrfs, or delete it Remove-ArubaCXVrfs.

  1. # Create a vrf
  2. Add-ArubaCXVrfs -name blue
  3. [...]
  4. https_server :
  5. [...]
  6. name : blue
  7. [...]
  8. rd :
  9. [...]
  10. snmp_enable : False
  11. [...]
  12. source_interface :
  13. source_ip :
  14. ssh_enable :
  15. [...]
  16. # Get information about a vrf
  17. Get-ArubaCXvrfs -name blue -attributes name, https_server, rd, ssh_enable, snmp_enable
  18. https_server :
  19. name : blue
  20. rd :
  21. snmp_enable : False
  22. ssh_enable :
  23. # Change settings of a vrf (rd, snmp, ssh, https)
  24. Get-ArubaCXVrfs blue | Set-ArubaCXVrfs -ssh_enable -https_server -snmp_enable -rd 11:22
  25. [...]
  26. https_server : @{enable=True}
  27. [...]
  28. name : blue
  29. [...]
  30. rd : 11:22
  31. [...]
  32. snmp_enable : True
  33. [...]
  34. source_interface :
  35. source_ip :
  36. ssh_enable : True
  37. [...]
  38. # Remove a vrf
  39. Get-ArubaCXVrfs blue | Remove-ArubaCXVrfs
  40. Confirm
  41. Are you sure you want to perform this action?
  42. Performing the operation "Remove Vrf blue" on target "Vrf".
  43. [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y

VM

You can use PowerArubaCX for help to deploy Aruba CX OVA on VMware ESXi (With a vCenter)
You need to have VMware.PowerCLI and Set-VMKeystrokes from William Lam

You can use the following cmdlet (on this order)

  • Deploy-ArubaCXVm Deploy CPPM OVA with add hard disk
  • Set-ArubaCXVMFirstBootPassword Configure first boot (Password…)
  • Set-ArubaCXVMMgmtOobm Configure OOBM Interface (ip, default-gateway)

MultiConnection

From release 0.4.0, it is possible to connect on same times to multi Aruba CX
You need to use -connection parameter to cmdlet

For example to get system of 2 ArubaCX

  1. # Connect to first ArubaCX
  2. $cx1 = Connect-ArubaCX 192.0.2.1 -SkipCertificateCheck -DefaultConnection:$false
  3. #DefaultConnection set to false is not mandatory but only don't set the connection info on global variable
  4. # Connect to second ArubaCX
  5. $cx2 = Connect-ArubaCX 192.0.2.2 -SkipCertificateCheck -DefaultConnection:$false
  6. # Get System hostname and mgmt interface for first ArubaCX Switch
  7. Get-ArubaCXSystem -attributes mgmt_intf, hostname -connection $cx1
  8. hostname mgmt_intf
  9. -------- ---------
  10. PowerArubaCX-Switch1 @{admin_state=up; default_gateway=10.200.11.254; dns_server_1=10.200.11.254; dns_server_2=0.0.0.0; ip=10.200.11.1; mode=static;
  11. # Get Interface for second ArubaCX Switch
  12. Get-ArubaCXSystem -attributes mgmt_intf, hostname -connection $cx2
  13. hostname mgmt_intf
  14. -------- ---------
  15. PowerArubaCX-Switch2 @{admin_state=up; default_gateway=10.200.11.254; dns_server_1=10.200.11.254; dns_server_2=0.0.0.0; ip=10.200.11.2; mode=static;
  16. #Each cmdlet can use -connection parameter

Disconnecting

  1. # Disconnect from the Aruba CX Switch
  2. Disconnect-ArubaCX

List of available command

  1. Add-ArubaCXEvpnVlans
  2. Add-ArubaCXInterfaces
  3. Add-ArubaCXInterfacesLagInterfaces
  4. Add-ArubaCXInterfacesVlanTrunks
  5. Add-ArubaCXVlans
  6. Add-ArubaCXVrfs
  7. Confirm-ArubaCXInterfaces
  8. Confirm-ArubaCXSystem
  9. Confirm-ArubaCXVlans
  10. Confirm-ArubaCXVrfs
  11. Connect-ArubaCX
  12. Deploy-ArubaCXVm
  13. Disconnect-ArubaCX
  14. Get-ArubaCXFirmware
  15. Get-ArubaCXInterfaces
  16. Get-ArubaCXLLDPNeighbor
  17. Get-ArubaCXSystem
  18. Get-ArubaCXUsers
  19. Get-ArubaCXVlans
  20. Get-ArubaCXVrfs
  21. Invoke-ArubaCXRestMethod
  22. Remove-ArubaCXInterfaces
  23. Remove-ArubaCXInterfacesLagInterfaces
  24. Remove-ArubaCXInterfacesVlanTrunks
  25. Remove-ArubaCXVlans
  26. Remove-ArubaCXVrfs
  27. Set-ArubaCXCipherSSL
  28. Set-ArubaCXInterfaces
  29. Set-ArubaCXSystem
  30. Set-ArubaCXuntrustedSSL
  31. Set-ArubaCXVlans
  32. Set-ArubaCXVMFirstBootPassword
  33. Set-ArubaCXVMMgmtOobm
  34. Set-ArubaCXVrfs
  35. Show-ArubaCXException

Author

Alexis La Goutte

Special Thanks

  • Warren F. for his blog post ‘Building a Powershell module’
  • Erwan Quelin for help about Powershell

License

Copyright 2018-2022 Alexis La Goutte and the community.