KB10067 How to create update openstack plugin update script.
KB ID: 10067
Product: vProtect
Version: not applicable
Published: 2022-01-23
Last modified: 2022-01-23
Solution
Connect to all co nodes via ssh one by one.
connect to first controller node.
Connect to the first compute node[root@centos]# ssh root@controller254
List containers.
Create scripts filesroot@controller254:~# lxc-ls -f | grep horizon
controller254_horizon_container-161c9e6d RUNNING 1 onboot, openstack 10.0.3.65, 172.29.238.1 - false
Attach horizon container.
Edit script filesroot@controller254:~# lxc-attach controller254_horizon_container-161c9e6d
root@controller254-horizon-container-161c9e6d:~#
Create update script
Create update scriptroot@controller254-horizon-container-161c9e6d:~# nano update.sh
echo " UPDATING openstack-horizon-ui-vprotect-extensions"
mv -R openstack-horizon-ui-vprotect-extensions openstack-horizon-ui-vprotect-extensions.copy
git clone https://github.com/Storware/openstack-horizon-ui-vprotect-extensions
chown -R horizon:horizon openstack-horizon-ui-vprotect-extensions
cd openstack-horizon-ui-vprotect-extensions
python3 install.py http://VPROTECT_IP:8080/api admin vPr0tect
cp -R /usr/share/openstack-dashboard/openstack_dashboard/dashboards/vprotect /openstack/venvs/horizon-23.1.0/lib/python3.8/dist-packages/openstack_dashboard/dashboards/
chown -R horizon:horizon /openstack/venvs/horizon-23.1.0/lib/python3.8/dist-packages/openstack_dashboard/dashboards/
cp -R /usr/share/openstack-dashboard/static/vprotect /openstack/venvs/horizon-23.1.0/lib/python3.8/dist-packages/static/
chown -R horizon:horizon /openstack/venvs/horizon-23.1.0/lib/python3.8/dist-packages/static/
cp /usr/share/openstack-dashboard/openstack_dashboard/enabled/_50_vprotect.py /openstack/venvs/horizon-23.1.0/lib/python3.8/dist-packages/openstack_dashboard/enabled/
chown -R horizon:horizon /openstack/venvs/horizon-23.1.0/lib/python3.8/dist-packages/openstack_dashboard/enabled/
/etc/init.d/apache2 restart
echo " FINISH "Correct paths in script file.
Set permission to script file
set permission to script fileroot@controller254-horizon-container-161c9e6d:~# chmod +x ./update.sh
Run script.
Run script fileroot@controller254-horizon-container-161c9e6d:~# ./update.sh
- Create same scripts or copy to other controller nodes.
- Test solution.
Same script can be used other version of openstack container.