Beispiel #1
0
from nova_dns.dnsmanager import DNSRecord
from nova_dns.listener import AMQPListener
from nova_dns import auth

import netaddr

LOG = logging.getLogger("nova_dns.listener.simple")
FLAGS = flags.FLAGS
SLEEP = 60

AUTH = auth.AUTH

#TODO make own zone for every instance
opts = [
    cfg.ListOpt("dns_ns",
                default=["ns1:127.0.0.1"],
                help="Name servers, in format ns1:ip1, ns2:ip2"),
    cfg.BoolOpt('dns_ptr', default=False, help='Manage PTR records'),
    cfg.ListOpt('dns_ptr_zones',
                default=[],
                help="Classless delegation networks in format ip_addr/network")
]
FLAGS.register_opts(opts)


class Listener(AMQPListener):
    def __init__(self):
        self.pending = {}
        self.conn = sqlalchemy.engine.create_engine(
            FLAGS.sql_connection,
            pool_recycle=FLAGS.sql_idle_timeout,
Beispiel #2
0
               help="The messaging module to use, defaults to kombu."),
    cfg.IntOpt('rpc_thread_pool_size',
               default=64,
               help='Size of RPC thread pool'),
    cfg.IntOpt('rpc_conn_pool_size',
               default=30,
               help='Size of RPC connection pool'),
    cfg.IntOpt('rpc_response_timeout',
               default=60,
               help='Seconds to wait for a response from call or multicall'),
    cfg.IntOpt('rpc_cast_timeout',
               default=30,
               help='Seconds to wait before a cast expires (TTL). '
               'Only supported by impl_zmq.'),
    cfg.ListOpt('allowed_rpc_exception_modules',
                default=['nova.exception'],
                help='Modules of exceptions that are permitted to be recreated'
                'upon receiving exception data from an rpc call.'),
    cfg.StrOpt('control_exchange',
               default='nova',
               help='AMQP exchange to connect to if using RabbitMQ or Qpid'),
    cfg.BoolOpt('fake_rabbit',
                default=False,
                help='If passed, use a fake RabbitMQ provider'),
]

cfg.CONF.register_opts(rpc_opts)


def create_connection(new=True):
    """Create a connection to the message bus used for rpc.
Beispiel #3
0
import netaddr

from nova import exception
from nova.openstack.common import cfg
from nova.openstack.common import excutils
from nova.openstack.common import importutils
from nova.openstack.common import log as logging
from nova.openstack.common import timeutils

monkey_patch_opts = [
    cfg.BoolOpt('monkey_patch',
                default=False,
                help='Whether to log monkey patching'),
    cfg.ListOpt('monkey_patch_modules',
                default=[
                    'nova.api.ec2.cloud:nova.notifier.api.notify_decorator',
                    'nova.compute.api:nova.notifier.api.notify_decorator'
                ],
                help='List of modules/decorators to monkey patch'),
]
utils_opts = [
    cfg.IntOpt('password_length',
               default=12,
               help='Length of generated instance admin passwords'),
    cfg.BoolOpt('disable_process_locking',
                default=False,
                help='Whether to disable inter-process locks'),
    cfg.StrOpt('instance_usage_audit_period',
               default='month',
               help='time period to generate instance usages for.  '
               'Time period must be hour, day, month or year'),
    cfg.StrOpt('rootwrap_config',
Beispiel #4
0
Datei: api.py Projekt: altai/nova
from nova import log as logging
from nova.openstack.common import cfg
from nova import utils
from nova.virt.disk import guestfs
from nova.virt.disk import loop
from nova.virt.disk import nbd


LOG = logging.getLogger(__name__)

disk_opts = [
    cfg.StrOpt('injected_network_template',
               default='$pybasedir/nova/virt/interfaces.template',
               help='Template file for injected network'),
    cfg.ListOpt('img_handlers',
                default=['loop', 'nbd', 'guestfs'],
                help='Order of methods used to mount disk images'),

    # NOTE(yamahata): ListOpt won't work because the command may include a
    #                 comma. For example:
    #
    #                 mkfs.ext3 -O dir_index,extent -E stride=8,stripe-width=16
    #                           --label %(fs_label)s %(target)s
    #
    #                 list arguments are comma separated and there is no way to
    #                 escape such commas.
    #
    cfg.MultiStrOpt('virt_mkfs',
                    default=[
                      'default=mkfs.ext3 -L %(fs_label)s -F %(target)s',
                      'linux=mkfs.ext3 -L %(fs_label)s -F %(target)s',
Beispiel #5
0
from nova import crypto
from nova import db
from nova import exception
from nova import flags
from nova import log as logging
from nova.openstack.common import cfg
from nova.openstack.common import importutils
from nova import utils


auth_opts = [
    cfg.ListOpt('allowed_roles',
                default=[
                  'cloudadmin',
                  'itsec',
                  'sysadmin',
                  'netadmin',
                  'developer'
                  ],
                help='Allowed roles for project'),

    # NOTE(vish): a user with one of these roles will be a superuser and
    #             have access to all api commands
    cfg.ListOpt('superuser_roles',
                default=['cloudadmin'],
                help='Roles that ignore authorization checking completely'),

    # NOTE(vish): a user with one of these roles will have it for every
    #             project, even if he or she is not a member of the project
    cfg.ListOpt('global_roles',
                default=['cloudadmin', 'itsec'],
Beispiel #6
0
is then selected for provisioning.

NOTE(comstud): This is deprecated. One should use the RAMWeigher and/or
create other weight modules.
"""

