Browse Source

Renamed 'servicevm' 'advsvc' in tacker install file

Initially the service name was 'servicevm' and 'advsvc' in install file.
Now it's been renamed to 'tacker' and 'nfv-role'. Change in install file
(tacker/devstack/lib/tacker) was necessary to show the updated names
in horizon/dashboard for tacker service.

Change-Id: I740f3bfe04525d616c8f7df2847cee8a8d2b1cab
Depends-on: I919d77276af72586a20f50239166325adbf9fb11
Depends-on: I097ccbfb7ae192410400b06bd8796e81e62ee65e
Closes-Bug: #1524224
changes/04/258404/17
an.abdulrehman 7 years ago committed by Abdul Rehman
parent
commit
3132ca51be
  1. 53
      devstack/lib/tacker
  2. 2
      doc/source/devref/monitor-api.rst
  3. 2
      etc/init.d/tacker-server
  4. 0
      etc/tacker/rootwrap.d/tacker.filters
  5. 6
      etc/tacker/tacker.conf
  6. 10
      setup.cfg
  7. 4
      tacker/common/clients.py
  8. 2
      tacker/db/migration/alembic_migrations/versions/1c6b0d82afcd_servicevm_framework.py
  9. 22
      tacker/tests/unit/services/vm/test_servicevm_extension.py
  10. 6
      tacker/vm/drivers/heat/heat.py
  11. 14
      tacker/vm/drivers/nova/nova.py
  12. 8
      tacker/vm/monitor.py
  13. 20
      tacker/vm/plugin.py

53
devstack/lib/tacker

