F5 Big-IP Licensing BIGIQ

From UVOO Tech Wiki
Jump to navigation Jump to search

It appears you need to have a local admin user account due to the need to reboot before applying new license so make sure you have that. You can run some of these commands using your LDAP/AD/SSO user but for simplicity we will just use the admin user.

Also, you can use gui to do reboot or license apply but this will have command line commands via ssh bash.

Get your list of hosts in format like so: Use your license and status for each host. lb01.example.com YYYYY-YYYYY--YYYYY-XXXXXXX status:standby lb02.example.com ZZZZZ-YYYYY--YYYYY-XXXXXXX status:active

Steps

Send all the stand-by hosts for BigIQ removal - BIG-IQ GUI:

- Licenses->   Remove all Services

You then must 1. reboot your host:

 - ssh admin@lb01.example.com
 - reboot

2. When host comes up apply license:

- ssh admin@lb01.example.com
- tmsh install /sys license registration-key YYYYY-YYYYY--YYYYY-XXXXXXX

- reboot - ssh admin@lb01.example.com - tmsh show /sys license 3. When license is applied and you've validated host is working correctly force stand-by on BigIP Active host so you can upgrade it.

- ssh admin@lb01.example.com
- tmsh run /sys failover standby
* send host to ATOS so they can remove
- reboot
- ssh admin@lb02.example.com
- tmsh install /sys license registration-key ZZZZZ-YYYYY--YYYYY-XXXXXXX

- reboot - ssh admin@lb02.example.com - tmsh show /cm sync-status - tmsh show /sys license

Script

Here is an example script to get status of each host. You obviously parse this int csv or sqldb but this is just quick and dirty I wrote today. You could use "tmsh show /sys license" command to validate licenses after you are done as well

get-licenses.sh

#!/bin/bash
set -eu

F5_USER="$YOUR_USER"
F5_PASS="$YOUR_PASS"

hosts=(
"lb01.example.com"
"lb02.example.com"
)


ssh_cmd(){
  ssh_host="$1"
  cmd=$2
  sshpass -p "$F5_PASS" ssh $F5_USER@$ssh_host "$cmd"
}

for host in "${hosts[@]}"; do
  #out=$(ssh_cmd "$host" "show /cm failover-status" | grep "^Status")
  out=$(ssh_cmd "$host" "show /sys license" | grep "^Platform")
  # out=$(ssh_cmd "$host" "show /cm sync-status" | grep "^Status")
  echo $host $out
done