OpenStack UI Plugin

General

Integration with the Openstack interface is our second plugin alongside the oVirt/RHV virtualization family. Thanks to it, you can perform most of the basic operations without logging into the vProtect dashboard.
After installation (which is described at the end of this article) you will see a new tab "vProtect" in the OpenStack menu.

Dashboard

The dashboard consists of several tabs that allow you to perform basic actions such as backup, restore or create a new schedule.

Backup

This tab shows all inventoried instances in your OpenStack environment.
Besides, you can also perform basic backup operations.

Restore

This tab displays all instances in the OpenStack environment that can be restored.
Restore window:

Schedule

As the name suggests, this tab allows you to create schedules, but not only.
Thanks to it, we will also create the policies necessary for their operation.

Tasks

Basic information about current tasks performed by vProtect.

OpenStack general integration setup

You can find the add-on in the GitHub repository. Extract the provided archive on to your Horizon host and execute python install.py VPROTECT_API_URL USER PASSWORD
Example: python install.py http://localhost:8080/api admin vPr0tect.
Note: you need to restart your Horizon HTTP server after this
The above-mentioned script will copy the plug-in files to the following folders:
  • /usr/share/openstack-dashboard/openstack_dashboard/dashboards/vprotect - plugin files
  • /usr/share/openstack-dashboard/openstack_dashboard/enabled - file to enable plugin
In order to uninstall it, remove the vprotect subfolder and enabled/_50_vprotect.py file and restart your Horizon HTTP server.

Integrate vProtect dashboard plugin to OpenStack (LXC)

