1. Remove quantum + cinder for now (until I get around to cleaning them up)
2. More folsom simplifications + creation of libvirtd user group 3. Fix default persona after rename
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
import copy
|
||||
import io
|
||||
import yaml
|
||||
|
||||
from anvil import cfg
|
||||
from anvil import colorizer
|
||||
from anvil import components as comp
|
||||
from anvil import log as logging
|
||||
from anvil import shell as sh
|
||||
from anvil import utils
|
||||
|
||||
|
||||
class CinderMixin(object):
|
||||
|
||||
@property
|
||||
def valid_subsystems(self):
|
||||
return set(['sch', 'api', 'vol'])
|
||||
|
||||
|
||||
class CinderUninstaller(CinderMixin, comp.PythonUninstallComponent):
|
||||
def __init__(self, *args, **kargs):
|
||||
comp.PythonUninstallComponent.__init__(self, *args, **kargs)
|
||||
|
||||
|
||||
class CinderInstaller(CinderMixin, comp.PythonInstallComponent):
|
||||
def __init__(self, *args, **kargs):
|
||||
comp.PythonInstallComponent.__init__(self, *args, **kargs)
|
||||
|
||||
def _filter_pip_requires_line(self, line):
|
||||
if line.lower().find('glance') != -1:
|
||||
return None
|
||||
return line
|
||||
|
||||
|
||||
class CinderRuntime(CinderMixin, comp.PythonRuntime):
|
||||
def __init__(self, *args, **kargs):
|
||||
comp.PythonRuntime.__init__(self, *args, **kargs)
|
||||
@@ -1,32 +0,0 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
|
||||
#
|
||||
# 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 anvil import components as comp
|
||||
|
||||
|
||||
class CinderClientUninstaller(comp.PythonUninstallComponent):
|
||||
def __init__(self, *args, **kargs):
|
||||
comp.PythonUninstallComponent.__init__(self, *args, **kargs)
|
||||
|
||||
|
||||
class CinderClientInstaller(comp.PythonInstallComponent):
|
||||
def __init__(self, *args, **kargs):
|
||||
comp.PythonInstallComponent.__init__(self, *args, **kargs)
|
||||
|
||||
|
||||
class CinderClientRuntime(comp.EmptyRuntime):
|
||||
def __init__(self, *args, **kargs):
|
||||
comp.EmptyRuntime.__init__(self, *args, **kargs)
|
||||
@@ -90,7 +90,8 @@ class GlanceInstaller(GlanceMixin, comp.PythonInstallComponent):
|
||||
|
||||
def post_install(self):
|
||||
comp.PythonInstallComponent.post_install(self)
|
||||
self._setup_db()
|
||||
if self.get_option('db-sync'):
|
||||
self._setup_db()
|
||||
|
||||
def _setup_db(self):
|
||||
dbhelper.drop_db(self.cfg, self.distro, DB_NAME)
|
||||
|
||||
@@ -316,10 +316,10 @@ class ConfConfigurator(object):
|
||||
|
||||
def _configure_quantum(self, nova_conf):
|
||||
# TODO(harlowja) fixup for folsom
|
||||
nova_conf.add('network_api_class', 'nova.network.quantumv2.api.API')
|
||||
pass
|
||||
|
||||
def _configure_network_settings(self, nova_conf):
|
||||
if self.installer.get_option('quantum'):
|
||||
if self.installer.get_option('quantum-enabled'):
|
||||
self._configure_quantum(nova_conf)
|
||||
else:
|
||||
nova_conf.add('network_manager', self._getstr('network_manager'))
|
||||
@@ -357,23 +357,10 @@ class ConfConfigurator(object):
|
||||
# Ensures the place where instances will be is useable
|
||||
def _configure_instances_path(self, instances_path, nova_conf):
|
||||
nova_conf.add('instances_path', instances_path)
|
||||
|
||||
LOG.debug("Attempting to create instance directory: %r", instances_path)
|
||||
self.tracewriter.dirs_made(*sh.mkdirslist(instances_path))
|
||||
LOG.debug("Adjusting permissions of instance directory: %r", instances_path)
|
||||
sh.chmod(instances_path, 0777)
|
||||
instance_parent = sh.dirname(instances_path)
|
||||
LOG.debug("Adjusting permissions of instance directory parent: %r", instance_parent)
|
||||
|
||||
# In cases where you are using kvm + qemu
|
||||
# On certain distros (ie RHEL) this user needs to be able
|
||||
# To enter the parents of the instance path, if this is in /home/BLAH/ then
|
||||
# Without enabling the whole path, this user can't write there. This helps fix that...
|
||||
with sh.Rooted(True):
|
||||
for p in sh.explode_path(instance_parent):
|
||||
if not os.access(p, os.X_OK) and sh.isdir(p):
|
||||
# Need to be able to go into that directory
|
||||
sh.chmod(p, os.stat(p).st_mode | 0755)
|
||||
|
||||
# Any special libvirt configurations go here
|
||||
def _configure_libvirt(self, virt_type, nova_conf):
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
|
||||
#
|
||||
# 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 anvil import log
|
||||
from anvil import utils
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
def get_shared_params(cfg):
|
||||
mp = dict()
|
||||
|
||||
host_ip = cfg.get('host', 'ip')
|
||||
mp['service_host'] = host_ip
|
||||
|
||||
# Components of the various endpoints
|
||||
quantum_host = cfg.getdefaulted('quantum', 'quantum_host', host_ip)
|
||||
quantum_port = cfg.getdefaulted('quantum', 'quantum_port', '9696')
|
||||
quantum_proto = cfg.getdefaulted('quantum', 'quantum_protocol', 'http')
|
||||
quantum_uri = utils.make_url(quantum_proto, quantum_host, quantum_port)
|
||||
mp['endpoints'] = {
|
||||
'admin': {
|
||||
'uri': quantum_uri,
|
||||
'port': quantum_port,
|
||||
'protocol': quantum_proto,
|
||||
'host': quantum_host,
|
||||
},
|
||||
}
|
||||
mp['endpoints']['public'] = dict(mp['endpoints']['admin'])
|
||||
mp['endpoints']['internal'] = dict(mp['endpoints']['public'])
|
||||
|
||||
return mp
|
||||
@@ -107,7 +107,8 @@ class HorizonInstaller(comp.PythonInstallComponent):
|
||||
|
||||
def _setup_blackhole(self):
|
||||
# Create an empty directory that apache uses as docroot
|
||||
self.tracewriter.dirs_made(*sh.mkdirslist(sh.joinpths(self.get_option('app_dir'), BLACKHOLE_DIR)))
|
||||
black_hole_dir = sh.joinpths(self.get_option('app_dir'), BLACKHOLE_DIR)
|
||||
self.tracewriter.dirs_made(*sh.mkdirslist(black_hole_dir))
|
||||
|
||||
def _sync_db(self):
|
||||
# Initialize the horizon database (it stores sessions and notices shown to users).
|
||||
@@ -138,9 +139,11 @@ class HorizonInstaller(comp.PythonInstallComponent):
|
||||
|
||||
def post_install(self):
|
||||
comp.PythonInstallComponent.post_install(self)
|
||||
self._setup_db()
|
||||
self._sync_db()
|
||||
self._setup_blackhole()
|
||||
if self.get_option('db-sync'):
|
||||
self._setup_db()
|
||||
self._sync_db()
|
||||
if self.get_option('make-blackhole'):
|
||||
self._setup_blackhole()
|
||||
self._config_fixups()
|
||||
|
||||
def _get_apache_user_group(self):
|
||||
|
||||
@@ -90,8 +90,9 @@ class KeystoneInstaller(comp.PythonInstallComponent):
|
||||
|
||||
def post_install(self):
|
||||
comp.PythonInstallComponent.post_install(self)
|
||||
self._setup_db()
|
||||
self._sync_db()
|
||||
if self.get_option('db-sync'):
|
||||
self._setup_db()
|
||||
self._sync_db()
|
||||
|
||||
def _sync_db(self):
|
||||
LOG.info("Syncing keystone to database: %s", colorizer.quote(DB_NAME))
|
||||
|
||||
@@ -301,16 +301,20 @@ class NovaRuntime(NovaMixin, comp.PythonRuntime):
|
||||
comp.PythonRuntime.__init__(self, *args, **kargs)
|
||||
self.wait_time = max(self.cfg.getint('DEFAULT', 'service_wait_seconds'), 1)
|
||||
self.virsh = lv.Virsh(self.cfg, self.distro)
|
||||
self.config_path = sh.joinpths(self.get_option('cfg_dir'), API_CONF)
|
||||
self.bin_dir = sh.joinpths(self.get_option('app_dir'), BIN_DIR)
|
||||
self.net_init_fn = sh.joinpths(self.get_option('trace_dir'), NET_INITED_FN)
|
||||
|
||||
def _do_network_init(self):
|
||||
ran_fn = sh.joinpths(self.get_option('trace_dir'), NET_INITED_FN)
|
||||
ran_fn = self.net_init_fn
|
||||
if not sh.isfile(ran_fn) and self.get_option('do-network-init'):
|
||||
LOG.info("Creating your nova network to be used with instances.")
|
||||
# Figure out the commands to run
|
||||
mp = {}
|
||||
cmds = []
|
||||
mp['CFG_FILE'] = sh.joinpths(self.get_option('cfg_dir'), API_CONF)
|
||||
mp['BIN_DIR'] = sh.joinpths(self.get_option('app_dir'), BIN_DIR)
|
||||
mp = {
|
||||
'CFG_FILE': self.config_path,
|
||||
'BIN_DIR': self.bin_dir
|
||||
}
|
||||
mp['BIN_DIR'] = self.bin_dir
|
||||
if self.cfg.getboolean('nova', 'enable_fixed'):
|
||||
# Create a fixed network
|
||||
mp['FIXED_NETWORK_SIZE'] = self.cfg.getdefaulted('nova', 'fixed_network_size', '256')
|
||||
@@ -324,6 +328,7 @@ class NovaRuntime(NovaMixin, comp.PythonRuntime):
|
||||
mp['TEST_FLOATING_POOL'] = self.cfg.getdefaulted('nova', 'test_floating_pool', 'test')
|
||||
# Anything to run??
|
||||
if cmds:
|
||||
LOG.info("Creating your nova network to be used with instances.")
|
||||
utils.execute_template(*cmds, params=mp)
|
||||
# Writing this makes sure that we don't init again
|
||||
cmd_mp = {
|
||||
@@ -366,7 +371,7 @@ class NovaRuntime(NovaMixin, comp.PythonRuntime):
|
||||
|
||||
def app_params(self, app_name):
|
||||
params = comp.PythonRuntime.app_params(self, app_name)
|
||||
params['CFG_FILE'] = sh.joinpths(self.get_option('cfg_dir'), API_CONF)
|
||||
params['CFG_FILE'] = self.config_path
|
||||
return params
|
||||
|
||||
def app_options(self, app):
|
||||
|
||||
68
anvil/components/novnc.py
Normal file
68
anvil/components/novnc.py
Normal file
@@ -0,0 +1,68 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
|
||||
#
|
||||
# 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 anvil import cfg
|
||||
from anvil import colorizer
|
||||
from anvil import components as comp
|
||||
from anvil import log as logging
|
||||
from anvil import shell as sh
|
||||
from anvil import utils
|
||||
|
||||
# Where the application is really
|
||||
UTIL_DIR = 'utils'
|
||||
|
||||
VNC_PROXY_APP = 'nova-novncproxy'
|
||||
APP_OPTIONS = {
|
||||
# This reaches into the nova configuration file
|
||||
# TODO can we stop that?
|
||||
VNC_PROXY_APP: ['--config-file', '%NOVA_CONF%', '--web', '.'],
|
||||
}
|
||||
|
||||
|
||||
class NoVNCUninstaller(comp.PythonUninstallComponent):
|
||||
pass
|
||||
|
||||
|
||||
class NoVNCInstaller(comp.PythonInstallComponent):
|
||||
def _get_python_directories(self):
|
||||
return {}
|
||||
|
||||
|
||||
class NoVNCRuntime(comp.ProgramRuntime):
|
||||
@property
|
||||
def apps_to_start(self):
|
||||
apps = []
|
||||
for app_name in APP_OPTIONS.keys():
|
||||
apps.append({
|
||||
'name': app_name,
|
||||
'path': sh.joinpths(self.get_option('app_dir'), UTIL_DIR, app_name),
|
||||
})
|
||||
return apps
|
||||
|
||||
def app_params(self, app_name):
|
||||
params = comp.ProgramRuntime.app_params(self, app_name)
|
||||
nova_comp_name = self.get_option('nova-component')
|
||||
if app_name == VNC_PROXY_APP:
|
||||
if nova_comp_name in self.instances:
|
||||
# FIXME(harlowja): Have to reach into the nova component to get the config path (puke)
|
||||
nova_runtime = self.instances[nova_comp_name]
|
||||
params['NOVA_CONF'] = nova_runtime.config_path
|
||||
else:
|
||||
raise RuntimeError("NoVNC can not be started without the location of the nova configuration file")
|
||||
return params
|
||||
|
||||
def app_options(self, app):
|
||||
return APP_OPTIONS.get(app)
|
||||
@@ -1,183 +0,0 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
import io
|
||||
|
||||
from anvil import cfg
|
||||
from anvil import colorizer
|
||||
from anvil import components as comp
|
||||
from anvil import log as logging
|
||||
from anvil import shell as sh
|
||||
from anvil import utils
|
||||
|
||||
from anvil.components.helpers import db as dbhelper
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
# Openvswitch special settings
|
||||
VSWITCH_PLUGIN = 'openvswitch'
|
||||
|
||||
# Config files (some only modified if running as openvswitch)
|
||||
QUANTUM_CONF = 'quantum.conf'
|
||||
|
||||
# This db will be dropped and created
|
||||
DB_NAME = 'ovs_quantum'
|
||||
|
||||
# Opensvswitch bridge setup/teardown/name commands
|
||||
OVS_BRIDGE_DEL = ['ovs-vsctl', '--no-wait', '--', '--if-exists', 'del-br', '%OVS_BRIDGE%']
|
||||
OVS_BRIDGE_ADD = ['ovs-vsctl', '--no-wait', 'add-br', '%OVS_BRIDGE%']
|
||||
OVS_BRIDGE_EXTERN_ID = ['ovs-vsctl', '--no-wait', 'br-set-external-id', '%OVS_BRIDGE%', 'bridge-id', '%OVS_EXTERNAL_ID%']
|
||||
OVS_BRIDGE_CMDS = [OVS_BRIDGE_DEL, OVS_BRIDGE_ADD, OVS_BRIDGE_EXTERN_ID]
|
||||
|
||||
# What to start (only if openvswitch enabled)
|
||||
APP_Q_SERVER = 'quantum-server'
|
||||
APP_Q_AGENT = 'ovs_quantum_agent.py'
|
||||
APP_OPTIONS = {
|
||||
APP_Q_SERVER: ["%QUANTUM_CONFIG_FILE%"],
|
||||
APP_Q_AGENT: ["%OVS_CONFIG_FILE%", "-v"],
|
||||
}
|
||||
|
||||
|
||||
class QuantumMixin(object):
|
||||
|
||||
@property
|
||||
def valid_subsystems(self):
|
||||
return ['openvswitch']
|
||||
|
||||
@property
|
||||
def config_files(self):
|
||||
return list(CONFIG_FILES)
|
||||
|
||||
|
||||
class QuantumUninstaller(QuantumMixin, comp.PkgUninstallComponent):
|
||||
|
||||
def __init__(self, *args, **kargs):
|
||||
comp.PkgUninstallComponent.__init__(self, *args, **kargs)
|
||||
|
||||
|
||||
class QuantumInstaller(QuantumMixin, comp.PkgInstallComponent):
|
||||
|
||||
def __init__(self, *args, **kargs):
|
||||
comp.PkgInstallComponent.__init__(self, *args, **kargs)
|
||||
self.q_vswitch_agent = False
|
||||
self.q_vswitch_service = False
|
||||
plugin = self.cfg.getdefaulted("quantum", "q_plugin", VSWITCH_PLUGIN)
|
||||
if plugin == VSWITCH_PLUGIN:
|
||||
# FIXME: Make these subsystems
|
||||
self.q_vswitch_agent = True
|
||||
self.q_vswitch_service = True
|
||||
|
||||
def _config_adjust(self, contents, config_fn):
|
||||
if config_fn == PLUGIN_CONF and self.q_vswitch_service:
|
||||
# Need to fix the "Quantum plugin provider module"
|
||||
with io.BytesIO(contents) as stream:
|
||||
config = cfg.RewritableConfigParser()
|
||||
config.readfp(stream)
|
||||
config.set("plugin", "provider", "quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPlugin")
|
||||
contents = config.stringify(config_fn)
|
||||
return contents
|
||||
elif config_fn == AGENT_CONF and self.q_vswitch_agent:
|
||||
# Need to adjust the sql connection
|
||||
with io.BytesIO(contents) as stream:
|
||||
config = cfg.RewritableConfigParser()
|
||||
config.readfp(stream)
|
||||
config.set("database", "sql_connection", dbhelper.fetch_dbdsn(self.cfg, DB_NAME, utf8=True))
|
||||
contents = config.stringify(config_fn)
|
||||
return contents
|
||||
else:
|
||||
return comp.PkgInstallComponent._config_adjust(self, contents, config_fn)
|
||||
|
||||
def _setup_bridge(self):
|
||||
if not self.q_vswitch_agent or not self.get_option('ovs-bridge-init'):
|
||||
return
|
||||
else:
|
||||
bridge = self.cfg.getdefaulted("quantum", "ovs_bridge", 'br-int')
|
||||
LOG.info("Fixing up ovs bridge named: %s", colorizer.quote(bridge))
|
||||
external_id = self.cfg.getdefaulted("quantum", 'ovs_bridge_external_name', bridge)
|
||||
params = dict()
|
||||
params['OVS_BRIDGE'] = bridge
|
||||
params['OVS_EXTERNAL_ID'] = external_id
|
||||
cmds = list()
|
||||
for cmd_templ in OVS_BRIDGE_CMDS:
|
||||
cmds.append({
|
||||
'cmd': cmd_templ,
|
||||
'run_as_root': True,
|
||||
})
|
||||
utils.execute_template(*cmds, params=params)
|
||||
|
||||
def post_install(self):
|
||||
comp.PkgInstallComponent.post_install(self)
|
||||
self._setup_db()
|
||||
self._setup_bridge()
|
||||
|
||||
def _setup_db(self):
|
||||
if not self.q_vswitch_service or not self.get_option('ovs-bridge-init'):
|
||||
return
|
||||
else:
|
||||
dbhelper.drop_db(self.cfg, self.distro, DB_NAME)
|
||||
dbhelper.create_db(self.cfg, self.distro, DB_NAME, utf8=True)
|
||||
|
||||
def source_config(self, config_fn):
|
||||
if config_fn == PLUGIN_CONF:
|
||||
src_fn = sh.joinpths(self.get_option('app_dir'), 'etc', config_fn)
|
||||
contents = sh.load_file(src_fn)
|
||||
return (src_fn, contents)
|
||||
elif config_fn == AGENT_CONF:
|
||||
# WHY U SO BURIED....
|
||||
src_fn = sh.joinpths(self.get_option('app_dir'), 'etc', 'quantum', 'plugins', 'openvswitch', config_fn)
|
||||
contents = sh.load_file(src_fn)
|
||||
return (src_fn, contents)
|
||||
else:
|
||||
return comp.PkgInstallComponent.source_config(self, config_fn)
|
||||
|
||||
|
||||
class QuantumRuntime(QuantumMixin, comp.ProgramRuntime):
|
||||
def __init__(self, *args, **kargs):
|
||||
comp.ProgramRuntime.__init__(self, *args, **kargs)
|
||||
self.q_vswitch_agent = False
|
||||
self.q_vswitch_service = False
|
||||
plugin = self.cfg.getdefaulted("quantum", "q_plugin", VSWITCH_PLUGIN)
|
||||
if plugin == VSWITCH_PLUGIN:
|
||||
# Default to on if not specified
|
||||
self.q_vswitch_agent = True
|
||||
self.q_vswitch_service = True
|
||||
|
||||
@property
|
||||
def apps_to_start(self):
|
||||
app_list = []
|
||||
if self.q_vswitch_service:
|
||||
app_list.append({
|
||||
'name': APP_Q_SERVER,
|
||||
'path': sh.joinpths(self.get_option('app_dir'), 'bin', APP_Q_SERVER),
|
||||
})
|
||||
if self.q_vswitch_agent:
|
||||
app_list.append({
|
||||
'name': APP_Q_AGENT,
|
||||
# WHY U SO BURIED....
|
||||
'path': sh.joinpths(self.get_option('app_dir'), "quantum", "plugins", "openvswitch", 'agent', APP_Q_AGENT)
|
||||
})
|
||||
return app_list
|
||||
|
||||
def app_options(self, app_name):
|
||||
return APP_OPTIONS.get(app_name)
|
||||
|
||||
def app_params(self, app_name):
|
||||
param_dict = comp.ProgramRuntime.app_params(self, app_name)
|
||||
if app_name == APP_Q_AGENT:
|
||||
param_dict['OVS_CONFIG_FILE'] = sh.joinpths(self.get_option('cfg_dir'), AGENT_CONF)
|
||||
elif app_name == APP_Q_SERVER:
|
||||
param_dict['QUANTUM_CONFIG_FILE'] = sh.joinpths(self.get_option('cfg_dir'), QUANTUM_CONF)
|
||||
return param_dict
|
||||
@@ -1,32 +0,0 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
|
||||
#
|
||||
# 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 anvil import components as comp
|
||||
|
||||
|
||||
class QuantumClientUninstaller(comp.PythonUninstallComponent):
|
||||
def __init__(self, *args, **kargs):
|
||||
comp.PythonUninstallComponent.__init__(self, *args, **kargs)
|
||||
|
||||
|
||||
class QuantumClientInstaller(comp.PythonInstallComponent):
|
||||
def __init__(self, *args, **kargs):
|
||||
comp.PythonInstallComponent.__init__(self, *args, **kargs)
|
||||
|
||||
|
||||
class QuantumClientRuntime(comp.EmptyRuntime):
|
||||
def __init__(self, *args, **kargs):
|
||||
comp.EmptyRuntime.__init__(self, *args, **kargs)
|
||||
@@ -136,7 +136,7 @@ class RabbitRuntime(rabbit.RabbitRuntime):
|
||||
class NovaInstaller(nova.NovaInstaller):
|
||||
|
||||
def _get_policy(self, ident_users):
|
||||
return (LIBVIRT_POLICY_FN, LIBVIRT_POLICY_CONTENTS.format(idents=(";".join(ident_users))))
|
||||
return LIBVIRT_POLICY_CONTENTS.format(idents=(";".join(ident_users)))
|
||||
|
||||
def _get_policy_users(self):
|
||||
ident_users = set()
|
||||
@@ -148,15 +148,16 @@ class NovaInstaller(nova.NovaInstaller):
|
||||
configs_made = nova.NovaInstaller.configure(self)
|
||||
driver_canon = nhelper.canon_virt_driver(self.cfg.get('nova', 'virt_driver'))
|
||||
if driver_canon == 'libvirt':
|
||||
(fn, contents) = self._get_policy(self._get_policy_users())
|
||||
dirs_made = list()
|
||||
with sh.Rooted(True):
|
||||
# TODO(harlowja) check if this dir is restricted before assuming it isn't?
|
||||
dirs_made.extend(sh.mkdirslist(sh.dirname(fn)))
|
||||
sh.write_file(fn, contents)
|
||||
self.tracewriter.cfg_file_written(fn)
|
||||
self.tracewriter.dirs_made(*dirs_made)
|
||||
configs_made += 1
|
||||
# Create a libvirtd user group
|
||||
if not sh.group_exists('libvirtd'):
|
||||
cmd = ['groupadd', 'libvirtd']
|
||||
sh.execute(*cmd, run_as_root=True)
|
||||
if not sh.isfile(LIBVIRT_POLICY_FN):
|
||||
contents = self._get_policy(self._get_policy_users())
|
||||
with sh.Rooted(True):
|
||||
sh.mkdirslist(sh.dirname(LIBVIRT_POLICY_FN))
|
||||
sh.write_file(LIBVIRT_POLICY_FN, contents)
|
||||
configs_made += 1
|
||||
return configs_made
|
||||
|
||||
|
||||
|
||||
@@ -63,12 +63,11 @@ def parse():
|
||||
|
||||
# Install/start/stop/uninstall specific options
|
||||
base_group = OptionGroup(parser, "Action specific options")
|
||||
def_persona = sh.joinpths(settings.PERSONA_DIR, 'devstack.sh.yaml')
|
||||
base_group.add_option("-p", "--persona",
|
||||
action="store",
|
||||
type="string",
|
||||
dest="persona_fn",
|
||||
default=def_persona,
|
||||
default=sh.joinpths(settings.PERSONA_DIR, 'basic.yaml'),
|
||||
metavar="FILE",
|
||||
help="persona yaml file to apply (default: %default)")
|
||||
base_group.add_option("-a", "--action",
|
||||
@@ -88,8 +87,7 @@ def parse():
|
||||
action="store_false",
|
||||
dest="prompt_for_passwords",
|
||||
default=True,
|
||||
help="do not prompt the user for passwords",
|
||||
)
|
||||
help="do not prompt the user for passwords")
|
||||
parser.add_option_group(base_group)
|
||||
|
||||
# Uninstall and stop options
|
||||
@@ -111,17 +109,17 @@ def parse():
|
||||
|
||||
# Extract only what we care about
|
||||
(options, args) = parser.parse_args()
|
||||
output = dict()
|
||||
output['dir'] = options.dir or ""
|
||||
output['dryrun'] = options.dryrun or False
|
||||
output['action'] = options.action or ""
|
||||
output = {}
|
||||
output['dir'] = (options.dir or "")
|
||||
output['dryrun'] = (options.dryrun or False)
|
||||
output['action'] = (options.action or "")
|
||||
output['force'] = not options.force
|
||||
output['keep_old'] = options.keep_old
|
||||
output['extras'] = args
|
||||
output['config_fn'] = options.config_fn
|
||||
output['persona_fn'] = options.persona_fn
|
||||
output['verbosity'] = len(options.verbosity)
|
||||
output['cli_overrides'] = options.cli_overrides or list()
|
||||
output['cli_overrides'] = (options.cli_overrides or [])
|
||||
output['prompt_for_passwords'] = options.prompt_for_passwords
|
||||
|
||||
return output
|
||||
|
||||
@@ -219,12 +219,6 @@ nova = git://github.com/openstack/nova.git?branch=master
|
||||
# Compute service client library
|
||||
nova_client = git://github.com/openstack/python-novaclient.git?branch=master
|
||||
|
||||
# Volume service
|
||||
cinder = git://github.com/openstack/cinder.git?branch=master
|
||||
|
||||
# Volume service client library
|
||||
cinder_client = git://github.com/openstack/python-cinderclient.git?branch=master
|
||||
|
||||
# Image catalog service
|
||||
glance = git://github.com/openstack/glance.git?branch=master
|
||||
|
||||
@@ -240,31 +234,11 @@ keystone_client = git://github.com/openstack/python-keystoneclient.git?branch=ma
|
||||
# Django powered web control panel for openstack
|
||||
horizon = git://github.com/openstack/horizon.git?branch=master
|
||||
|
||||
# Quantum (network connectivity as a service) system
|
||||
quantum = git://github.com/openstack/quantum.git?branch=master
|
||||
|
||||
# Quantum (network connectivity as a service) system client library
|
||||
quantum_client = git://github.com/openstack/python-quantumclient.git?branch=master
|
||||
|
||||
# Unified openstack client library
|
||||
openstack_client = git://github.com/openstack/python-openstackclient.git?branch=master
|
||||
|
||||
[quantum]
|
||||
|
||||
# Where your quantum host is at
|
||||
q_host = ${Q_HOST:-$(host:ip)}
|
||||
|
||||
# Which port your quantum host is at
|
||||
q_port = ${Q_PORT:-9696}
|
||||
|
||||
# Which type of quantum plugin you will be using
|
||||
q_plugin = ${Q_PLUGIN:-openvswitch}
|
||||
|
||||
# Default OVS bridge name
|
||||
ovs_bridge = ${OVS_BRIDGE:-br-int}
|
||||
|
||||
# OVS bridge external name
|
||||
ovs_bridge_external_name = ${OVS_BRIDGE_EXTERNAL_NAME:-$(quantum:ovs_bridge)}
|
||||
# A websockets/html5 or flash powered VNC console for vm instances
|
||||
no_vnc = git://github.com/kanaka/noVNC.git?branch=master
|
||||
|
||||
[horizon]
|
||||
|
||||
|
||||
@@ -293,9 +293,6 @@ components:
|
||||
- name: python-daemon
|
||||
version: "1.5.5"
|
||||
subsystems:
|
||||
no-vnc:
|
||||
packages:
|
||||
- name: novnc
|
||||
cpu:
|
||||
packages:
|
||||
- name: iscsi-initiator-utils
|
||||
@@ -318,6 +315,13 @@ components:
|
||||
install: anvil.components.nova_client:NovaClientInstaller
|
||||
running: anvil.components.nova_client:NovaClientRuntime
|
||||
uninstall: anvil.components.nova_client:NovaClientUninstaller
|
||||
no-vnc:
|
||||
action_classes:
|
||||
install: anvil.components.novnc:NoVNCInstaller
|
||||
running: anvil.components.novnc:NoVNCRuntime
|
||||
uninstall: anvil.components.novnc:NoVNCUninstaller
|
||||
packages:
|
||||
- name: python-websockify
|
||||
openstack-client:
|
||||
action_classes:
|
||||
install: anvil.components.openstack_client:OpenStackClientInstaller
|
||||
|
||||
@@ -3,29 +3,35 @@ components:
|
||||
# Order matters here!
|
||||
- general
|
||||
- db
|
||||
# - rabbit-mq
|
||||
- rabbit-mq
|
||||
- keystone-client
|
||||
- keystone
|
||||
- glance
|
||||
# Do this after glance is installed to override the old binary
|
||||
- glance-client
|
||||
- nova
|
||||
- cinder
|
||||
- nova-client
|
||||
#- horizon
|
||||
- horizon
|
||||
# Super client, so install after other clients
|
||||
- openstack-client
|
||||
- no-vnc
|
||||
description: Devstack.sh matching component installation.
|
||||
options:
|
||||
no-vnc:
|
||||
# This is the nova component name (we need this to hook into the nova conf...)
|
||||
nova-component: nova
|
||||
nova:
|
||||
no-vnc: true
|
||||
mq: rabbit
|
||||
db-sync: true
|
||||
do-network-init: true
|
||||
mq: rabbit
|
||||
glance:
|
||||
db-sync: true
|
||||
load-images: true
|
||||
keystone:
|
||||
db-sync: true
|
||||
horizon:
|
||||
db-sync: true
|
||||
make-blackhole: true
|
||||
subsystems:
|
||||
glance:
|
||||
- api
|
||||
@@ -39,13 +45,7 @@ subsystems:
|
||||
- sched
|
||||
- xvnc
|
||||
- novnc
|
||||
cinder:
|
||||
- sch
|
||||
- api
|
||||
- vol
|
||||
supports:
|
||||
- rhel-6
|
||||
- ubuntu-precise
|
||||
- fedora-16
|
||||
...
|
||||
|
||||
Reference in New Issue
Block a user