Upgrade from LiCO 7.1.0 to 7.2.0 for Container Deployment


1. Stop LiCO Container

lico-control stop
docker rename lico lico_7.1

2.Prepare to upgrade

Step 1. Log in to the management node.

Step 2. Edit /root/lico_release.local and update the environment variables listed in that file:

# Management node hostname
# IP address of management node
# Old version of repository directory for LiCO and the version of LiCO in
# the current system
# Old version of repository directory for LiCO-dep and
# the version of LiCO-dep in the current system
# New version of repository directory for LiCO, please change it according to LiCO version
# New version of LiCO repository directory for LiCO-dep,
# please change it according to LiCO-dep version
# Link name of LiCO repository directory for LiCO
# Link name of LiCO repository directory for LiCO-dep
# Existing shared directories for LiCO
# Shared directories of repo file in LiCO Installation Guide
# link name of directory for lico moniotr
# Local directory for for lico monitor, please change it according to this version.

Step 3. Save the changes to lico_release.local and reload the environment variables:

chmod 600 lico_release.local
source lico_release.local

3. Build LiCO image

Step 1. Prepare packages. Download the following packages and upload all of them to the /root directory:

• Lenovo-OpenHPC-2.6.2.EL8.x86_64.tar:

https://hpc.lenovo.com/lico/downloads/7.2/Lenovo-OpenHPC-2.6.2.EL8.x86_64.tar • lico-dep-7.2.0.el8.x86_64.tgz:

https://hpc.lenovo.com/lico/downloads/7.2/lico-dep-7.2.0.el8.x86_64.tgz • authselect.tar.gz:

https://hpc.lenovo.com/lico/downloads/7.2/examples/conf/authselect/authselect.tar.gz • LiCO 7.2.0 release package lico-release-7.2.0.el8.x86_64.tar.gz:

https://commercial.lenovo.com/cn/en/signin • LiCO 7.2.0 docker package lico-docker-7.2.0.x86_64.tar.gz:


Step 2. Prepare build environment:

cd /root
mkdir -p $lico_container_workspace
tar -xzvf lico-docker-7.2.0.x86_64.tar.gz -C $lico_container_workspace
mv Lenovo-OpenHPC-2.6.2.EL8.x86_64.tar $lico_container_workspace
mv lico-dep-7.2.0.el8.x86_64.tgz $lico_container_workspace
mv lico-release-7.2.0.el8.x86_64.tar.gz $lico_container_workspace
mv authselect.tar.gz $lico_container_workspace

cp $lico_container_workspace/lico-docker/Dockerfile \
$lico_container_workspace/lico-docker/scripts/build.sh $lico_container_workspace

\cp $lico_container_workspace/lico-docker/scripts/lico-control /usr/bin/

chmod +x $lico_container_workspace/build.sh
chmod +x /usr/bin/lico-control

Step 3. Build LiCO image:

cd $lico_container_workspace

4. Backup

mkdir -p $backup_dir
cd $lico_container_workspace/lico-docker/upgrade
python3 container-upgrade backup --backup-path $backup_dir --backup-db --backup-config --backup-sharedir

Upgrade software on management node

Step 1. Upgrade LiCO icinga2 plugin:

systemctl stop icinga2
nodeshell all systemctl stop icinga2
rm -rf /opt/lico/pub/monitor
mkdir -p $lico_monitor_dir
tar -xvzf openlico-monitor-1.1.0.x86_64.tgz -C $lico_monitor_dir
rm -rf $link_lico_monitor_dir
ln -s $lico_monitor_dir $link_lico_monitor_dir
python3 $link_lico_monitor_dir/install.py

Step 2. Set and create a backup directory:

mkdir -p $icinga_backup

Step 3. Configure icinga global template file on management node:

Step 4. Define icinga zone file:

Step 5. Enable influxdbwriter feature for icinga:

Step 6. Restart the icinga2 service to make the changes take effect.

nodeshell all systemctl restart icinga2
systemctl restart icinga2

Deploy LiCO 7.2 container

Step 1. Prepare the mount folder and configure the file

rm -rf /etc/lico
lico-control prepare

Step 2. merge the config file

cp  $backup_dir/head/configure/lico/nodes.csv /etc/lico/
cd /root/lico-workspace/7.2.0/lico-docker/upgrade/
python3 container-upgrade merge-config --backup-path $backup_dir

Step 3. Initial data for LiCO

lico-control init --mode  lico

lico-control init --mode  cloudtools

Step 4. Start the Container

lico-control run 
lico-control docker-cmd remove lico_7.1


Stop LiCO 7.2 container
lico-control stop
lico-control docker-cmd rename lico lico_7.2
restore database, config files and share dir
cd $lico_container_workspace/lico-docker/upgrade/
python3 container-rollback --backup-path $backup_dir --restore-db --restore-sharedir
restore software in management node
systemctl stop icinga2
nodeshell all systemctl stop icinga2
rm -rf /opt/lico/pub/monitor
source lico_env.local 
mkdir -p $lico_monitor_dir
tar -xvzf openlico-monitor-1.0.0.x86_64.tgz -C $lico_monitor_dir
rm -rf $link_lico_monitor_dir
rm -rf $new_lico_monitor_dir
ln -s $lico_monitor_dir $link_lico_monitor_dir
python3 $link_lico_monitor_dir/install.py
nodeshell all systemctl start icinga2

start LiCO 7.1 container
lico-control run  --image lico:7.1.0
lico-control docker-cmd remove lico_7.2