@ -25,7 +25,7 @@
# - stop_tacker
# - cleanup_tacker
# Tacker SeviceVM
# Tacker
# ---------------
# Save trace setting
@ -117,18 +117,13 @@ function create_tacker_cache_dir {
# Migrated from keystone_data.sh
function create_tacker_accounts {
if is_service_enabled tacker; then
# openstack user create tacker --password service-password
# openstack role add admin --user <uuid> --project service
create_service_user "tacker"
get_or_create_role "advsvc"
create_service_user "tacker" "advsvc"
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
# openstack service create servicevm --name tacker '--description=tacker Service'
local tacker_service=$(get_or_create_service "tacker" \
"servicevm" "Tacker Service")
# openstack endpoint create <uuid of service> --region RegionOne --publicurl 'http://143.183.96.146:8888/' --adminurl 'http://143.183.96.146:8888/' --internalurl 'http://143.183.96.146:8888/'
"nfv-orchestration" "Tacker NFV Orchestration Service")
get_or_create_endpoint $tacker_service \
"$REGION_NAME" \
"$TACKER_PROTOCOL://$SERVICE_HOST:$TACKER_PORT/" \
@ -143,8 +138,6 @@ function create_tacker_accounts {
# init_tacker() - Initialize databases, etc.
function init_tacker {
# mysql -uroot -pmysql-password -h143.183.96.146 -e 'DROP DATABASE IF EXISTS tacker;'
# mysql -uroot -pmysql-password -h143.183.96.146 -e 'CREATE DATABASE tacker CHARACTER SET utf8;'
recreate_database $TACKER_DB_NAME
# Run Tacker db migrations
@ -153,7 +146,6 @@ function init_tacker {
# install_tacker() - Collect source and prepare
function install_tacker {
#git_clone $TACKER_REPO $TACKER_DIR $TACKER_BRANCH
setup_develop $TACKER_DIR
}
@ -188,24 +180,9 @@ function start_tacker_api {
fi
}
# TODO
# Start running processes, including screen
function start_tacker_agents {
# TODO
return
# Start up the tacker agents if enabled
run_process q-agt "python $AGENT_BINARY --config-file $TACKER_CONF"
if is_service_enabled q-servicevm-agent; then
screen_it q-servicevm "cd $TACKER_DIR && python $AGENT_SERVICEVM_BINARY --config-file $TACKER_CONF --config-file $SERVICEVM_CONF_FILENAME"
fi
}
# stop_tacker() - Stop running processes (non-screen)
function stop_tacker {
stop_process tacker-svc
# stop_process q-agt
stop_process tacker
}
# cleanup_tacker() - Remove residual data files, anything left over from previous
@ -284,18 +261,18 @@ function configure_tacker {
iniset $TACKER_CONF DEFAULT nova_api_insecure $TACKER_NOVA_API_INSECURE
iniset $TACKER_CONF DEFAULT nova_region_name $REGION_NAME
iniset $TACKER_CONF servicevm_nova auth_plugin password
iniset $TACKER_CONF servicevm_nova auth_url $KEYSTONE_AUTH_URI
iniset $TACKER_CONF servicevm_nova username nova
iniset $TACKER_CONF servicevm_nova password $SERVICE_PASSWORD
iniset $TACKER_CONF servicevm_nova user_domain_id default
iniset $TACKER_CONF servicevm_nova project_name $SERVICE_TENANT_NAME
iniset $TACKER_CONF servicevm_nova project_domain_id default
iniset $TACKER_CONF servicevm_nova region_name $REGION_NAME
iniset $TACKER_CONF servicevm_heat heat_uri http://$SERVICE_HOST:8004/v1
iniset $TACKER_CONF servicevm_heat stack_retries 60
iniset $TACKER_CONF servicevm_heat stack_retry_wait 5
iniset $TACKER_CONF tacker_nova auth_plugin password
iniset $TACKER_CONF tacker_nova auth_url $KEYSTONE_AUTH_URI
iniset $TACKER_CONF tacker_nova username nova
iniset $TACKER_CONF tacker_nova password $SERVICE_PASSWORD
iniset $TACKER_CONF tacker_nova user_domain_id default
iniset $TACKER_CONF tacker_nova project_name $SERVICE_TENANT_NAME
iniset $TACKER_CONF tacker_nova project_domain_id default
iniset $TACKER_CONF tacker_nova region_name $REGION_NAME
iniset $TACKER_CONF tacker_heat heat_uri http://$SERVICE_HOST:8004/v1
iniset $TACKER_CONF tacker_heat stack_retries 60
iniset $TACKER_CONF tacker_heat stack_retry_wait 5
_tacker_setup_rootwrap
echo "Creating bridge"

2
doc/source/devref/monitor-api.rst

@ -30,7 +30,7 @@ driver path in setup.cfg file in root directory.
For example:
::
tacker.servicevm.monitor_drivers =
tacker.tacker.monitor_drivers =
ping = tacker.vm.monitor_drivers.ping.ping:VNFMonitorPing
The methods that need to override in driver are:

2
etc/init.d/tacker-server

@ -6,7 +6,7 @@
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: tacker-server
# Description: Provides the Tacker servicevm/device manager service
# Description: Provides the Tacker service
### END INIT INFO
set -e

0
etc/tacker/rootwrap.d/servicevm.filters → etc/tacker/rootwrap.d/tacker.filters

6
etc/tacker/tacker.conf

@ -385,7 +385,7 @@ auth_uri = http://127.0.0.1:5000
# If set, use this value for pool_timeout with sqlalchemy
# pool_timeout = 10
[servicevm]
[tacker]
# Specify drivers for hosting device
# exmpale: infra_driver = noop
# exmpale: infra_driver = nova
@ -400,7 +400,7 @@ mgmt_driver = openwrt
monitor_driver = ping
monitor_driver = http_ping
[servicevm_nova]
[tacker_nova]
# parameters for novaclient to talk to nova
region_name = RegionOne
project_domain_id = default
@ -411,7 +411,7 @@ username = nova
auth_url = http://127.0.0.1:35357
auth_plugin = password
[servicevm_heat]
[tacker_heat]
heat_uri = http://localhost:8004/v1
stack_retries = 60
stack_retry_wait = 5

10
setup.cfg

@ -1,7 +1,7 @@
[metadata]
name = tacker
version = 2014.2
summary = OpenStack servicevm/device manager
summary = OpenStack Tacker
description-file =
README.rst
author = OpenStack
@ -27,7 +27,7 @@ data_files =
etc/tacker/tacker.conf
etc/tacker/rootwrap.conf
etc/rootwrap.d =
etc/tacker/rootwrap.d/servicevm.filters
etc/tacker/rootwrap.d/tacker.filters
etc/init.d = etc/init.d/tacker-server
[global]
@ -45,14 +45,14 @@ tacker.service_plugins =
vnfm = tacker.vm.plugin:VNFMPlugin
tacker.openstack.common.cache.backends =
memory = tacker.openstack.common.cache._backends.memory:MemoryBackend
tacker.servicevm.device.drivers =
tacker.tacker.device.drivers =
noop = tacker.vm.drivers.noop:DeviceNoop
nova = tacker.vm.drivers.nova.nova:DeviceNova
heat = tacker.vm.drivers.heat.heat:DeviceHeat
tacker.servicevm.mgmt.drivers =
tacker.tacker.mgmt.drivers =
noop = tacker.vm.mgmt_drivers.noop:DeviceMgmtNoop
openwrt = tacker.vm.mgmt_drivers.openwrt.openwrt:DeviceMgmtOpenWRT
tacker.servicevm.monitor.drivers =
tacker.tacker.monitor.drivers =
ping = tacker.vm.monitor_drivers.ping.ping:VNFMonitorPing
http_ping = tacker.vm.monitor_drivers.http_ping.http_ping:VNFMonitorHTTPPing

4
tacker/common/clients.py

@ -24,7 +24,7 @@ OPTS = [
help=_("Heat service URI to create VNF resources"
"specified in the VNFD templates")),
]
CONF.register_opts(OPTS, group='servicevm_heat')
CONF.register_opts(OPTS, group='tacker_heat')
class OpenstackClients(object):
@ -49,7 +49,7 @@ class OpenstackClients(object):
def _heat_client(self):
tenant_id = self.auth_token['tenant_id']
token = self.auth_token['id']
endpoint = CONF.servicevm_heat.heat_uri + '/' + tenant_id
endpoint = CONF.tacker_heat.heat_uri + '/' + tenant_id
return heatclient.Client('1', endpoint=endpoint, token=token)
@property

2
tacker/db/migration/alembic_migrations/versions/1c6b0d82afcd_servicevm_framework.py

@ -17,7 +17,7 @@
# License for the specific language governing permissions and limitations
# under the License.
"""add tables for servicevm framework
"""add tables for tacker framework
Revision ID: 1c6b0d82afcd
Revises: 2db5203cb7a9

22
tacker/tests/unit/services/vm/test_servicevm_extension.py

@ -24,7 +24,7 @@ import uuid
import mock
from webob import exc
from tacker.extensions import servicevm
from tacker.extensions import tacker
from tacker.plugins.common import constants
from tacker.tests.unit import test_api_v2
from tacker.tests.unit import test_api_v2_extension
@ -34,24 +34,24 @@ _uuid = lambda: str(uuid.uuid4())
_get_path = test_api_v2._get_path
class ServicevmExtensionTestCase(test_api_v2_extension.ExtensionTestCase):
class TackerExtensionTestCase(test_api_v2_extension.ExtensionTestCase):
fmt = 'json'
_DEVICE_TEMPLATE = 'device_template'
_SERVICE_INSTANCE = 'service_instance'
_DEVICE = 'device'
_PATH_SERVICEVM = 'servicevm'
_PATH_DEVICE_TEMPLATES = _PATH_SERVICEVM + '/device-templates'
_PATH_SERVICE_INSTANCES = _PATH_SERVICEVM + '/service-instances'
_PATH_DEVICES = _PATH_SERVICEVM + '/devices'
_PATH_TACKER = 'tacker'
_PATH_DEVICE_TEMPLATES = _PATH_TACKER + '/device-templates'
_PATH_SERVICE_INSTANCES = _PATH_TACKER + '/service-instances'
_PATH_DEVICES = _PATH_TACKER + '/devices'
def setUp(self):
super(ServicevmExtensionTestCase, self).setUp()
super(TackerExtensionTestCase, self).setUp()
self._setUpExtension(
'tacker.extensions.servicevm.ServiceVMPluginBase',
constants.SERVICEVM, servicevm.RESOURCE_ATTRIBUTE_MAP,
servicevm.Servicevm, self._PATH_SERVICEVM,
'tacker.extensions.tacker.TackerPluginBase',
constants.TACKER, tacker.RESOURCE_ATTRIBUTE_MAP,
tacker.Tacker, self._PATH_TACKER,
translate_resource_name=True, use_quota=True)
# hosting device template
@ -267,5 +267,5 @@ class ServicevmExtensionTestCase(test_api_v2_extension.ExtensionTestCase):
self._test_entity_delete(self._DEVICE)
class ServicevmExtensionTestCaseXML(ServicevmExtensionTestCase):
class TackerExtensionTestCaseXML(TackerExtensionTestCase):
fmt = 'xml'

6
tacker/vm/drivers/heat/heat.py

@ -44,9 +44,9 @@ OPTS = [
help=_("Wait time between two successive stack"
"create/delete retries")),
]
CONF.register_opts(OPTS, group='servicevm_heat')
STACK_RETRIES = cfg.CONF.servicevm_heat.stack_retries
STACK_RETRY_WAIT = cfg.CONF.servicevm_heat.stack_retry_wait
CONF.register_opts(OPTS, group='tacker_heat')
STACK_RETRIES = cfg.CONF.tacker_heat.stack_retries
STACK_RETRY_WAIT = cfg.CONF.tacker_heat.stack_retry_wait
HEAT_TEMPLATE_BASE = """
heat_template_version: 2013-05-23

14
tacker/vm/drivers/nova/nova.py

@ -33,15 +33,15 @@ from tacker.vm.drivers import abstract_driver
LOG = logging.getLogger(__name__)
CONF = cfg.CONF
NOVA_API_VERSION = "2"
SERVICEVM_NOVA_CONF_SECTION = 'servicevm_nova'
ks_session.Session.register_conf_options(cfg.CONF, SERVICEVM_NOVA_CONF_SECTION)
ks_auth.register_conf_options(cfg.CONF, SERVICEVM_NOVA_CONF_SECTION)
TACKER_NOVA_CONF_SECTION = 'tacker_nova'
ks_session.Session.register_conf_options(cfg.CONF, TACKER_NOVA_CONF_SECTION)
ks_auth.register_conf_options(cfg.CONF, TACKER_NOVA_CONF_SECTION)
OPTS = [
cfg.StrOpt('region_name',
help=_('Name of nova region to use. Useful if keystone manages'
' more than one region.')),
]
CONF.register_opts(OPTS, group=SERVICEVM_NOVA_CONF_SECTION)
CONF.register_opts(OPTS, group=TACKER_NOVA_CONF_SECTION)
_NICS = 'nics' # converted by novaclient => 'networks'
_NET_ID = 'net-id' # converted by novaclient => 'uuid'
_PORT_ID = 'port-id' # converted by novaclient => 'port'
@ -81,7 +81,7 @@ class DeviceNova(abstract_driver.DeviceAbstractDriver):
def _nova_client(self, token=None):
auth = ks_auth.load_from_conf_options(cfg.CONF,
SERVICEVM_NOVA_CONF_SECTION)
TACKER_NOVA_CONF_SECTION)
endpoint_override = None
if not auth:
@ -102,10 +102,10 @@ class DeviceNova(abstract_driver.DeviceAbstractDriver):
endpoint_override=endpoint_override)
session = ks_session.Session.load_from_conf_options(
cfg.CONF, SERVICEVM_NOVA_CONF_SECTION, auth=auth)
cfg.CONF, TACKER_NOVA_CONF_SECTION, auth=auth)
novaclient_cls = self._novaclient.get_client_class(NOVA_API_VERSION)
return novaclient_cls(session=session,
region_name=cfg.CONF.servicevm_nova.region_name)
region_name=cfg.CONF.tacker_nova.region_name)
def get_type(self):
return 'nova'

8
tacker/vm/monitor.py

@ -56,9 +56,9 @@ class VNFMonitor(object):
'monitor_driver', default=[],
help=_('Monitor driver to communicate with '
'Hosting VNF/logical service '
'instance servicevm plugin will use')),
'instance tacker plugin will use')),
]
cfg.CONF.register_opts(OPTS, 'servicevm')
cfg.CONF.register_opts(OPTS, 'tacker')
def __new__(cls, boot_wait, check_intvl=None):
if not cls._instance:
@ -67,8 +67,8 @@ class VNFMonitor(object):
def __init__(self, boot_wait, check_intvl=None):
self._monitor_manager = driver_manager.DriverManager(
'tacker.servicevm.monitor.drivers',
cfg.CONF.servicevm.monitor_driver)
'tacker.tacker.monitor.drivers',
cfg.CONF.tacker.monitor_driver)
self.boot_wait = boot_wait
if check_intvl is None:

20
tacker/vm/plugin.py

@ -44,16 +44,16 @@ class VNFMMgmtMixin(object):
'mgmt_driver', default=[],
help=_('MGMT driver to communicate with '
'Hosting Device/logical service '
'instance servicevm plugin will use')),
'instance tacker plugin will use')),
cfg.IntOpt('boot_wait', default=30,
help=_('Time interval to wait for VM to boot')),
]
cfg.CONF.register_opts(OPTS, 'servicevm')
cfg.CONF.register_opts(OPTS, 'tacker')
def __init__(self):
super(VNFMMgmtMixin, self).__init__()
self._mgmt_manager = driver_manager.DriverManager(
'tacker.servicevm.mgmt.drivers', cfg.CONF.servicevm.mgmt_driver)
'tacker.tacker.mgmt.drivers', cfg.CONF.tacker.mgmt_driver)
def _invoke(self, device_dict, **kwargs):
method = inspect.stack()[1][3]
@ -101,21 +101,23 @@ class VNFMMgmtMixin(object):
class VNFMPlugin(vm_db.VNFMPluginDb, VNFMMgmtMixin):
"""VNFMPlugin which supports VNFM framework."""
"""Plugin which supports Tacker framework
"""
OPTS = [
cfg.ListOpt(
'infra_driver', default=['heat'],
help=_('Hosting device drivers servicevm plugin will use')),
help=_('Hosting device drivers tacker plugin will use')),
]
cfg.CONF.register_opts(OPTS, 'servicevm')
cfg.CONF.register_opts(OPTS, 'tacker')
supported_extension_aliases = ['vnfm']
def __init__(self):
super(VNFMPlugin, self).__init__()
self._pool = eventlet.GreenPool()
self.boot_wait = cfg.CONF.servicevm.boot_wait
self.boot_wait = cfg.CONF.tacker.boot_wait
self._device_manager = driver_manager.DriverManager(
'tacker.servicevm.device.drivers',
cfg.CONF.servicevm.infra_driver)
'tacker.tacker.device.drivers',
cfg.CONF.tacker.infra_driver)
self._vnf_monitor = monitor.VNFMonitor(self.boot_wait)
def spawn_n(self, function, *args, **kwargs):
@ -136,7 +138,7 @@ class VNFMPlugin(vm_db.VNFMPluginDb, VNFMMgmtMixin):
LOG.debug(_('unknown hosting device driver '
'%(infra_driver)s in %(drivers)s'),
{'infra_driver': infra_driver,
'drivers': cfg.CONF.servicevm.infra_driver})
'drivers': cfg.CONF.tacker.infra_driver})
raise vnfm.InvalidInfraDriver(infra_driver=infra_driver)
service_types = template.get('service_types')

Loading…
Cancel
Save