from nova import exception
from nova.openstack.common import cfg
from nova.openstack.common import importutils
from nova.openstack.common import log as logging

LOG = logging.getLogger(__name__)

least_cost_opts = [
    cfg.ListOpt('least_cost_functions',
                default=None,
                help='Which cost functions the LeastCostScheduler should use'),
    cfg.FloatOpt('noop_cost_fn_weight',
                 default=1.0,
                 help='How much weight to give the noop cost function'),
    cfg.FloatOpt('compute_fill_first_cost_fn_weight',
                 default=None,
                 help='How much weight to give the fill-first cost function. '
                 'A negative value will reverse behavior: '
                 'e.g. spread-first'),
]

CONF = cfg.CONF
CONF.register_opts(least_cost_opts)

Beispiel #7
0
               help='Verbosity of SQL debugging information. 0=None, '
                    '100=Everything'),
    cfg.BoolOpt('sql_connection_trace',
               default=False,
               help='Add python stack traces to SQL as comment strings'),
]

FLAGS.register_cli_opts(core_opts)
FLAGS.register_cli_opts(debug_opts)

global_opts = [
    cfg.StrOpt('my_ip',
               default=_get_my_ip(),
               help='ip address of this host'),
    cfg.ListOpt('region_list',
                default=[],
                help='list of region=fqdn pairs separated by commas'),
    cfg.StrOpt('aws_access_key_id',
               default='admin',
               help='AWS Access ID'),
    cfg.StrOpt('aws_secret_access_key',
               default='admin',
               help='AWS Access Key'),
    cfg.StrOpt('glance_host',
               default='$my_ip',
               help='default glance hostname or ip'),
    cfg.IntOpt('glance_port',
               default=9292,
               help='default glance port'),
    cfg.ListOpt('glance_api_servers',
                default=['$glance_host:$glance_port'],
Beispiel #8
0
from nova.openstack.common import cfg
from nova.openstack.common.gettextutils import _
from nova.openstack.common import jsonutils
from nova.openstack.common import log as logging
from nova.openstack.common.rpc import amqp as rpc_amqp
from nova.openstack.common.rpc import common as rpc_common

LOG = logging.getLogger(__name__)

qpid_opts = [
    cfg.StrOpt('qpid_hostname',
               default='localhost',
               help='Qpid broker hostname'),
    cfg.StrOpt('qpid_port', default='5672', help='Qpid broker port'),
    cfg.ListOpt('qpid_hosts',
                default=['$qpid_hostname:$qpid_port'],
                help='Qpid HA cluster host:port pairs'),
    cfg.StrOpt('qpid_username',
               default='',
               help='Username for qpid connection'),
    cfg.StrOpt('qpid_password',
               default='',
               help='Password for qpid connection'),
    cfg.StrOpt('qpid_sasl_mechanisms',
               default='',
               help='Space separated list of SASL mechanisms to use for auth'),
    cfg.IntOpt('qpid_heartbeat',
               default=60,
               help='Seconds between connection keepalive heartbeats'),
    cfg.StrOpt('qpid_protocol',
               default='tcp',
Beispiel #9
0
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

"""Extension for hiding server addresses in certain states."""


from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.compute import vm_states
from nova.openstack.common import cfg
from nova.openstack.common import log as logging

opts = [
    cfg.ListOpt('osapi_hide_server_address_states',
                default=[vm_states.BUILDING],
                help='List of instance states that should hide network info'),
]


CONF = cfg.CONF
CONF.register_opts(opts)
LOG = logging.getLogger(__name__)

authorize = extensions.soft_extension_authorizer('compute',
                                                 'hide_server_addresses')


class Controller(wsgi.Controller):
    def __init__(self, *args, **kwargs):
        super(Controller, self).__init__(*args, **kwargs)
Beispiel #10
0
import time
import urlparse

import glanceclient
import glanceclient.exc

from nova import exception
from nova.openstack.common import cfg
from nova.openstack.common import jsonutils
from nova.openstack.common import log as logging
from nova.openstack.common import timeutils

glance_opts = [
    cfg.ListOpt('glance_api_servers',
                default=['$glance_host:$glance_port'],
                help='A list of the glance api servers available to nova. '
                'Prefix with https:// for ssl-based glance api servers. '
                '([hostname|ip]:port)'),
    cfg.BoolOpt('glance_api_insecure',
                default=False,
                help='Allow to perform insecure SSL (https) requests to '
                'glance'),
    cfg.IntOpt('glance_num_retries',
               default=0,
               help='Number retries when downloading an image from glance'),
]

LOG = logging.getLogger(__name__)
CONF = cfg.CONF
CONF.register_opts(glance_opts)
CONF.import_opt('auth_strategy', 'nova.api.auth')
Beispiel #11
0
            help='Size of RPC thread pool'),
 cfg.IntOpt('rpc_conn_pool_size',
            default=30,
            help='Size of RPC connection pool'),
 cfg.IntOpt('rpc_response_timeout',
            default=60,
            help='Seconds to wait for a response from call or multicall'),
 cfg.IntOpt('rpc_cast_timeout',
            default=30,
            help='Seconds to wait before a cast expires (TTL). '
            'Only supported by impl_zmq.'),
 cfg.ListOpt('allowed_rpc_exception_modules',
             default=[
                 'nova.openstack.common.exception',
                 'nova.exception',
                 'cinder.exception',
                 'exceptions',
             ],
             help='Modules of exceptions that are permitted to be recreated'
             'upon receiving exception data from an rpc call.'),
 cfg.BoolOpt('fake_rabbit',
             default=False,
             help='If passed, use a fake RabbitMQ provider'),
 #
 # The following options are not registered here, but are expected to be
 # present. The project using this library must register these options with
 # the configuration so that project-specific defaults may be defined.
 #
 #cfg.StrOpt('control_exchange',
 #           default='nova',
 #           help='AMQP exchange to connect to if using RabbitMQ or Qpid'),
Beispiel #12
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.
"""
Global cells config options
"""

from nova.openstack.common import cfg

cells_opts = [
    cfg.BoolOpt('enable', default=False, help='Enable cell functionality'),
    cfg.StrOpt('topic',
               default='cells',
               help='the topic cells nodes listen on'),
    cfg.StrOpt('manager',
               default='nova.cells.manager.CellsManager',
               help='Manager for cells'),
    cfg.StrOpt('name', default='nova', help='name of this cell'),
    cfg.ListOpt('capabilities',
                default=['hypervisor=xenserver;kvm', 'os=linux;windows'],
                help='Key/Multi-value list with the capabilities of the cell'),
    cfg.IntOpt('call_timeout',
               default=60,
               help='Seconds to wait for response from a call to a cell.'),
]

cfg.CONF.register_opts(cells_opts, group='cells')
Beispiel #13
0
            default='cert',
            help='the topic cert nodes listen on'),
 cfg.StrOpt('compute_topic',
            default='compute',
            help='the topic compute nodes listen on'),
 cfg.StrOpt('console_topic',
            default='console',
            help='the topic console proxy nodes listen on'),
 cfg.StrOpt('scheduler_topic',
            default='scheduler',
            help='the topic scheduler nodes listen on'),
 cfg.StrOpt('network_topic',
            default='network',
            help='the topic network nodes listen on'),
 cfg.ListOpt('enabled_apis',
             default=['ec2', 'osapi_compute', 'metadata'],
             help='a list of APIs to enable by default'),
 cfg.ListOpt('osapi_compute_ext_list',
             default=[],
             help='Specify list of extensions to load when using osapi_'
             'compute_extension option with nova.api.openstack.'
             'compute.contrib.select_extensions'),
 cfg.MultiStrOpt(
     'osapi_compute_extension',
     default=['nova.api.openstack.compute.contrib.standard_extensions'],
     help='osapi compute extension to load'),
 cfg.StrOpt('osapi_compute_unique_server_name_scope',
            default='',
            help='When set, compute API will consider duplicate hostnames '
            'invalid within the specified scope, regardless of case. '
            'Should be empty, "project" or "global".'),
#    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 nova.openstack.common import cfg
from nova.scheduler import filters

isolated_opts = [
    cfg.ListOpt('isolated_images',
                default=[],
                help='Images to run on isolated host'),
    cfg.ListOpt('isolated_hosts',
                default=[],
                help='Host reserved for specific images'),
]
CONF = cfg.CONF
CONF.register_opts(isolated_opts)


class IsolatedHostsFilter(filters.BaseHostFilter):
    """Returns host."""

    def host_passes(self, host_state, filter_properties):
        spec = filter_properties.get('request_spec', {})
        props = spec.get('instance_properties', {})
Beispiel #15
0
from nova import wsgi

LOG = logging.getLogger(__name__)

service_opts = [
    cfg.IntOpt('report_interval',
               default=10,
               help='seconds between nodes reporting state to datastore'),
    cfg.BoolOpt('periodic_enable', default=True, help='enable periodic tasks'),
    cfg.IntOpt('periodic_fuzzy_delay',
               default=60,
               help='range of seconds to randomly delay when starting the'
               ' periodic task scheduler to reduce stampeding.'
               ' (Disable by setting to 0)'),
    cfg.ListOpt('enabled_apis',
                default=['ec2', 'osapi_compute', 'metadata'],
                help='a list of APIs to enable by default'),
    cfg.ListOpt('enabled_ssl_apis',
                default=[],
                help='a list of APIs with enabled SSL'),
    cfg.StrOpt('ec2_listen',
               default="0.0.0.0",
               help='IP address for EC2 API to listen'),
    cfg.IntOpt('ec2_listen_port',
               default=8773,
               help='port for ec2 api to listen'),
    cfg.IntOpt('ec2_workers',
               default=None,
               help='Number of workers for EC2 API service'),
    cfg.StrOpt('osapi_compute_listen',
               default="0.0.0.0",
Beispiel #16
0
debug_opts = [
    cfg.BoolOpt('fake_network',
                default=False,
                help='should we use fake network devices and addresses'),
    cfg.BoolOpt('fake_rabbit', default=False, help='use a fake rabbit'),
]

FLAGS.register_cli_opts(log_opts)
FLAGS.register_cli_opts(core_opts)
FLAGS.register_cli_opts(debug_opts)

global_opts = [
    cfg.StrOpt('my_ip', default=_get_my_ip(), help='host ip address'),
    cfg.ListOpt('region_list',
                default=[],
                help='list of region=fqdn pairs separated by commas'),
    cfg.StrOpt('aws_access_key_id', default='admin', help='AWS Access ID'),
    cfg.StrOpt('aws_secret_access_key', default='admin',
               help='AWS Access Key'),
    cfg.StrOpt('glance_host', default='$my_ip', help='default glance host'),
    cfg.IntOpt('glance_port', default=9292, help='default glance port'),
    cfg.ListOpt('glance_api_servers',
                default=['$glance_host:$glance_port'],
                help='glance api servers available to nova (host:port)'),
    cfg.IntOpt('glance_num_retries',
               default=0,
               help='Number retries when downloading an image from glance'),
    cfg.IntOpt('s3_port', default=3333, help='s3 port'),
    cfg.StrOpt('s3_host',
               default='$my_ip',
Beispiel #17
0
 cfg.StrOpt('network_device_mtu', default=None,
            help='MTU setting for vlan'),
 cfg.StrOpt('dhcpbridge',
            default='$bindir/nova-dhcpbridge',
            help='location of nova-dhcpbridge'),
 cfg.StrOpt('routing_source_ip',
            default='$my_ip',
            help='Public IP of network host'),
 cfg.IntOpt('dhcp_lease_time',
            default=120,
            help='Lifetime of a DHCP lease in seconds'),
 cfg.StrOpt('dns_server',
            default=None,
            help='if set, uses specific dns server for dnsmasq'),
 cfg.ListOpt('dmz_cidr',
             default=[],
             help='A list of dmz range that should be accepted'),
 cfg.StrOpt('dnsmasq_config_file',
            default='',
            help='Override the default dnsmasq settings with this file'),
 cfg.StrOpt('linuxnet_interface_driver',
            default='nova.network.linux_net.LinuxBridgeInterfaceDriver',
            help='Driver used to create ethernet devices.'),
 cfg.StrOpt('linuxnet_ovs_integration_bridge',
            default='br-int',
            help='Name of Open vSwitch bridge used with linuxnet'),
 cfg.BoolOpt('send_arp_for_ha',
             default=False,
             help='send gratuitous ARPs for HA setup'),
 cfg.BoolOpt('use_single_default_gateway',
             default=False,
Beispiel #18
0
# vim: tabstop=4 shiftwidth=4 softtabstop=4

#          (c) Copyright 2012 Hewlett-Packard Development Company, L.P.
#
#    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 nova.openstack.common import cfg

notifier_opts = [cfg.StrOpt('healthnmon_default_notification_level',
                            default='INFO',
                            help='Default notification level for \
                            healthnmon notifications'
                            ),
                 cfg.ListOpt('healthnmon_notification_drivers',
                             default=['healthnmon.notifier.rabbit_notifier', ],
                             help='Default notification drivers for \
                             healthnmon notifications')]

CONF = cfg.CONF
CONF.register_opts(notifier_opts)
Beispiel #19
0
            help='SSL key file (valid only if SSL enabled)'),
 cfg.StrOpt('kombu_ssl_certfile',
            default='',
            help='SSL cert file (valid only if SSL enabled)'),
 cfg.StrOpt('kombu_ssl_ca_certs',
            default='',
            help=('SSL certification authority file '
                  '(valid only if SSL enabled)')),
 cfg.StrOpt('rabbit_host',
            default='localhost',
            help='The RabbitMQ broker address where a single node is used'),
 cfg.IntOpt('rabbit_port',
            default=5672,
            help='The RabbitMQ broker port where a single node is used'),
 cfg.ListOpt('rabbit_hosts',
             default=['$rabbit_host:$rabbit_port'],
             help='RabbitMQ HA cluster host:port pairs'),
 cfg.BoolOpt('rabbit_use_ssl',
             default=False,
             help='connect over SSL for RabbitMQ'),
 cfg.StrOpt('rabbit_userid', default='guest', help='the RabbitMQ userid'),
 cfg.StrOpt('rabbit_password',
            default='guest',
            help='the RabbitMQ password'),
 cfg.StrOpt('rabbit_virtual_host',
            default='/',
            help='the RabbitMQ virtual host'),
 cfg.IntOpt('rabbit_retry_interval',
            default=1,
            help='how frequently to retry connecting with RabbitMQ'),
 cfg.IntOpt('rabbit_retry_backoff',
Beispiel #20
0
from nova.openstack.common import jsonutils
from nova.openstack.common import log as logging
from nova.openstack.common import timeutils

glance_opts = [
    cfg.StrOpt('glance_host',
               default='$my_ip',
               help='default glance hostname or ip'),
    cfg.IntOpt('glance_port', default=9292, help='default glance port'),
    cfg.StrOpt('glance_protocol',
               default='http',
               help='Default protocol to use when connecting to glance. '
               'Set to https for SSL.'),
    cfg.ListOpt('glance_api_servers',
                default=['$glance_host:$glance_port'],
                help='A list of the glance api servers available to nova. '
                'Prefix with https:// for ssl-based glance api servers. '
                '([hostname|ip]:port)'),
    cfg.BoolOpt('glance_api_insecure',
                default=False,
                help='Allow to perform insecure SSL (https) requests to '
                'glance'),
    cfg.IntOpt('glance_num_retries',
               default=0,
               help='Number retries when downloading an image from glance'),
    cfg.ListOpt('allowed_direct_url_schemes',
                default=[],
                help='A list of url scheme that can be downloaded directly '
                'via the direct_url.  Currently supported schemes: '
                '[file].'),
]
Beispiel #21
0
#
#         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.
"""Super simple fake memcache client."""

from nova.openstack.common import cfg
from nova.openstack.common import timeutils

memcache_opts = [
    cfg.ListOpt('memcached_servers',
                default=None,
                help='Memcached servers or None for in process cache.'),
]

CONF = cfg.CONF
CONF.register_opts(memcache_opts)


def get_client():
    client_cls = Client

    if CONF.memcached_servers:
        import memcache
        client_cls = memcache.Client

    return client_cls(CONF.memcached_servers, debug=0)
Beispiel #22
0
is decided upon by a set of objective-functions, called the 'cost-functions'.
The WeightedHost contains a combined weight for each cost-function.

The cost-function and weights are tabulated, and the host with the least cost
is then selected for provisioning.
"""

from nova import flags
from nova import log as logging
from nova.openstack.common import cfg

LOG = logging.getLogger(__name__)

least_cost_opts = [
    cfg.ListOpt(
        'least_cost_functions',
        default=['nova.scheduler.least_cost.compute_fill_first_cost_fn'],
        help='Which cost functions the LeastCostScheduler should use'),
    cfg.FloatOpt('noop_cost_fn_weight',
                 default=1.0,
                 help='How much weight to give the noop cost function'),
    cfg.FloatOpt('compute_fill_first_cost_fn_weight',
                 default=-1.0,
                 help='How much weight to give the fill-first cost function. '
                 'A negative value will reverse behavior: '
                 'e.g. spread-first'),
]

FLAGS = flags.FLAGS
FLAGS.register_opts(least_cost_opts)

# TODO(sirp): Once we have enough of these rules, we can break them out into a
Beispiel #23
0
from nova.openstack.common import log as logging
from nova.openstack.common import timeutils
from nova.scheduler import filters
from nova.scheduler import weights

host_manager_opts = [
    cfg.MultiStrOpt('scheduler_available_filters',
                    default=['nova.scheduler.filters.all_filters'],
                    help='Filter classes available to the scheduler which may '
                    'be specified more than once.  An entry of '
                    '"nova.scheduler.filters.standard_filters" '
                    'maps to all filters included with nova.'),
    cfg.ListOpt('scheduler_default_filters',
                default=[
                    'RetryFilter', 'AvailabilityZoneFilter', 'RamFilter',
                    'ComputeFilter', 'ComputeCapabilitiesFilter',
                    'ImagePropertiesFilter'
                ],
                help='Which filter class names to use for filtering hosts '
                'when not specified in the request.'),
    cfg.ListOpt('scheduler_weight_classes',
                default=['nova.scheduler.weights.all_weighers'],
                help='Which weight class names to use for weighing hosts'),
]

CONF = cfg.CONF
CONF.register_opts(host_manager_opts)

LOG = logging.getLogger(__name__)


class ReadOnlyDict(UserDict.IterableUserDict):
Beispiel #24
0
    cfg.BoolOpt('inject_password',
                default=True,
                help='Whether baremetal compute injects password or not'),
    cfg.StrOpt('injected_network_template',
               default=paths.basedir_def('nova/virt/'
                                         'baremetal/interfaces.template'),
               help='Template file for injected network'),
    cfg.StrOpt('vif_driver',
               default='nova.virt.baremetal.vif_driver.BareMetalVIFDriver',
               help='Baremetal VIF driver.'),
    cfg.StrOpt('volume_driver',
               default='nova.virt.baremetal.volume_driver.LibvirtVolumeDriver',
               help='Baremetal volume driver.'),
    cfg.ListOpt('instance_type_extra_specs',
                default=[],
                help='a list of additional capabilities corresponding to '
                'instance_type_extra_specs for this compute '
                'host to advertise. Valid entries are name=value, pairs '
                'For example, "key1:val1, key2:val2"'),
    cfg.StrOpt('driver',
               default='nova.virt.baremetal.pxe.PXE',
               help='Baremetal driver back-end (pxe or tilera)'),
    cfg.StrOpt('power_manager',
               default='nova.virt.baremetal.ipmi.IPMI',
               help='Baremetal power management method'),
    cfg.StrOpt('tftp_root',
               default='/tftpboot',
               help='Baremetal compute node\'s tftp root path'),
]

LOG = logging.getLogger(__name__)
Beispiel #25
0
            default='cert',
            help='the topic cert nodes listen on'),
 cfg.StrOpt('compute_topic',
            default='compute',
            help='the topic compute nodes listen on'),
 cfg.StrOpt('console_topic',
            default='console',
            help='the topic console proxy nodes listen on'),
 cfg.StrOpt('scheduler_topic',
            default='scheduler',
            help='the topic scheduler nodes listen on'),
 cfg.StrOpt('network_topic',
            default='network',
            help='the topic network nodes listen on'),
 cfg.ListOpt('enabled_apis',
             default=['ec2', 'osapi_compute', 'metadata'],
             help='a list of APIs to enable by default'),
 cfg.StrOpt('osapi_compute_unique_server_name_scope',
            default='',
            help='When set, compute API will consider duplicate hostnames '
                 'invalid within the specified scope, regardless of case. '
                 'Should be empty, "project" or "global".'),
 cfg.StrOpt('osapi_path',
            default='/v1.1/',
            help='the path prefix used to call the openstack api server'),
 cfg.StrOpt('default_instance_type',
            default='m1.small',
            help='default instance type to use, testing only'),
 cfg.StrOpt('vpn_image_id',
            default='0',
            help='image id used when starting up a cloudpipe vpn server'),
Beispiel #26
0
import sqlalchemy.orm
from sqlalchemy.pool import NullPool, StaticPool

from nova.exception import DBDuplicateEntry
from nova.exception import DBError
from nova.openstack.common import cfg
import nova.openstack.common.log as logging


sql_opts = [
    cfg.StrOpt('sql_connection',
               default='sqlite:///$state_path/$sqlite_db',
               help='The SQLAlchemy connection string used to connect to the '
                    'database'),
    cfg.ListOpt('extra_sql_connections',
               default=[],
               help='List of SQLAlchemy connection strings of redundant '
                    'databases to failover.'),
    cfg.StrOpt('sqlite_db',
               default='nova.sqlite',
               help='the filename to use with sqlite'),
    cfg.IntOpt('sql_idle_timeout',
               default=3600,
               help='timeout before idle sql connections are reaped'),
    cfg.BoolOpt('sqlite_synchronous',
                default=True,
                help='If passed, use synchronous mode for sqlite'),
    cfg.IntOpt('sql_min_pool_size',
               default=1,
               help='Minimum number of SQL connections to keep open in a '
                     'pool'),
    cfg.IntOpt('sql_max_pool_size',
Beispiel #27
0
#    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 nova.openstack.common import cfg
from nova.openstack.common import context as req_context
from nova.openstack.common.gettextutils import _
from nova.openstack.common import log as logging
from nova.openstack.common import rpc

LOG = logging.getLogger(__name__)

notification_topic_opt = cfg.ListOpt(
    'notification_topics',
    default=[
        'notifications',
    ],
    help='AMQP topic used for openstack notifications')

CONF = cfg.CONF
CONF.register_opt(notification_topic_opt)


def notify(context, message):
    """Sends a notification to the RabbitMQ"""
    if not context:
        context = req_context.get_admin_context()
    priority = message.get('priority', CONF.default_notification_level)
    priority = priority.lower()
    for topic in CONF.notification_topics:
        topic = '%s.%s' % (topic, priority)
Beispiel #28
0
    cfg.IntOpt('reserved_host_disk_mb',
               default=0,
               help='Amount of disk in MB to reserve for host/dom0'),
    cfg.IntOpt('reserved_host_memory_mb',
               default=512,
               help='Amount of memory in MB to reserve for host/dom0'),
    cfg.MultiStrOpt('scheduler_available_filters',
            default=['nova.scheduler.filters.standard_filters'],
            help='Filter classes available to the scheduler which may '
                    'be specified more than once.  An entry of '
                    '"nova.scheduler.filters.standard_filters" '
                    'maps to all filters included with nova.'),
    cfg.ListOpt('scheduler_default_filters',
                default=[
                  'AvailabilityZoneFilter',
                  'RamFilter',
                  'ComputeFilter'
                  ],
                help='Which filter class names to use for filtering hosts '
                      'when not specified in the request.'),
    ]

FLAGS = flags.FLAGS
FLAGS.register_opts(host_manager_opts)

LOG = logging.getLogger(__name__)


class ReadOnlyDict(UserDict.IterableUserDict):
    """A read-only dict."""
    def __init__(self, source=None):
        self.data = {}
Beispiel #29
0
    cfg.StrOpt('logging_default_format_string',
               default='%(asctime)s %(levelname)s %(name)s [-] %(instance)s'
                       '%(message)s',
               help='format string to use for log messages without context'),
    cfg.StrOpt('logging_debug_format_suffix',
               default='from (pid=%(process)d) %(funcName)s '
                       '%(pathname)s:%(lineno)d',
               help='data to append to log format when level is DEBUG'),
    cfg.StrOpt('logging_exception_prefix',
               default='%(asctime)s TRACE %(name)s %(instance)s',
               help='prefix each line of exception output with this format'),
    cfg.ListOpt('default_log_levels',
                default=[
                  'amqplib=WARN',
                  'sqlalchemy=WARN',
                  'boto=WARN',
                  'suds=INFO',
                  'eventlet.wsgi.server=WARN'
                  ],
                help='list of logger=LEVEL pairs'),
    cfg.BoolOpt('publish_errors',
                default=False,
                help='publish error events'),

    # NOTE(mikal): there are two options here because sometimes we are handed
    # a full instance (and could include more information), and other times we
    # are just handed a UUID for the instance.
    cfg.StrOpt('instance_format',
               default='[instance: %(uuid)s] ',
               help='If an instance is passed with the log message, format '
                    'it like this'),
Beispiel #30
0
from nova import exception
from nova import flags
from nova import log as logging
from nova.openstack.common import cfg
from nova import utils

host_manager_opts = [
    cfg.IntOpt('reserved_host_disk_mb',
               default=0,
               help='Amount of disk in MB to reserve for host/dom0'),
    cfg.IntOpt('reserved_host_memory_mb',
               default=512,
               help='Amount of memory in MB to reserve for host/dom0'),
    cfg.ListOpt(
        'default_host_filters',
        default=['AvailabilityZoneFilter', 'RamFilter', 'ComputeFilter'],
        help='Which filters to use for filtering hosts when not '
        'specified in the request.'),
]

FLAGS = flags.FLAGS
FLAGS.register_opts(host_manager_opts)

LOG = logging.getLogger(__name__)


class ReadOnlyDict(UserDict.IterableUserDict):
    """A read-only dict."""
    def __init__(self, source=None):
        self.data = {}
        self.update(source)