Requirements:
  • git, python3-yaml packages
  • internet connection
  1. 1.
    Check name of the horizon container:
    1
    lxc-ls -f | grep horizon
    2
    3
    example:
    4
    5
    [[email protected] ~]# lxc-ls -f | grep horizon aio1_horizon_container-b2daccaa RUNNING 1 onboot, openstack 10.255.255.213, 172.29.239.229 - false
    Copied!
  2. 2.
    Enter horizon container:
    1
    [[email protected] ~]# lxc-attach aio1_horizon_container-b2daccaa
    Copied!
  3. 3.
    Install requirements packages:
    1
    [email protected]:~# apt install python3-yaml git -y
    Copied!
  4. 4.
    Clone from github instalations files:
    1
    [email protected]:~# git clone https://github.com/Storware/openstack-horizon-ui-vprotect-extensions
    Copied!
  5. 5.
    Change owner of the plugin directory to horizon:horizon
    1
    [email protected]:~# chown -R horizon:horizon openstack-horizon-ui-vprotect-extensions
    Copied!
  6. 6.
    Enter plugin directory:
    1
    [email protected]:~# cd openstack-horizon-ui-vprotect-extensions
    Copied!
  7. 7.
    Optionally you can ping vprotect server by ping
    1
    [email protected]:~# ping vprotect-server-IP-ADDRESS
    Copied!
  8. 8.
    Next, install the plugin
    1
    [email protected]:~# python3 install.py http://vprotect-ip:8080/api admin_user admin_password
    Copied!
    When the installation process is completed, plugin files should be placed in /usr/share/openstack-dashboard/openstack_dashboard directory. If your path to dashboard directory is different, create symbolic links from plugin install directories to non-standard directories.
    Example:
    1
    [email protected]:~# ln -s /usr/share/openstack-dashboard/openstack_dashboard/dashboards/vprotect /openstack/venvs/horizon-23.1.0.dev65/lib/python3.8/dist-packages/openstack_dashboard/dashboards/
    2
    3
    [email protected]:~# ln -s /usr/share/openstack-dashboard/static/vprotect /openstack/venvs/horizon-23.1.0.dev65/lib/python3.8/dist-packages/static/
    4
    5
    [email protected]:~# ln -s /usr/share/openstack-dashboard/openstack_dashboard/enabled/_50_vprotect.py /openstack/venvs/horizon-23.1.0.dev42/lib/python3.8/dist-packages/openstack_dashboard/enabled/
    Copied!
  9. 9.
    Edit /etc/apache2/sites-available/openstack-dashboard.conf file:
    • Add alias for static files
    1
    Alias /dashboard/static /openstack/venvs/horizon-23.1.0.dev65/lib/python3.8/dist-packages/static/
    Copied!
    • Directory tag informs you, where dashboards directories should be placed.
    • Second Directory tag informs where static directory from plugin should be placed
    Example configuration file should look like this:
    1
    # Ansible managed
    2
    3
    # If horizon is being served via SSL from this web server,
    4
    # then we must redirect HTTP requests to HTTPS.
    5
    6
    # If horizon is being served via SSL via a load balancer, we
    7
    # need to listen via HTTP on this web server. If SSL is not
    8
    # enabled, then the same applies.
    9
    <VirtualHost 172.29.239.229:80>
    10
    ServerName aio1-horizon-container-b2daccaa.openstack.local
    11
    LogLevel info
    12
    ErrorLog syslog:daemon
    13
    CustomLog "|/usr/bin/env logger -p [daemon.info](http://daemon.info/) -t apache2" "%h %l %u \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""
    14
    Options +FollowSymLinks
    15
    RequestHeader set X-Forwarded-Proto "https"
    16
    17
    WSGIScriptAlias / /openstack/venvs/horizon-23.1.0.dev65/lib/python3.8/dist-packages/openstack_dashboard/wsgi.py
    18
    WSGIDaemonProcess horizon user=horizon group=horizon processes=1 threads=1 python-path=/openstack/venvs/horizon-23.1.0.dev65/lib/python3.8/site-packages
    19
    20
    WSGIProcessGroup horizon
    21
    WSGIApplicationGroup %{GLOBAL}
    22
    23
    <Directory /openstack/venvs/horizon-23.1.0.dev65/lib/python3.8/dist-packages/openstack_dashboard>
    24
    <Files wsgi.py >
    25
    <IfVersion < 2.4>
    26
    Order allow,deny
    27
    Allow from all
    28
    </IfVersion>
    29
    <IfVersion >= 2.4>
    30
    Require all granted
    31
    </IfVersion>
    32
    </Files>
    33
    </Directory>
    34
    35
    Alias /static /openstack/venvs/horizon-23.1.0.dev65/lib/python3.8/dist-packages/static/
    36
    Alias /dashboard/static /openstack/venvs/horizon-23.1.0.dev65/lib/python3.8/dist-packages/static/
    37
    38
    <Directory /openstack/venvs/horizon-23.1.0.dev65/lib/python3.8/dist-packages/static/>
    39
    Options -FollowSymlinks
    40
    <IfVersion < 2.4>
    41
    AllowOverride None
    42
    Order allow,deny
    43
    Allow from all
    44
    </IfVersion>
    45
    <IfVersion >= 2.4>
    46
    Require all granted
    47
    </IfVersion>
    48
    </Directory>
    49
    </VirtualHost>
    Copied!
  10. 10.
    Edit /openstack/venvs/horizon-23.1.0.dev65/lib/python3.8/dist-packages/openstack_dashboard/urls.py and add in urlPatterns following line
    1
    url(r'^dashboard/', horizon.base._wrapped_include(horizon.urls))
    Copied!
    Your urls.py should looks like:
    1
    """
    2
    URL patterns for the OpenStack Dashboard.
    3
    """
    4
    5
    from django.conf import settings
    6
    from django.conf.urls import include
    7
    from django.conf.urls.static import static
    8
    from django.conf.urls import url
    9
    from django.contrib.staticfiles.urls import staticfiles_urlpatterns
    10
    from django.views import defaults
    11
    12
    import horizon
    13
    import horizon.base
    14
    from horizon.browsers import views as browsers_views
    15
    from horizon.decorators import require_auth
    16
    17
    from openstack_dashboard.api import rest
    18
    from openstack_dashboard import views
    19
    20
    urlpatterns = [
    21
    url(r'^#x27;, views.splash, name='splash'),
    22
    url(r'^api/', include(rest.urls)),
    23
    url(r'^header/', views.ExtensibleHeaderView.as_view()),
    24
    url(r'', horizon.base._wrapped_include(horizon.urls)),
    25
    **url(r'^dashboard/', horizon.base._wrapped_include(horizon.urls)),**
    26
    ]
    27
    28
    # add URL for ngdetails
    Copied!
  11. 11.
    Restart httpd service
    1
    /etc/init.d/apache2 restart
    Copied!
  12. 12.
    After refreshing dashboard site you should see vProtect button in Openstack menu.
Last modified 15d ago