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.

  1. connect to first controller node.

    Connect to the first compute node

    [root@centos]# ssh root@controller254

  2. List containers.

    Create scripts files

    root@controller254:~# lxc-ls -f | grep horizon

    controller254_horizon_container-161c9e6d RUNNING 1 onboot, openstack 10.0.3.65, 172.29.238.1 - false

  3. Attach horizon container.

    Edit script files

    root@controller254:~# lxc-attach controller254_horizon_container-161c9e6d

    root@controller254-horizon-container-161c9e6d:~#

  4. Create update script

    Create update script

    root@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.

  5. Set permission to script file

    set permission to script file

    root@controller254-horizon-container-161c9e6d:~# chmod +x ./update.sh

  6. Run script.

    Run script file

    root@controller254-horizon-container-161c9e6d:~# ./update.sh

  7. Create same scripts or copy to other controller nodes.
  8. Test solution.

Same script can be used other version of openstack container.