CTERA Portal Installations > OpenStack > Upgrading CTERA Portal > Automating the Portal Image and Software Upgrade Using Ansible
Automating the Portal Image and Software Upgrade Using Ansible
Note: Customers without Internet access and upgrading the Portal image from version 6.0.x, require manually installing packages for syslog functionality for offline servers:
i Upgrade the portal image with the latest image file, as described in Automating the Portal Image and Software Upgrade Using Ansible, but do not run the setup wizard.
ii Copy the archive file, exported_images.tar.gz, to a local folder on the portal machine.
Note: The file is available for download from CTERA support.
iii Run the following CLI command on all servers (including main, Replica, DB, and Preview servers): portal-syslog-client load_images images_archive_path
where images_archive_path is the path to the local folder where you copied the archive file.
iv Run the setup wizard.
If the setup wizard was run prior to loading the new packages, you must rerun the CLI portal-syslog-client load_images images_archive_path and then restart all servers.
If you do not run the CLI command, the syslog functionality will not work and an error message is generated. However, if you do not run the CLI command, apart from the error message, there is no impact on portals where syslog functionality is not used.
To upgrade CTERA Portal:
1 Download the two Ansible zip files, AnsiblePackage and AnsibleScripts, either to a dedicated linux server or to the portal database server, from the CTERA download center: https://kb.ctera.com/display/CKB/Download+Center.
Note: CTERA recommends using a dedicated server for the Ansible server, which must have an SSH connection open to all the portal servers. If this option is not available, use the portal database server to host the Ansible server.
2 Unzip ansiblePackage.tar.gz and navigate to the AnsiblePackage directory.
3 Run the following command: rpm --import RPM-GPG-KEY-EPEL-7
4 Run the following command: yum install *.rpm
5 Run the following command: pip install --ignore-installed six-1.12.0-py2.py3-none-any.whl
6 Get the latest portal image from CTERA and copy the image to /usr/local/lib/ctera/upgrade in the Ansible server. The image is provided in one of the following ways:
*portal-installer-linux-<version>.tar.bz2.gpg and RPM-GPG-PubKey.asc
*portal-installer-linux-<version>.tar.bz2
where <version> is the version of the portal image.
7 Unzip AnsibleScripts.tar.gz to /etc/ansible.
Note: AnsibleScripts.tar.gz contains the files playbook.yml and config.ini and the roles directory.
8 Edit config.ini as follows:
Parameter
Notes
privatkey=<path to privatekey>
If the connection to the server is via private key, enter the path to the key.
username=<rootUser>
If the connection to the server is not via private key, enter the root user and password
password=<password>
DBserverIP=<DB server IP>
Enter the database IP address, used to retrieve all the portal server IPs.
portalinstallerlinux=<Image_version>
Enter the CTERA Portal Image version.
Note: If left empty, the portal image is not upgraded. When upgrading both the portal image and the portal software, you must upgrade the portal image before upgrading the portal software.
CTERAPortal=<Portal_version>
Enter the CTERA Portal software version.
Note: If left empty, the portal software is not upgraded. In this case, upgrade the software as described in Upgrading the Portal Software (Via the UI or CLI).
9 If the Ansible server is a dedicated server, complete editing config.ini as follows:
Parameter
Notes
upgradeDB=yes
All the servers are upgraded at once (except the replication server which has a separate configuration).
upgradeTomcats=yes
upgradeReplica=<yes/no>
If set to yes, the replication server is upgraded. If set to no, the replication server is not upgraded.
10 If the Ansible server is on the portal database server, complete editing config.ini as follows:
Parameter
Notes
upgradeDB=yes
Only the database server is upgraded.
upgradeTomcats=no
All the server except for the database server are not upgraded.
upgradeReplica=no
11 Run the following command: ansible-playbook playbook.yml
*If the Ansible server is a dedicated server:
*All the portal servers are upgraded except for the replication server if upgradeReplica was set to no.
*If the kernel was upgraded the server is rebooted.
*If the Ansible server is in the portal database server:
*The portal database server is upgraded.
*If the kernel was upgraded the server is rebooted.
The images are updated before the software is updated.
12 You must rerun the upgrade so that all the servers, Tomcats, database server and replica server are upgraded to the same version. Continue the upgrade as described in Rerunning the Upgrade in Different Scenarios.
The upgrade logs for all the servers are written to /etc/ansible/logs in the Ansible server.
Rerunning the Upgrade in Different Scenarios
Rerunning the upgrade multiple times only upgrades servers that were previously not upgraded. Any server that was upgraded is ignored.
If the Ansible server is a dedicated server and upgradeReplica was set to no:
*Change the config.ini file as follows and rerun ansible-playbook playbook.yml
Parameter
Notes
upgradeDB=no
The portal servers except for the replication server are skipped during the upgrade process.
upgradeTomcats=no
upgradeReplica=yes
The replication server is upgraded.
If the kernel was upgraded the server is rebooted.
If the Ansible server is in the portal database server:
*Change the config.ini file as follows and rerun ansible-playbook playbook.yml
Parameter
Notes
upgradeDB=no
The portal database server is skipped during the upgrade process.
upgradeTomcats=yes
All the portal servers are upgraded
upgradeReplica=<yes/no>
If set to yes, the replication server is upgraded. If set to no, the replication server is not upgraded.
If the kernel was upgraded the server is rebooted.
If the Ansible server is in the portal database server and upgradeReplica was set to no:
*change the config.ini file as follows and rerun ansible-playbook playbook.yml
Parameter
Notes
upgradeDB=no
The portal servers except for the replication server are skipped during the upgrade process.
upgradeTomcats=no
upgradeReplica=yes
The replication server is upgraded.
If the kernel was upgraded the server is rebooted.