You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

How to use CNaaS NMS for firmware upgrades? Well, this guide will try to describe how to do it step by step.

Any hostnames MUST be replaced with your own hostnames or IP addresses.


First, check if the firmware is already downloaded. If it's already present, there is no need to download it again.

CLI:

CNaaS NMS (norpan-nms)# show files
EOS-4.24.2.3F.swi

CURL:

: 18:00 root@norpan-nms: ~ # curl -s -k -H "Authorization: Bearer ${JWT_AUTH_TOKEN}" https://norpan-nms.cnaas.io/api/v1.0/firmware | jq .
{
"status": "success",
"data": {
"files": [
"EOS-4.24.2.3F.swi"
]
}
}


If the firmware is not present in the previous step, we must download it.

CLI:

CNaaS NMS (norpan-nms)# download url https://test.example.com/EOS-4.24.2.3F.swi sha1 18ed4efc42933a66c62a3ba90aeb31d6e2ad208c verify_tls true

CURL:

: 18:00 root@norpan-nms: ~ # curl -s -k -H "Authorization: Bearer ${JWT_AUTH_TOKEN}" https://norpan-nms.cnaas.io/api/v1.0/firmware -X POST -H "Content-Type: application/json" -d '{"url": "https://test.example.com/EOS-4.24.2.3F.swi", "sha1": "18ed4efc42933a66c62a3ba90aeb31d6e2ad208c", "verify_tls": false}'

In the commands above, we have three different arguments:

  • url: The URL from where we can download the firmware image.
  • sha1: The SHA1 checksum of the firmware, we use this to verify that we really downloaded it.
  • verify_tls: If we should ignore invalid SSL certificates or not.

Upgrade the devices

The last step is to upgrade the devices.


CLI:

CNaaS NMS (norpan-nms)# firmware_upgrade hostname a1 filename EOS-4.24.2.3F.swi url http://norpan-nms.cnaas.io/firmware/ pre_flight true download true reboot true activate true post_flight true post_waittime 600

CURL:

curl -k -s -H "Content-Type: application/json" -H "Authorization: Bearer ${JWT_AUTH_TOKEN}" -X POST https://norpan-nms.cnaas.io/api/v1.0/firmware/upgrade -d '{"hostname": "a1", "filename": "EOS-4.24.2.3F.swi", "url": "http://norpan-nms.cnaas.io/firmware/", "pre-flight": true, "download": true, "activate": true, "reboot": true, "post_flight: true, "post_waittime": 600}'


As can be seen above, we have a few arguments here as well:

  • hostname: The hostname of the device to upgrade. This can be replaced with group if you want to upgrade one or more devices.
  • filename: The filename of the firmware to install.
  • url: The URL from where the DEVICE can download the firmware, should be the NMS server we downloaded the firmware to in a previous step.
  • pre_flight: Do some basic checks before upgrading. Check free diskspace etc.
  • download: If we should download the firmware or not.
  • activate: If we should install the firmware or not.
  • reboot: If the device(s) should be rebooted or not.
  • post_flight: Update the OS verison etc in the NMS database after the firmwar is installed.
  • post_waittime: How long to wait (in seconds) before trying to perform the post_flight step. This is needed since it can take up to 10 minutes for a device to reboot.


  • No labels