Files
horizon/openstack_dashboard/dashboards/project/volumes/urls.py
Rich Hagarty 36c763168a Add Horizon support for volume consistency groups
Cinder has added support for creating and managing volume consistency
groups. This first patch adds this functionality into Horizon.
Subsequent patches will add features to utilize these consistency
groups - such as for creating snapshots.

Background/setup info:
This feature provides a Horizon interface to the Cinder consistency
groups (CG) API.   CGs allow a user to group a set of volumes together,
and then perform actions on all of the volumes in one command.

For example:
- Create CG snapshot. This will pause all volume I/O and create a
  snapshot for each volume in the CG at the same point in time.
- Create CG from another CG. This will clone a new set of volumes based
  on the current state of all volumes in the original CG.
- Create CG from CG snapshot. This will clone new set of volumes based
  on the saved state of all snapshots from the original CG snapshot.

This patch is limited to just creating consistency groups. A second
and final patch will add the snapshot features.

To run the patch, you will need to enable some consistency group
policies, which currently are defaulted to "none", which means they
are disabled.

The policies are set in /etc/cinder/policy.json - they need to be set
to the following:

    "consistencygroup:create" : "rule:admin_or_owner",
    "consistencygroup:delete": "rule:admin_or_owner",
    "consistencygroup:update": "rule:admin_or_owner",
    "consistencygroup:get": "rule:admin_or_owner",
    "consistencygroup:get_all": "rule:admin_or_owner",

    "consistencygroup:create_cgsnapshot" : "rule:admin_or_owner",
    "consistencygroup:delete_cgsnapshot": "rule:admin_or_owner",
    "consistencygroup:get_cgsnapshot": "rule:admin_or_owner",
    "consistencygroup:get_all_cgsnapshots": "rule:admin_or_owner",

Once this is done, you will need to restart all 3 of the cinder
services in "screen -r" (c-api, c-sch, and c-vol).

The new panel is a tab named "Volume Consistency Groups" and is
located in "Project -> Volumes".

Co-Authored-By: Brad Pokorny <brad_pokorny@symantec.com>
Change-Id: I33ebe39e79d7c1d1dc7e741b4199bcb259b642d1
Partially-implements: blueprint cinder-consistency-groups
2016-03-17 09:42:27 -07:00

45 lines
1.9 KiB
Python

# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.conf.urls import include
from django.conf.urls import patterns
from django.conf.urls import url
from openstack_dashboard.dashboards.project.volumes.backups \
import urls as backups_urls
from openstack_dashboard.dashboards.project.volumes.cgroups \
import urls as cgroup_urls
from openstack_dashboard.dashboards.project.volumes.snapshots \
import urls as snapshot_urls
from openstack_dashboard.dashboards.project.volumes import views
from openstack_dashboard.dashboards.project.volumes.volumes \
import urls as volume_urls
urlpatterns = patterns(
'',
url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^\?tab=volumes_and_snapshots__snapshots_tab$',
views.IndexView.as_view(), name='snapshots_tab'),
url(r'^\?tab=volumes_and_snapshots__volumes_tab$',
views.IndexView.as_view(), name='volumes_tab'),
url(r'^\?tab=volumes_and_snapshots__backups_tab$',
views.IndexView.as_view(), name='backups_tab'),
url(r'^\?tab=volumes_and_snapshots__cgroups_tab$',
views.IndexView.as_view(), name='cgroups_tab'),
url(r'', include(volume_urls, namespace='volumes')),
url(r'backups/', include(backups_urls, namespace='backups')),
url(r'snapshots/', include(snapshot_urls, namespace='snapshots')),
url(r'cgroups/', include(cgroup_urls, namespace='cgroups')),
)