Exemplo n.º 1
0
                cfg.DeprecatedOpt('database', group=_deprecated_group),
            ],
            help='Database name.'),
 cfg.IntOpt('max_attempts',
            min=0,
            default=1000,
            deprecated_opts=[
                cfg.DeprecatedOpt('max_attempts', group=_deprecated_group),
            ],
            help=('Maximum number of times to retry a failed operation. '
                  'Currently only used for retrying a message post.')),
 cfg.FloatOpt('max_retry_sleep',
              default=0.1,
              deprecated_opts=[
                  cfg.DeprecatedOpt('max_retry_sleep',
                                    group=_deprecated_group),
              ],
              help=('Maximum sleep interval between retries '
                    '(actual sleep time increases linearly '
                    'according to number of attempts performed).')),
 cfg.FloatOpt('max_retry_jitter',
              default=0.005,
              deprecated_opts=[
                  cfg.DeprecatedOpt('max_retry_jitter',
                                    group=_deprecated_group),
              ],
              help=('Maximum jitter interval, to be added to the '
                    'sleep interval, in order to decrease probability '
                    'that parallel requests will retry at the '
                    'same instant.')),
 cfg.IntOpt('max_reconnect_attempts',
Exemplo n.º 2
0
The default is to spread volumes across all hosts evenly.  If you prefer
stacking, you can set the 'volume_number_multiplier' option to a positive
number and the weighing has the opposite effect of the default.
"""


from oslo_config import cfg

from cinder import db
from cinder.scheduler import weights


volume_number_weight_opts = [
    cfg.FloatOpt('volume_number_multiplier',
                 default=-1.0,
                 help='Multiplier used for weighing volume number. '
                      'Negative numbers mean to spread vs stack.'),
]

CONF = cfg.CONF
CONF.register_opts(volume_number_weight_opts)


class VolumeNumberWeigher(weights.BaseHostWeigher):
    def weight_multiplier(self):
        """Override the weight multiplier."""
        return CONF.volume_number_multiplier

    def _weigh_object(self, host_state, weight_properties):
        """Less volume number weights win.
Exemplo n.º 3
0
                                title='The Hyper-V feature',
                                help="""
The hyperv feature allows you to configure the Hyper-V hypervisor
driver to be used within an OpenStack deployment.
""")

hyperv_opts = [
    cfg.FloatOpt('dynamic_memory_ratio',
                 default=1.0,
                 help="""
Dynamic memory ratio

Enables dynamic memory allocation (ballooning) when set to a value
greater than 1. The value expresses the ratio between the total RAM
assigned to an instance and its startup RAM amount. For example a
ratio of 2.0 for an instance with 1024MB of RAM implies 512MB of
RAM allocated at startup.

Possible values:

* 1.0: Disables dynamic memory allocation (Default).
* Float values greater than 1.0: Enables allocation of total implied
  RAM divided by this value for startup.
"""),
    cfg.BoolOpt('enable_instance_metrics_collection',
                default=False,
                help="""
Enable instance metrics collection

Enables metrics collections for an instance by using Hyper-V's
metric APIs. Collected data can by retrieved by other apps and
Exemplo n.º 4
0
class GeneratorTestCase(base.BaseTestCase):

    groups = {
        'group1': cfg.OptGroup(name='group1',
                               help='Lorem ipsum dolor sit amet, consectetur '
                                    'adipisicing elit, sed do eiusmod tempor '
                                    'incididunt ut labore et dolore magna '
                                    'aliqua. Ut enim ad minim veniam, quis '
                                    'nostrud exercitation ullamco laboris '
                                    'nisi ut aliquip ex ea commodo '
                                    'consequat. Duis aute irure dolor in.'),
        'group2': cfg.OptGroup(name='group2', title='Group 2'),
        'foo': cfg.OptGroup(name='foo', title='Foo Title', help='foo help'),
    }

    opts = {
        'foo': cfg.StrOpt('foo', help='foo option'),
        'bar': cfg.StrOpt('bar', help='bar option'),
        'foo-bar': cfg.StrOpt('foo-bar', help='foobar'),
        'no_help': cfg.StrOpt('no_help'),
        'long_help': cfg.StrOpt('long_help',
                                help='Lorem ipsum dolor sit amet, consectetur '
                                     'adipisicing elit, sed do eiusmod tempor '
                                     'incididunt ut labore et dolore magna '
                                     'aliqua. Ut enim ad minim veniam, quis '
                                     'nostrud exercitation ullamco laboris '
                                     'nisi ut aliquip ex ea commodo '
                                     'consequat. Duis aute irure dolor in '
                                     'reprehenderit in voluptate velit esse '
                                     'cillum dolore eu fugiat nulla '
                                     'pariatur. Excepteur sint occaecat '
                                     'cupidatat non proident, sunt in culpa '
                                     'qui officia deserunt mollit anim id est '
                                     'laborum.'),
        'long_help_pre': cfg.StrOpt('long_help_pre',
                                    help='This is a very long help text which '
                                         'is preformatted with line breaks. '
                                         'It should break when it is too long '
                                         'but also keep the specified line '
                                         'breaks. This makes it possible to '
                                         'create lists with items:\n'
                                         '\n'
                                         '* item 1\n'
                                         '* item 2\n'
                                         '\n'
                                         'and should increase the '
                                         'readability.'),
        'choices_opt': cfg.StrOpt('choices_opt',
                                  default='a',
                                  choices=(None, '', 'a', 'b', 'c'),
                                  help='a string with choices'),
        'deprecated_opt_without_deprecated_group': cfg.StrOpt(
            'bar', deprecated_name='foobar', help='deprecated'),
        'deprecated_for_removal_opt': cfg.StrOpt(
            'bar', deprecated_for_removal=True, help='deprecated for removal'),
        'deprecated_reason_opt': cfg.BoolOpt(
            'turn_off_stove',
            default=False,
            deprecated_for_removal=True,
            deprecated_reason='This was supposed to work but it really, '
                              'really did not. Always buy house insurance.',
            help='DEPRECATED: Turn off stove'),
        'deprecated_opt_with_deprecated_since': cfg.BoolOpt(
            'tune_in',
            deprecated_for_removal=True,
            deprecated_since='13.0'),
        'deprecated_opt_with_deprecated_group': cfg.StrOpt(
            'bar', deprecated_name='foobar', deprecated_group='group1',
            help='deprecated'),
        # Unknown Opt default must be a string
        'unknown_type': cfg.Opt('unknown_opt',
                                default='123',
                                help='unknown',
                                type=types.String(type_name='unknown type')),
        'str_opt': cfg.StrOpt('str_opt',
                              default='foo bar',
                              help='a string'),
        'str_opt_sample_default': cfg.StrOpt('str_opt',
                                             default='fooishbar',
                                             help='a string'),
        'str_opt_with_space': cfg.StrOpt('str_opt',
                                         default='  foo bar  ',
                                         help='a string with spaces'),
        'bool_opt': cfg.BoolOpt('bool_opt',
                                default=False,
                                help='a boolean'),
        'int_opt': cfg.IntOpt('int_opt',
                              default=10,
                              min=1,
                              max=20,
                              help='an integer'),
        'int_opt_min_0': cfg.IntOpt('int_opt_min_0',
                                    default=10,
                                    min=0,
                                    max=20,
                                    help='an integer'),
        'int_opt_max_0': cfg.IntOpt('int_opt_max_0',
                                    default=-1,
                                    max=0,
                                    help='an integer'),
        'float_opt': cfg.FloatOpt('float_opt',
                                  default=0.1,
                                  help='a float'),
        'list_opt': cfg.ListOpt('list_opt',
                                default=['1', '2', '3'],
                                help='a list'),
        'dict_opt': cfg.DictOpt('dict_opt',
                                default={'1': 'yes', '2': 'no'},
                                help='a dict'),
        'ip_opt': cfg.IPOpt('ip_opt',
                            default='127.0.0.1',
                            help='an ip address'),
        'port_opt': cfg.PortOpt('port_opt',
                                default=80,
                                help='a port'),
        'hostname_opt': cfg.HostnameOpt('hostname_opt',
                                        default='compute01.nova.site1',
                                        help='a hostname'),
        'uri_opt': cfg.URIOpt('uri_opt',
                              default='http://example.com',
                              help='a URI'),
        'multi_opt': cfg.MultiStrOpt('multi_opt',
                                     default=['1', '2', '3'],
                                     help='multiple strings'),
        'multi_opt_none': cfg.MultiStrOpt('multi_opt_none',
                                          help='multiple strings'),
        'multi_opt_empty': cfg.MultiStrOpt('multi_opt_empty',
                                           default=[],
                                           help='multiple strings'),
        'multi_opt_sample_default': cfg.MultiStrOpt('multi_opt',
                                                    default=['1', '2', '3'],
                                                    sample_default=['5', '6'],
                                                    help='multiple strings'),
        'string_type_with_bad_default': cfg.Opt('string_type_with_bad_default',
                                                help='string with bad default',
                                                default=4096),
        'native_str_type': cfg.Opt('native_str_type',
                                   help='native help',
                                   type=str),
        'native_int_type': cfg.Opt('native_int_type',
                                   help='native help',
                                   type=int),
        'native_float_type': cfg.Opt('native_float_type',
                                     help='native help',
                                     type=float),
        'custom_type': cfg.Opt('custom_type',
                               help='custom help',
                               type=custom_type),
        'custom_type_name': cfg.Opt('custom_opt_type',
                                    type=types.Integer(type_name='port'
                                                       ' number'),
                                    default=5511,
                                    help='this is a port'),
    }

    content_scenarios = [
        ('empty',
         dict(opts=[], expected='''[DEFAULT]
''')),
        ('single_namespace',
         dict(opts=[('test', [(None, [opts['foo']])])],
              expected='''[DEFAULT]

#
# From test
#

# foo option (string value)
#foo = <None>
''')),
        ('multiple_namespaces',
         dict(opts=[('test', [(None, [opts['foo']])]),
                    ('other', [(None, [opts['bar']])])],
              expected='''[DEFAULT]

#
# From other
#

# bar option (string value)
#bar = <None>

#
# From test
#

# foo option (string value)
#foo = <None>
''')),
        ('group',
         dict(opts=[('test', [(groups['group1'], [opts['foo']])])],
              expected='''[DEFAULT]


[group1]
# Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
# eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
# ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
# aliquip ex ea commodo consequat. Duis aute irure dolor in.

#
# From test
#

# foo option (string value)
#foo = <None>
''')),
        ('empty_group',
         dict(opts=[('test', [(groups['group1'], [])])],
              expected='''[DEFAULT]
''')),
        ('multiple_groups',
         dict(opts=[('test', [(groups['group1'], [opts['foo']]),
                              (groups['group2'], [opts['bar']])])],
              expected='''[DEFAULT]


[group1]
# Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
# eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
# ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
# aliquip ex ea commodo consequat. Duis aute irure dolor in.

#
# From test
#

# foo option (string value)
#foo = <None>


[group2]

#
# From test
#

# bar option (string value)
#bar = <None>
''')),
        ('group_in_multiple_namespaces',
         dict(opts=[('test', [(groups['group1'], [opts['foo']])]),
                    ('other', [(groups['group1'], [opts['bar']])])],
              expected='''[DEFAULT]


[group1]
# Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
# eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
# ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
# aliquip ex ea commodo consequat. Duis aute irure dolor in.

#
# From other
#

# bar option (string value)
#bar = <None>

#
# From test
#

# foo option (string value)
#foo = <None>
''')),
        ('hyphenated_name',
         dict(opts=[('test', [(None, [opts['foo-bar']])])],
              expected='''[DEFAULT]

#
# From test
#

# foobar (string value)
#foo_bar = <None>
''')),
        ('no_help',
         dict(opts=[('test', [(None, [opts['no_help']])])],
              log_warning=('"%s" is missing a help string', 'no_help'),
              expected='''[DEFAULT]

#
# From test
#

# (string value)
#no_help = <None>
''')),
        ('long_help',
         dict(opts=[('test', [(None, [opts['long_help']])])],
              expected='''[DEFAULT]

#
# From test
#

# Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
# eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
# ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
# aliquip ex ea commodo consequat. Duis aute irure dolor in
# reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
# pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
# culpa qui officia deserunt mollit anim id est laborum. (string
# value)
#long_help = <None>
''')),
        ('long_help_wrap_at_40',
         dict(opts=[('test', [(None, [opts['long_help']])])],
              wrap_width=40,
              expected='''[DEFAULT]

#
# From test
#

# Lorem ipsum dolor sit amet,
# consectetur adipisicing elit, sed do
# eiusmod tempor incididunt ut labore et
# dolore magna aliqua. Ut enim ad minim
# veniam, quis nostrud exercitation
# ullamco laboris nisi ut aliquip ex ea
# commodo consequat. Duis aute irure
# dolor in reprehenderit in voluptate
# velit esse cillum dolore eu fugiat
# nulla pariatur. Excepteur sint
# occaecat cupidatat non proident, sunt
# in culpa qui officia deserunt mollit
# anim id est laborum. (string value)
#long_help = <None>
''')),
        ('long_help_no_wrapping',
         dict(opts=[('test', [(None, [opts['long_help']])])],
              wrap_width=0,
              expected='''[DEFAULT]

#
# From test
#

'''   # noqa
'# Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod '
'tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, '
'quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo '
'consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse '
'cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat '
'non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. '
'(string value)'
'''
#long_help = <None>
''')),
        ('long_help_with_preformatting',
         dict(opts=[('test', [(None, [opts['long_help_pre']])])],
              wrap_width=70,
              expected='''[DEFAULT]

#
# From test
#

# This is a very long help text which is preformatted with line
# breaks. It should break when it is too long but also keep the
# specified line breaks. This makes it possible to create lists with
# items:
#
# * item 1
# * item 2
#
# and should increase the readability. (string value)
#long_help_pre = <None>
''')),
        ('choices_opt',
         dict(opts=[('test', [(None, [opts['choices_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# a string with choices (string value)
# Allowed values: <None>, '', a, b, c
#choices_opt = a
''')),
        ('deprecated opt without deprecated group',
         dict(opts=[('test',
                     [(groups['foo'],
                       [opts['deprecated_opt_without_deprecated_group']])])],
              expected='''[DEFAULT]


[foo]
# foo help

#
# From test
#

# deprecated (string value)
# Deprecated group/name - [foo]/foobar
#bar = <None>
''')),
        ('deprecated_for_removal',
         dict(opts=[('test', [(groups['foo'],
                              [opts['deprecated_for_removal_opt']])])],
              expected='''[DEFAULT]


[foo]
# foo help

#
# From test
#

# DEPRECATED: deprecated for removal (string value)
# This option is deprecated for removal.
# Its value may be silently ignored in the future.
#bar = <None>
''')),
        ('deprecated_reason',
         dict(opts=[('test', [(groups['foo'],
                              [opts['deprecated_reason_opt']])])],
              expected='''[DEFAULT]


[foo]
# foo help

#
# From test
#

# DEPRECATED: Turn off stove (boolean value)
# This option is deprecated for removal.
# Its value may be silently ignored in the future.
# Reason: This was supposed to work but it really, really did not.
# Always buy house insurance.
#turn_off_stove = false
''')),
        ('deprecated_opt_with_deprecated_group',
         dict(opts=[('test',
                     [(groups['foo'],
                       [opts['deprecated_opt_with_deprecated_group']])])],
              expected='''[DEFAULT]


[foo]
# foo help

#
# From test
#

# deprecated (string value)
# Deprecated group/name - [group1]/foobar
#bar = <None>
''')),
        ('unknown_type',
         dict(opts=[('test', [(None, [opts['unknown_type']])])],
              expected='''[DEFAULT]

#
# From test
#

# unknown (unknown type)
#unknown_opt = 123
''')),
        ('str_opt',
         dict(opts=[('test', [(None, [opts['str_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# a string (string value)
#str_opt = foo bar
''')),
        ('str_opt_with_space',
         dict(opts=[('test', [(None, [opts['str_opt_with_space']])])],
              expected='''[DEFAULT]

#
# From test
#

# a string with spaces (string value)
#str_opt = "  foo bar  "
''')),
        ('bool_opt',
         dict(opts=[('test', [(None, [opts['bool_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# a boolean (boolean value)
#bool_opt = false
''')),
        ('int_opt',
         dict(opts=[('test', [(None, [opts['int_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# an integer (integer value)
# Minimum value: 1
# Maximum value: 20
#int_opt = 10
''')),
        ('int_opt_min_0',
         dict(opts=[('test', [(None, [opts['int_opt_min_0']])])],
              expected='''[DEFAULT]

#
# From test
#

# an integer (integer value)
# Minimum value: 0
# Maximum value: 20
#int_opt_min_0 = 10
''')),
        ('int_opt_max_0',
         dict(opts=[('test', [(None, [opts['int_opt_max_0']])])],
              expected='''[DEFAULT]

#
# From test
#

# an integer (integer value)
# Maximum value: 0
#int_opt_max_0 = -1
''')),

        ('float_opt',
         dict(opts=[('test', [(None, [opts['float_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# a float (floating point value)
#float_opt = 0.1
''')),
        ('list_opt',
         dict(opts=[('test', [(None, [opts['list_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# a list (list value)
#list_opt = 1,2,3
''')),
        ('dict_opt',
         dict(opts=[('test', [(None, [opts['dict_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# a dict (dict value)
#dict_opt = 1:yes,2:no
''')),
        ('ip_opt',
         dict(opts=[('test', [(None, [opts['ip_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# an ip address (IP address value)
#ip_opt = 127.0.0.1
''')),
        ('port_opt',
         dict(opts=[('test', [(None, [opts['port_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# a port (port value)
# Minimum value: 0
# Maximum value: 65535
#port_opt = 80
''')),
        ('hostname_opt',
         dict(opts=[('test', [(None, [opts['hostname_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# a hostname (hostname value)
#hostname_opt = compute01.nova.site1
''')),
        ('multi_opt',
         dict(opts=[('test', [(None, [opts['multi_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# multiple strings (multi valued)
#multi_opt = 1
#multi_opt = 2
#multi_opt = 3
''')),
        ('multi_opt_none',
         dict(opts=[('test', [(None, [opts['multi_opt_none']])])],
              expected='''[DEFAULT]

#
# From test
#

# multiple strings (multi valued)
#multi_opt_none =
''')),
        ('multi_opt_empty',
         dict(opts=[('test', [(None, [opts['multi_opt_empty']])])],
              expected='''[DEFAULT]

#
# From test
#

# multiple strings (multi valued)
#multi_opt_empty =
''')),
        ('str_opt_sample_default',
         dict(opts=[('test', [(None, [opts['str_opt_sample_default']])])],
              expected='''[DEFAULT]

#
# From test
#

# a string (string value)
#str_opt = fooishbar
''')),
        ('native_str_type',
         dict(opts=[('test', [(None, [opts['native_str_type']])])],
              expected='''[DEFAULT]

#
# From test
#

# native help (string value)
#native_str_type = <None>
''')),
        ('native_int_type',
         dict(opts=[('test', [(None, [opts['native_int_type']])])],
              expected='''[DEFAULT]

#
# From test
#

# native help (integer value)
#native_int_type = <None>
''')),
        ('native_float_type',
         dict(opts=[('test', [(None, [opts['native_float_type']])])],
              expected='''[DEFAULT]

#
# From test
#

# native help (floating point value)
#native_float_type = <None>
''')),
        ('multi_opt_sample_default',
         dict(opts=[('test', [(None, [opts['multi_opt_sample_default']])])],
              expected='''[DEFAULT]

#
# From test
#

# multiple strings (multi valued)
#multi_opt = 5
#multi_opt = 6
''')),
        ('custom_type_name',
         dict(opts=[('test', [(None, [opts['custom_type_name']])])],
              expected='''[DEFAULT]

#
# From test
#

# this is a port (port number)
#custom_opt_type = 5511
''')),
        ('custom_type',
         dict(opts=[('test', [(None, [opts['custom_type']])])],
              expected='''[DEFAULT]

#
# From test
#

# custom help (unknown value)
#custom_type = <None>
''')),
        ('string_type_with_bad_default',
         dict(opts=[('test', [(None,
                               [opts['string_type_with_bad_default']])])],
              expected='''[DEFAULT]

#
# From test
#

# string with bad default (string value)
#string_type_with_bad_default = 4096
''')),
         ('str_opt_str_group',
         dict(opts=[('test', [('foo',
                               [opts['str_opt']]),
                              (groups['foo'],
                               [opts['int_opt']])]),
                    ('foo', [('foo',
                               [opts['bool_opt']])])],
              expected='''[DEFAULT]


[foo]
# foo help

#
# From foo
#

# a boolean (boolean value)
#bool_opt = false

#
# From test
#

# a string (string value)
#str_opt = foo bar

#
# From test
#

# an integer (integer value)
# Minimum value: 1
# Maximum value: 20
#int_opt = 10
''')),
         ('opt_str_opt_group',
         dict(opts=[('test', [(groups['foo'],
                               [opts['int_opt']]),
                              ('foo',
                               [opts['str_opt']])]),
                    ('foo', [(groups['foo'],
                              [opts['bool_opt']])])],
              expected='''[DEFAULT]


[foo]
# foo help

#
# From foo
#

# a boolean (boolean value)
#bool_opt = false

#
# From test
#

# an integer (integer value)
# Minimum value: 1
# Maximum value: 20
#int_opt = 10

#
# From test
#

# a string (string value)
#str_opt = foo bar
''')),
    ]

    output_file_scenarios = [
        ('stdout',
         dict(stdout=True, output_file=None)),
        ('output_file',
         dict(output_file='sample.conf', stdout=False)),
    ]

    @classmethod
    def generate_scenarios(cls):
        cls.scenarios = testscenarios.multiply_scenarios(
            cls.content_scenarios,
            cls.output_file_scenarios)

    def setUp(self):
        super(GeneratorTestCase, self).setUp()

        self.conf = cfg.ConfigOpts()
        self.config_fixture = config_fixture.Config(self.conf)
        self.config = self.config_fixture.config
        self.useFixture(self.config_fixture)

        self.tempdir = self.useFixture(fixtures.TempDir())

    def _capture_stream(self, stream_name):
        self.useFixture(fixtures.MonkeyPatch("sys.%s" % stream_name,
                                             moves.StringIO()))
        return getattr(sys, stream_name)

    def _capture_stdout(self):
        return self._capture_stream('stdout')

    @mock.patch.object(generator, '_get_raw_opts_loaders')
    @mock.patch.object(generator, 'LOG')
    def test_generate(self, mock_log, raw_opts_loader):
        generator.register_cli_opts(self.conf)

        namespaces = [i[0] for i in self.opts]
        self.config(namespace=namespaces)

        for group in self.groups.values():
            self.conf.register_group(group)

        wrap_width = getattr(self, 'wrap_width', None)
        if wrap_width is not None:
            self.config(wrap_width=wrap_width)

        if self.stdout:
            stdout = self._capture_stdout()
        else:
            output_file = self.tempdir.join(self.output_file)
            self.config(output_file=output_file)

        # We have a static data structure matching what should be
        # returned by _list_opts() but we're mocking out a lower level
        # function that needs to return a namespace and a callable to
        # return options from that namespace. We have to pass opts to
        # the lambda to cache a reference to the name because the list
        # comprehension changes the thing pointed to by the name each
        # time through the loop.
        raw_opts_loader.return_value = [
            (ns, lambda opts=opts: opts)
            for ns, opts in self.opts
        ]

        generator.generate(self.conf)

        if self.stdout:
            self.assertEqual(self.expected, stdout.getvalue())
        else:
            with open(output_file, 'r') as f:
                actual = f.read()
            self.assertEqual(self.expected, actual)

        log_warning = getattr(self, 'log_warning', None)
        if log_warning is not None:
            mock_log.warning.assert_called_once_with(*log_warning)
        else:
            self.assertFalse(mock_log.warning.called)
Exemplo n.º 5
0
* Related options:

    None
""")

ram_weight_mult_opt = cfg.FloatOpt("ram_weight_multiplier",
                                   default=1.0,
                                   help="""
This option determines how hosts with more or less available RAM are weighed. A
positive value will result in the scheduler preferring hosts with more
available RAM, and a negative number will result in the scheduler preferring
hosts with less available RAM. Another way to look at it is that positive
values for this option will tend to spread instances across many hosts, while
negative values will tend to fill up (stack) hosts as much as possible before
scheduling to a less-used host. The absolute value, whether positive or
negative, controls how strong the RAM weigher is relative to other weighers.

This option is only used by the FilterScheduler and its subclasses; if you use
a different scheduler, this option has no effect. Also note that this setting
only affects scheduling if the 'ram' weigher is enabled.

Valid values are numeric, either integer or float.

* Related options:

    None
""")

disk_weight_mult_opt = cfg.FloatOpt(
    "disk_weight_multiplier",
    default=1.0,
    help="Multiplier used for weighing free disk space. Negative "
Exemplo n.º 6
0
allocation_ratio_opts = [
    cfg.FloatOpt('cpu_allocation_ratio',
                 default=0.0,
                 min=0.0,
                 help="""
This option helps you specify virtual CPU to physical CPU allocation ratio.

From Ocata (15.0.0) this is used to influence the hosts selected by
the Placement API. Note that when Placement is used, the CoreFilter
is redundant, because the Placement API will have already filtered
out hosts that would have failed the CoreFilter.

This configuration specifies ratio for CoreFilter which can be set
per compute node. For AggregateCoreFilter, it will fall back to this
configuration value if no per-aggregate setting is found.

NOTE: This can be set per-compute, or if set to 0.0, the value
set on the scheduler node(s) or compute node(s) will be used
and defaulted to 16.0. Once set to a non-default value, it is not possible
to "unset" the config to get back to the default behavior. If you want
to reset back to the default, explicitly specify 16.0.

NOTE: As of the 16.0.0 Pike release, this configuration option is ignored
for the ironic.IronicDriver compute driver and is hardcoded to 1.0.

Possible values:

* Any valid positive integer or float value
"""),
    cfg.FloatOpt('ram_allocation_ratio',
                 default=0.0,
Exemplo n.º 7
0
             'cache-backend get/set/delete calls with the '
             'keys/values.  Typically this should be left set '
             'to false.'),
 cfg.ListOpt('memcache_servers',
             default=['localhost:11211'],
             help='Memcache servers in the format of "host:port".'
             ' (dogpile.cache.memcached and oslo_cache.memcache_pool'
             ' backends only).'),
 cfg.IntOpt('memcache_dead_retry',
            default=5 * 60,
            help='Number of seconds memcached server is considered dead'
            ' before it is tried again. (dogpile.cache.memcache and'
            ' oslo_cache.memcache_pool backends only).'),
 cfg.FloatOpt('memcache_socket_timeout',
              default=1.0,
              help='Timeout in seconds for every call to a server.'
              ' (dogpile.cache.memcache and oslo_cache.memcache_pool'
              ' backends only).'),
 cfg.IntOpt('memcache_pool_maxsize',
            default=10,
            help='Max total number of open connections to every'
            ' memcached server. (oslo_cache.memcache_pool backend'
            ' only).'),
 cfg.IntOpt('memcache_pool_unused_timeout',
            default=60,
            help='Number of seconds a connection to memcached is held'
            ' unused in the pool before it is closed.'
            ' (oslo_cache.memcache_pool backend only).'),
 cfg.IntOpt('memcache_pool_connection_get_timeout',
            default=10,
            help='Number of seconds that an operation will wait to get '
Exemplo n.º 8
0
    ``nova-service service_down_time``
""")

disk_allocation_ratio_opt = cfg.FloatOpt("disk_allocation_ratio",
                                         default=1.0,
                                         help="""
This is the virtual disk to physical disk allocation ratio used by the
disk_filter.py script to determine if a host has sufficient disk space to fit a
requested instance. A ratio greater than 1.0 will result in over-subscription
of the available physical disk, which can be useful for more efficiently
packing instances created with images that don't use the entire virtual disk,
such as sparse or compressed images. It can be set to a value between 0.0 and
1.0 in order to preserve a percentage of the disk for uses other than
instances.

This option is only used by the FilterScheduler and its subclasses; if you use
a different scheduler, this option has no effect.

* Services that use this:

    ``nova-scheduler``

* Related options:

    None
""")

isolated_img_opt = cfg.ListOpt("isolated_images",
                               default=[],
                               help="""
Exemplo n.º 9
0
from cinder.volume import volume_utils

LOG = logging.getLogger(__name__)

vzstorage_opts = [
    cfg.StrOpt('vzstorage_shares_config',
               default='/etc/cinder/vzstorage_shares',
               help='File with the list of available vzstorage shares.'),
    cfg.BoolOpt('vzstorage_sparsed_volumes',
                default=True,
                help=('Create volumes as sparsed files which take no space '
                      'rather than regular files when using raw format, '
                      'in which case volume creation takes lot of time.')),
    cfg.FloatOpt('vzstorage_used_ratio',
                 default=0.95,
                 help=('Percent of ACTUAL usage of the underlying volume '
                       'before no new volumes can be allocated to the volume '
                       'destination.')),
    cfg.StrOpt('vzstorage_mount_point_base',
               default='$state_path/mnt',
               help=('Base dir containing mount points for '
                     'vzstorage shares.')),
    cfg.ListOpt('vzstorage_mount_options',
                help=('Mount options passed to the vzstorage client. '
                      'See section of the pstorage-mount man page '
                      'for details.')),
    cfg.StrOpt('vzstorage_default_volume_format',
               default='raw',
               help=('Default format that will be used when creating volumes '
                     'if no volume format is specified.')),
]
Exemplo n.º 10
0
def register_volume():
    volume_opts = [
        cfg.IntOpt(
            'num_shell_tries',
            default=3,
            help='Number of times to attempt to run flakey shell commands'),
        cfg.IntOpt('reserved_percentage',
                   default=0,
                   min=0,
                   max=100,
                   help='The percentage of backend capacity is reserved'),
        cfg.StrOpt('iscsi_target_prefix',
                   default='iqn.2010-10.org.openstack:',
                   help='Prefix for iSCSI volumes'),
        cfg.StrOpt(
            'iscsi_ip_address',
            default='$my_ip',
            help='The IP address that the iSCSI daemon is listening on'),
        cfg.ListOpt(
            'iscsi_secondary_ip_addresses',
            default=[],
            help='The list of secondary IP addresses of the iSCSI daemon'),
        cfg.PortOpt('iscsi_port',
                    default=3260,
                    help='The port that the iSCSI daemon is listening on'),
        cfg.IntOpt('num_volume_device_scan_tries',
                   default=3,
                   help='The maximum number of times to rescan targets'
                   ' to find volume'),
        cfg.StrOpt('volume_backend_name',
                   help='The backend name for a given driver implementation'),
        cfg.BoolOpt(
            'use_multipath_for_image_xfer',
            default=False,
            help='Do we attach/detach volumes in cinder using multipath '
            'for volume to image and image to volume transfers?'),
        cfg.BoolOpt('enforce_multipath_for_image_xfer',
                    default=False,
                    help='If this is set to True, attachment of volumes for '
                    'image transfer will be aborted when multipathd is not '
                    'running. Otherwise, it will fallback to single path.'),
        cfg.StrOpt('volume_clear',
                   default='zero',
                   choices=['none', 'zero', 'shred'],
                   help='Method used to wipe old volumes'),
        cfg.IntOpt(
            'volume_clear_size',
            default=0,
            help='Size in MiB to wipe at start of old volumes. 0 => all'),
        cfg.StrOpt('volume_clear_ionice',
                   help='The flag to pass to ionice to alter the i/o priority '
                   'of the process used to zero a volume after deletion, '
                   'for example "-c3" for idle only priority.'),
        cfg.StrOpt(
            'iscsi_helper',
            default='tgtadm',
            choices=[
                'tgtadm', 'lioadm', 'scstadmin', 'iseradm', 'iscsictl',
                'ietadm', 'fake'
            ],
            help='iSCSI target user-land tool to use. tgtadm is default, '
            'use lioadm for LIO iSCSI support, scstadmin for SCST '
            'target support, iseradm for the ISER protocol, ietadm '
            'for iSCSI Enterprise Target, iscsictl for Chelsio iSCSI '
            'Target or fake for testing.'),
        cfg.StrOpt('volumes_dir',
                   default='$state_path/volumes',
                   help='Volume configuration file storage '
                   'directory'),
        cfg.StrOpt('iet_conf',
                   default='/etc/iet/ietd.conf',
                   help='IET configuration file'),
        cfg.StrOpt('chiscsi_conf',
                   default='/etc/chelsio-iscsi/chiscsi.conf',
                   help='Chiscsi (CXT) global defaults configuration file'),
        cfg.StrOpt('iscsi_iotype',
                   default='fileio',
                   choices=['blockio', 'fileio', 'auto'],
                   help=('Sets the behavior of the iSCSI target '
                         'to either perform blockio or fileio '
                         'optionally, auto can be set and Cinder '
                         'will autodetect type of backing device')),
        cfg.StrOpt('volume_dd_blocksize',
                   default='1M',
                   help='The default block size used when copying/clearing '
                   'volumes'),
        cfg.StrOpt('volume_copy_blkio_cgroup_name',
                   default='cinder-volume-copy',
                   help='The blkio cgroup name to be used to limit bandwidth '
                   'of volume copy'),
        cfg.IntOpt('volume_copy_bps_limit',
                   default=0,
                   help='The upper limit of bandwidth of volume copy. '
                   '0 => unlimited'),
        cfg.StrOpt('iscsi_write_cache',
                   default='on',
                   choices=['on', 'off'],
                   help='Sets the behavior of the iSCSI target to either '
                   'perform write-back(on) or write-through(off). '
                   'This parameter is valid if iscsi_helper is set '
                   'to tgtadm or iseradm.'),
        cfg.StrOpt('iscsi_target_flags',
                   default='',
                   help='Sets the target-specific flags for the iSCSI target. '
                   'Only used for tgtadm to specify backing device flags '
                   'using bsoflags option. The specified string is passed '
                   'as is to the underlying tool.'),
        cfg.StrOpt('iscsi_protocol',
                   default='iscsi',
                   choices=['iscsi', 'iser'],
                   help='Determines the iSCSI protocol for new iSCSI volumes, '
                   'created with tgtadm or lioadm target helpers. In '
                   'order to enable RDMA, this parameter should be set '
                   'with the value "iser". The supported iSCSI protocol '
                   'values are "iscsi" and "iser".'),
        cfg.StrOpt(
            'driver_client_cert_key',
            help='The path to the client certificate key for verification, '
            'if the driver supports it.'),
        cfg.StrOpt('driver_client_cert',
                   help='The path to the client certificate for verification, '
                   'if the driver supports it.'),
        cfg.BoolOpt('driver_use_ssl',
                    default=False,
                    help='Tell driver to use SSL for connection to backend '
                    'storage if the driver supports it.'),
        cfg.FloatOpt(
            'max_over_subscription_ratio',
            default=3.0,
            help='Float representation of the over subscription ratio '
            'when thin provisioning is involved. Default ratio is '
            '3.0, meaning provisioned capacity can be 3 times of '
            'the total physical capacity. If the ratio is 10.5, it '
            'means provisioned capacity can be 10.5 times of the '
            'total physical capacity. A ratio of 1.0 means '
            'provisioned capacity cannot exceed the total physical '
            'capacity. The ratio has to be a minimum of 1.0.'),
        cfg.StrOpt('scst_target_iqn_name',
                   help='Certain ISCSI targets have predefined target names, '
                   'SCST target driver uses this name.'),
        cfg.StrOpt('scst_target_driver',
                   default='iscsi',
                   help='SCST target implementation can choose from multiple '
                   'SCST target drivers.'),
        cfg.BoolOpt('use_chap_auth',
                    default=False,
                    help='Option to enable/disable CHAP authentication for '
                    'targets.',
                    deprecated_opts=deprecated_use_chap_auth_opts),
        cfg.StrOpt('chap_username',
                   default='',
                   help='CHAP user name.',
                   deprecated_opts=deprecated_chap_username_opts),
        cfg.StrOpt('chap_password',
                   default='',
                   help='Password for specified CHAP account name.',
                   deprecated_opts=deprecated_chap_password_opts,
                   secret=True),
        cfg.StrOpt('driver_data_namespace',
                   help='Namespace for driver private data values to be '
                   'saved in.'),
        cfg.StrOpt('filter_function',
                   help='String representation for an equation that will be '
                   'used to filter hosts. Only used when the driver '
                   'filter is set to be used by the Cinder scheduler.'),
        cfg.StrOpt('goodness_function',
                   help='String representation for an equation that will be '
                   'used to determine the goodness of a host. Only used '
                   'when using the goodness weigher is set to be used by '
                   'the Cinder scheduler.'),
        cfg.BoolOpt(
            'driver_ssl_cert_verify',
            default=False,
            help='If set to True the http client will validate the SSL '
            'certificate of the backend endpoint.'),
        cfg.StrOpt('driver_ssl_cert_path',
                   help='Can be used to specify a non default path to a '
                   'CA_BUNDLE file or directory with certificates of '
                   'trusted CAs, which will be used to validate the backend'),
        cfg.ListOpt('trace_flags',
                    help='List of options that control which trace info '
                    'is written to the DEBUG log level to assist '
                    'developers. Valid values are method and api.'),
        cfg.MultiOpt(
            'replication_device',
            item_type=types.Dict(),
            secret=True,
            help="Multi opt of dictionaries to represent a replication "
            "target device.  This option may be specified multiple "
            "times in a single config section to specify multiple "
            "replication target devices.  Each entry takes the "
            "standard dict config form: replication_device = "
            "target_device_id:<required>,"
            "key1:value1,key2:value2..."),
        cfg.BoolOpt('image_upload_use_cinder_backend',
                    default=False,
                    help='If set to True, upload-to-image in raw format will '
                    'create a cloned volume and register its location to '
                    'the image service, instead of uploading the volume '
                    'content. The cinder backend and locations support '
                    'must be enabled in the image service, and '
                    'glance_api_version must be set to 2.'),
        cfg.BoolOpt('image_upload_use_internal_tenant',
                    default=False,
                    help='If set to True, the image volume created by '
                    'upload-to-image will be placed in the internal tenant. '
                    'Otherwise, the image volume is created in the current '
                    'context\'s tenant.'),
        cfg.BoolOpt('image_volume_cache_enabled',
                    default=False,
                    help='Enable the image volume cache for this backend.'),
        cfg.IntOpt(
            'image_volume_cache_max_size_gb',
            default=0,
            help='Max size of the image volume cache for this backend in '
            'GB. 0 => unlimited.'),
        cfg.IntOpt(
            'image_volume_cache_max_count',
            default=0,
            help='Max number of entries allowed in the image volume cache. '
            '0 => unlimited.'),
        cfg.BoolOpt(
            'report_discard_supported',
            default=False,
            help='Report to clients of Cinder that the backend supports '
            'discard (aka. trim/unmap). This will not actually '
            'change the behavior of the backend or the client '
            'directly, it will only notify that it can be used.'),
    ]

    # _option_group = 'oslo_reports'
    # conf.register_opts(_options, group=_option_group)
    CONF.register_opts(volume_opts, group="normal")
 cfg.StrOpt('kombu_ssl_keyfile',
            default='',
            deprecated_group='DEFAULT',
            help='SSL key file (valid only if SSL enabled).'),
 cfg.StrOpt('kombu_ssl_certfile',
            default='',
            deprecated_group='DEFAULT',
            help='SSL cert file (valid only if SSL enabled).'),
 cfg.StrOpt('kombu_ssl_ca_certs',
            default='',
            deprecated_group='DEFAULT',
            help='SSL certification authority file '
            '(valid only if SSL enabled).'),
 cfg.FloatOpt('kombu_reconnect_delay',
              default=1.0,
              deprecated_group='DEFAULT',
              help='How long to wait before reconnecting in response to an '
              'AMQP consumer cancel notification.'),
 cfg.IntOpt('kombu_missing_consumer_retry_timeout',
            deprecated_name="kombu_reconnect_timeout",
            default=60,
            help='How long to wait a missing client beforce abandoning to '
            'send it its replies. This value should not be longer '
            'than rpc_response_timeout.'),
 cfg.StrOpt('kombu_failover_strategy',
            choices=('round-robin', 'shuffle'),
            default='round-robin',
            help='Determines how the next RabbitMQ node is chosen in case '
            'the one we are currently connected to becomes '
            'unavailable. Takes effect only if more than one '
            'RabbitMQ node is provided in config.'),
Exemplo n.º 12
0
allocation_ratio_opts = [
    cfg.FloatOpt('cpu_allocation_ratio',
        default=None,
        min=0.0,
        help="""
This option helps you specify virtual CPU to physical CPU allocation ratio.

From Ocata (15.0.0) this is used to influence the hosts selected by
the Placement API. Note that when Placement is used, the CoreFilter
is redundant, because the Placement API will have already filtered
out hosts that would have failed the CoreFilter.

This configuration specifies ratio for CoreFilter which can be set
per compute node. For AggregateCoreFilter, it will fall back to this
configuration value if no per-aggregate setting is found.

NOTE: If this option is set to something *other than* ``None`` or ``0.0``, the
allocation ratio will be overwritten by the value of this option, otherwise,
the allocation ratio will not change. Once set to a non-default value, it is
not possible to "unset" the config to get back to the default behavior. If you
want to reset back to the initial value, explicitly specify it to the value of
``initial_cpu_allocation_ratio``.

Possible values:

* Any valid positive integer or float value

Related options:

* ``initial_cpu_allocation_ratio``
"""),
    cfg.FloatOpt('ram_allocation_ratio',
Exemplo n.º 13
0
 def __init__(self, config):
     super(GlobalOptions, self).__init__(config, group="DEFAULT")
     self._options = [
         cfg.BoolOpt('allow_reboot',
                     default=True,
                     help='Allows OS reboots requested by plugins'),
         cfg.BoolOpt(
             'stop_service_on_exit',
             default=True,
             help='In case of execution as a service, specifies if the '
             'service must be gracefully stopped before exiting'),
         cfg.BoolOpt(
             'check_latest_version',
             default=True,
             help='Check if there is a newer version of cloudbase-init '
             'available.  If this option is activated, a log '
             'message  will be  emitted if there is a newer version '
             'available.'),
         cfg.IntOpt('retry_count',
                    default=5,
                    help='Max. number of attempts for fetching metadata in '
                    'case of transient errors'),
         cfg.FloatOpt(
             'retry_count_interval',
             default=4,
             help='Interval between attempts in case of transient errors, '
             'expressed in seconds'),
         cfg.StrOpt(
             'mtools_path',
             default=None,
             help='Path to "mtools" program suite, used for interacting '
             'with VFAT filesystems'),
         cfg.StrOpt(
             'bsdtar_path',
             default='bsdtar.exe',
             help='Path to "bsdtar", used to extract ISO ConfigDrive '
             'files'),
         cfg.BoolOpt(
             'netbios_host_name_compatibility',
             default=True,
             help='Truncates the hostname to 15 characters for Netbios '
             'compatibility'),
         cfg.StrOpt('logging_serial_port_settings',
                    default=None,
                    help='Serial port logging settings. Format: '
                    '"port,baudrate,parity,bytesize", e.g.: '
                    '"COM1,115200,N,8". Set to None (default) to disable.'),
         cfg.BoolOpt('activate_windows',
                     default=False,
                     help='Activates Windows automatically'),
         cfg.BoolOpt('winrm_enable_basic_auth',
                     default=True,
                     help='Enables basic authentication for the WinRM '
                     'HTTPS listener'),
         cfg.ListOpt(
             'volumes_to_extend',
             default=None,
             help='List of volumes that need to be extended '
             'if contiguous space is available on the disk. '
             'By default all the available volumes can be extended. '
             'Volumes must be specified using a comma separated list '
             'of volume indexes, e.g.: "1,2"'),
         cfg.StrOpt(
             'local_scripts_path',
             default=None,
             help='Path location containing scripts to be executed when '
             'the plugin runs'),
         cfg.BoolOpt(
             'mtu_use_dhcp_config',
             default=True,
             help='Configures the network interfaces MTU based on the '
             'values provided via DHCP'),
         cfg.StrOpt('username',
                    default='Admin',
                    help='User to be added to the '
                    'system or updated if already existing'),
         cfg.ListOpt(
             'groups',
             default=['Administrators'],
             help='List of local groups to which the user specified in '
             '"username" will be added'),
         cfg.StrOpt(
             'heat_config_dir',
             default='C:\\cfn',
             help='The directory where the Heat configuration files must '
             'be saved'),
         cfg.BoolOpt(
             'ntp_use_dhcp_config',
             default=False,
             help='Configures NTP client time synchronization using '
             'the NTP servers provided via DHCP'),
         cfg.BoolOpt('inject_user_password',
                     default=True,
                     help='Set the password provided in the configuration. '
                     'If False or no password is provided, a random one '
                     'will be set'),
         cfg.StrOpt(
             'first_logon_behaviour',
             default=constant.CLEAR_TEXT_INJECTED_ONLY,
             choices=constant.LOGON_PASSWORD_CHANGE_OPTIONS,
             help='Control the behaviour of what happens at '
             'next logon. If this option is set to `always`, '
             'then the user will be forced to change the password '
             'at next logon. If it is set to '
             '`clear_text_injected_only`, '
             'then the user will have to change the password only if '
             'the password is a clear text password, coming from the '
             'metadata. The last option is `no`, when the user is '
             'never forced to change the password.'),
         cfg.BoolOpt(
             'reset_service_password',
             default=True,
             help='If set to True, the service user password will be '
             'reset at each execution with a new random value of '
             'appropriate length and complexity, unless the user is '
             'a built-in or domain account.'
             'This is needed to avoid "pass the hash" attacks on '
             'Windows cloned instances.'),
         cfg.ListOpt(
             'metadata_services',
             default=[
                 'cloudbaseinit.metadata.services.httpservice.HttpService',
                 'cloudbaseinit.metadata.services'
                 '.configdrive.ConfigDriveService',
                 'cloudbaseinit.metadata.services.ec2service.EC2Service',
                 'cloudbaseinit.metadata.services'
                 '.maasservice.MaaSHttpService',
                 'cloudbaseinit.metadata.services.cloudstack.CloudStack',
                 'cloudbaseinit.metadata.services'
                 '.opennebulaservice.OpenNebulaService',
             ],
             help='List of enabled metadata service classes, '
             'to be tested for availability in the provided order. '
             'The first available service will be used to retrieve '
             'metadata'),
         cfg.ListOpt(
             'plugins',
             default=[
                 'cloudbaseinit.plugins.common.mtu.MTUPlugin',
                 'cloudbaseinit.plugins.windows.ntpclient'
                 '.NTPClientPlugin',
                 'cloudbaseinit.plugins.common.sethostname'
                 '.SetHostNamePlugin',
                 'cloudbaseinit.plugins.windows.createuser'
                 '.CreateUserPlugin',
                 'cloudbaseinit.plugins.common.networkconfig'
                 '.NetworkConfigPlugin',
                 'cloudbaseinit.plugins.windows.licensing'
                 '.WindowsLicensingPlugin',
                 'cloudbaseinit.plugins.common.sshpublickeys'
                 '.SetUserSSHPublicKeysPlugin',
                 'cloudbaseinit.plugins.windows.extendvolumes'
                 '.ExtendVolumesPlugin',
                 'cloudbaseinit.plugins.common.userdata.UserDataPlugin',
                 'cloudbaseinit.plugins.common.setuserpassword.'
                 'SetUserPasswordPlugin',
                 'cloudbaseinit.plugins.windows.winrmlistener.'
                 'ConfigWinRMListenerPlugin',
                 'cloudbaseinit.plugins.windows.winrmcertificateauth.'
                 'ConfigWinRMCertificateAuthPlugin',
                 'cloudbaseinit.plugins.common.localscripts'
                 '.LocalScriptsPlugin',
             ],
             help='List of enabled plugin classes, '
             'to be executed in the provided order'),
         cfg.ListOpt(
             'user_data_plugins',
             default=[
                 'cloudbaseinit.plugins.common.userdataplugins.parthandler.'
                 'PartHandlerPlugin',
                 'cloudbaseinit.plugins.common.userdataplugins.cloudconfig.'
                 'CloudConfigPlugin',
                 'cloudbaseinit.plugins.common.userdataplugins'
                 '.cloudboothook.CloudBootHookPlugin',
                 'cloudbaseinit.plugins.common.userdataplugins.shellscript.'
                 'ShellScriptPlugin',
                 'cloudbaseinit.plugins.common.userdataplugins'
                 '.multipartmixed.MultipartMixedPlugin',
                 'cloudbaseinit.plugins.common.userdataplugins.heat.'
                 'HeatPlugin',
             ],
             help='List of enabled userdata content plugins'),
         cfg.ListOpt(
             'cloud_config_plugins',
             default=[],
             help='List which contains the name of the cloud config '
             'plugins ordered by priority.'),
     ]
Exemplo n.º 14
0
VERSION = '1.3.0'

LOG = logging.getLogger(__name__)

nfs_opts = [
    cfg.StrOpt('nfs_shares_config',
               default='/etc/cinder/nfs_shares',
               help='File with the list of available nfs shares'),
    cfg.BoolOpt('nfs_sparsed_volumes',
                default=True,
                help=('Create volumes as sparsed files which take no space.'
                      'If set to False volume is created as regular file.'
                      'In such case volume creation takes a lot of time.')),
    cfg.FloatOpt('nfs_used_ratio',
                 default=0.95,
                 help=('Percent of ACTUAL usage of the underlying volume '
                       'before no new volumes can be allocated to the volume '
                       'destination.')),
    cfg.FloatOpt('nfs_oversub_ratio',
                 default=1.0,
                 help=('This will compare the allocated to available space on '
                       'the volume destination.  If the ratio exceeds this '
                       'number, the destination will no longer be valid.')),
    cfg.StrOpt('nfs_mount_point_base',
               default='$state_path/mnt',
               help=('Base dir containing mount points for nfs shares.')),
    cfg.StrOpt('nfs_mount_options',
               default=None,
               help=('Mount options passed to the nfs client. See section '
                     'of the nfs man page for details.')),
    cfg.IntOpt('nfs_mount_attempts',
Exemplo n.º 15
0
from manila.common import constants
from manila import exception
from manila.i18n import _
from manila.share import configuration
from manila.share import driver
from manila.share.manager import share_manager_opts  # noqa
from manila.share import utils as share_utils

LOG = log.getLogger(__name__)

dummy_opts = [
    cfg.FloatOpt(
        "dummy_driver_default_driver_method_delay",
        help="Defines default time delay in seconds for each dummy driver "
        "method. To redefine some specific method delay use other "
        "'dummy_driver_driver_methods_delays' config opt. Optional.",
        default=2.0,
        min=0,
    ),
    cfg.DictOpt(
        "dummy_driver_driver_methods_delays",
        help="It is dictionary-like config option, that consists of "
        "driver method names as keys and integer/float values that are "
        "time delay in seconds. Optional.",
        default={
            "ensure_share": "1.05",
            "create_share": "3.98",
            "get_pool": "0.5",
            "do_setup": "0.05",
            "_get_pools_info": "0.1",
            "_update_share_stats": "0.3",
Exemplo n.º 16
0
The default behavior is to place new volume to the host allocated the least
space.  This weigher is intended to simulate the behavior of SimpleScheduler.
If you prefer to place volumes to host allocated the most space, you can
set the 'allocated_capacity_weight_multiplier' option to a positive number
and the weighing has the opposite effect of the default.
"""

import math

from oslo_config import cfg

from cinder.scheduler import weights

capacity_weight_opts = [
    cfg.FloatOpt('capacity_weight_multiplier',
                 default=1.0,
                 help='Multiplier used for weighing volume capacity. '
                 'Negative numbers mean to stack vs spread.'),
    cfg.FloatOpt('allocated_capacity_weight_multiplier',
                 default=-1.0,
                 help='Multiplier used for weighing volume capacity. '
                 'Negative numbers mean to stack vs spread.'),
]

CONF = cfg.CONF
CONF.register_opts(capacity_weight_opts)

OFFSET_MIN = 10000
OFFSET_MULT = 100


class CapacityWeigher(weights.BaseHostWeigher):
Exemplo n.º 17
0
 cfg.PortOpt('bind_port', default=9443, help=_("The port to bind to")),
 cfg.StrOpt('lb_network_interface',
            default='o-hm0',
            help=_('Network interface through which to reach amphora, only '
                   'required if using IPv6 link local addresses.')),
 cfg.StrOpt('haproxy_cmd',
            default='/usr/sbin/haproxy',
            help=_("The full path to haproxy")),
 cfg.IntOpt('respawn_count',
            default=2,
            help=_("The respawn count for haproxy's upstart script")),
 cfg.IntOpt('respawn_interval',
            default=2,
            help=_("The respawn interval for haproxy's upstart script")),
 cfg.FloatOpt('rest_request_conn_timeout',
              default=10,
              help=_("The time in seconds to wait for a REST API "
                     "to connect.")),
 cfg.FloatOpt('rest_request_read_timeout',
              default=60,
              help=_("The time in seconds to wait for a REST API "
                     "response.")),
 cfg.IntOpt('timeout_client_data',
            default=constants.DEFAULT_TIMEOUT_CLIENT_DATA,
            help=_('Frontend client inactivity timeout.')),
 cfg.IntOpt('timeout_member_connect',
            default=constants.DEFAULT_TIMEOUT_MEMBER_CONNECT,
            help=_('Backend member connection timeout.')),
 cfg.IntOpt('timeout_member_data',
            default=constants.DEFAULT_TIMEOUT_MEMBER_DATA,
            help=_('Backend member inactivity timeout.')),
 cfg.IntOpt('timeout_tcp_inspect',
Exemplo n.º 18
0
from designate.i18n import _LE


LOG = log.getLogger(__name__)

coordination_group = cfg.OptGroup(
    name='coordination', title="Configuration for coordination"
)

coordination_opts = [
    cfg.StrOpt('backend_url',
               help='The backend URL to use for distributed coordination. If '
                    'unset services that need coordination will function as '
                    'a standalone service.'),
    cfg.FloatOpt('heartbeat_interval',
                 default=1.0,
                 help='Number of seconds between heartbeats for distributed '
                      'coordination.'),
    cfg.FloatOpt('run_watchers_interval',
                 default=10.0,
                 help='Number of seconds between checks to see if group '
                      'membership has changed')

]
cfg.CONF.register_group(coordination_group)
cfg.CONF.register_opts(coordination_opts, group=coordination_group)

CONF = cfg.CONF


def _retry_if_tooz_error(exception):
    """Return True if we should retry, False otherwise"""
Exemplo n.º 19
0
    cfg.StrOpt('port', default=None, help=('Default SSH port')),
    cfg.StrOpt('username', default=None, help=('Default SSH username')),
    cfg.ListOpt('config_files',
                default=['/etc/ssh/ssh_config', '~/.ssh/config'],
                help="Default user SSH configuration files"),
    cfg.StrOpt('key_file',
               default='~/.ssh/id_rsa',
               help="Default SSH private key file"),
    cfg.BoolOpt('allow_agent',
                default=False,
                help=("Set to False to disable connecting to the "
                      "SSH agent")),
    cfg.BoolOpt('compress',
                default=False,
                help="Set to True to turn on compression"),
    cfg.FloatOpt('timeout', default=10.,
                 help="SSH connect timeout in seconds"),
    cfg.IntOpt('connection_attempts',
               default=60,
               help=("Maximum number of connection attempts to be tried "
                     "before timeout")),
    cfg.FloatOpt('connection_interval',
                 default=10.,
                 help=("Minimal seconds to wait between every "
                       "failed SSH connection attempt")),
    cfg.StrOpt('proxy_jump', default=None, help="Default SSH proxy server"),
    cfg.StrOpt('proxy_command', default=None, help="Default proxy command"),
]


def register_tobiko_options(conf):
    conf.register_opts(group=cfg.OptGroup(GROUP_NAME), opts=OPTIONS)
Exemplo n.º 20
0
Arquivo: ldap.py Projeto: Boye-Z/123
The size of the LDAP connection pool. This option has no effect unless `[ldap]
use_pool` is also enabled.
"""))

pool_retry_max = cfg.IntOpt('pool_retry_max',
                            default=3,
                            min=0,
                            help=utils.fmt("""
The maximum number of times to attempt reconnecting to the LDAP server before
aborting. A value of zero prevents retries. This option has no effect unless
`[ldap] use_pool` is also enabled.
"""))

pool_retry_delay = cfg.FloatOpt('pool_retry_delay',
                                default=0.1,
                                help=utils.fmt("""
The number of seconds to wait before attempting to reconnect to the LDAP
server. This option has no effect unless `[ldap] use_pool` is also enabled.
"""))

pool_connection_timeout = cfg.IntOpt('pool_connection_timeout',
                                     default=-1,
                                     min=-1,
                                     help=utils.fmt("""
The connection timeout to use when pooling LDAP connections. A value of `-1`
means that connections will never timeout. This option has no effect unless
`[ldap] use_pool` is also enabled.
"""))

pool_connection_lifetime = cfg.IntOpt('pool_connection_lifetime',
                                      default=600,
                                      min=1,
Exemplo n.º 21
0
from rally.common import sshutils
from rally.plugins.openstack.scenarios.cinder import utils as cinder_utils
from rally.plugins.openstack.scenarios.nova import utils as nova_utils
from rally.plugins.openstack.wrappers import network as network_wrapper
from rally.task import atomic
from rally.task import utils
from rally.task import validation

LOG = logging.getLogger(__name__)

ICMP_UP_STATUS = "ICMP UP"
ICMP_DOWN_STATUS = "ICMP DOWN"

VM_BENCHMARK_OPTS = [
    cfg.FloatOpt("vm_ping_poll_interval",
                 default=1.0,
                 help="Interval between checks when waiting for a VM to "
                 "become pingable"),
    cfg.FloatOpt("vm_ping_timeout",
                 default=120.0,
                 help="Time to wait for a VM to become pingable")
]

CONF = cfg.CONF
benchmark_group = cfg.OptGroup(name="benchmark", title="benchmark options")
CONF.register_opts(VM_BENCHMARK_OPTS, group=benchmark_group)


class VMScenario(nova_utils.NovaScenario, cinder_utils.CinderScenario):
    """Base class for VM scenarios with basic atomic actions.

    VM scenarios are scenarios executed inside some launched VM instance.
Exemplo n.º 22
0
cli_opts = [
    cfg.StrOpt('pipe-handle',
               help='This argument is used internally on Windows. Glance '
               'passes a pipe handle to child processes, which is then '
               'used for inter-process communication.'),
]

cache_opts = [
    cfg.FloatOpt('cache_prefetcher_interval',
                 default=300,
                 help=_("""
The interval in seconds to run periodic job cache_images.

The cache_images method will fetch all images which are in queued state
for caching in cache directory. The default value is 300.

Possible values:
    * Positive integer

Related options:
    * None
"""))
]

LOG = logging.getLogger(__name__)

CONF = cfg.CONF
CONF.register_opts(bind_opts)
CONF.register_opts(socket_opts)
CONF.register_opts(eventlet_opts)
CONF.register_opts(wsgi_opts)
Exemplo n.º 23
0
# 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 oslo_config import cfg

HEARTBEAT_GROUP = cfg.OptGroup(name='heartbeat_emitter',
                               title="Configuration for heartbeat_emitter")

HEARTBEAT_OPTS = [
    cfg.FloatOpt('heartbeat_interval',
                 default=10.0,
                 help='Number of seconds between heartbeats for reporting '
                 'state'),
    cfg.StrOpt('emitter_type', default="rpc", help="Emitter to use"),
]


def register_opts(conf):
    conf.register_group(HEARTBEAT_GROUP)
    conf.register_opts(HEARTBEAT_OPTS, group=HEARTBEAT_GROUP)


def list_opts():
    return {HEARTBEAT_GROUP: HEARTBEAT_OPTS}
Exemplo n.º 24
0
from aim.common import utils
from aim.db import config_model
from aim import exceptions as exc

LOG = logging.getLogger(__name__)

agent_opts = [
    cfg.IntOpt('agent_down_time',
               default=120,
               help=("Seconds to regard the agent is down; should be at "
                     "least twice agent_report_interval.")),
    cfg.FloatOpt('agent_polling_interval',
                 default=0,
                 help=("Seconds that need to pass before the agent starts "
                       "each new cycle. This doesn't represent how often AID "
                       "will reconcile state, as that depends on external "
                       "events. This option only tells AID how much it has "
                       "to wait before checking the Event queues after a "
                       "reconciliation happened.")),
    cfg.FloatOpt('agent_event_squash_time',
                 default=0.1,
                 help=("Seconds or fractions of them that AID will wait after "
                       "an event is received before starting the "
                       "reconciliation. This will squash similar events "
                       "together")),
    cfg.IntOpt('agent_report_interval',
               default=60,
               help=("Number of seconds after which an agent reports his "
                     "state")),
    cfg.IntOpt('agent_deadlock_time',
               default=300,
Exemplo n.º 25
0
class JaccardCorrelationTest(base.BaseTest):
    OPTS = [
        cfg.StrOpt('output_folder',
                   default='/tmp',
                   help='folder to write all reports to'),
        cfg.FloatOpt('correlation_threshold',
                     default=0,
                     help='threshold of interesting correlations'),
        cfg.FloatOpt('high_corr_score',
                     default=0.9,
                     help='high correlation lower limit'),
        cfg.FloatOpt('med_corr_score',
                     default=0.5,
                     help='medium correlation lower limit'),
    ]

    # noinspection PyPep8Naming
    @classmethod
    def setUpClass(cls):
        super(JaccardCorrelationTest, cls).setUpClass()

        cls.conf = cfg.ConfigOpts()
        cls.conf.register_opts(cls.OPTS, group='jaccard_correlation')

        cls.data_manager = ADAccumulator(AData({}, {}))
        cls.collection = \
            CCollection(cls.conf.jaccard_correlation.high_corr_score,
                        cls.conf.jaccard_correlation.med_corr_score)
        cls.correlation_manager = CManager(cls.conf)
        cls.activate_timestamps = {}
        cls.inactivate_timestamps = {}
        cls.alarm_ids = cls._setup_expected_active_alarms_ids()

    @staticmethod
    def _setup_expected_active_alarms_ids():
        alarm_ids = []
        for alarm in ACTIVE_ALARMS:
            alarm_name = alarm[VProps.RAWTEXT] if alarm.get(VProps.RAWTEXT) \
                else alarm[VProps.NAME]
            alarm_id = AlarmID(alarm.get(VProps.VITRAGE_RESOURCE_ID),
                               alarm.get(VProps.VITRAGE_RESOURCE_TYPE),
                               alarm_name)
            alarm_ids.append(alarm_id)

        return alarm_ids

    def test_jaccard_correlation(self):
        self._test_alarm_data_accumulations()
        self._test_correlation_collection()
        self._test_correlation_manager()

    def _test_alarm_data_accumulations(self):
        self._test_append_active()
        self._test_flush_accumulations()
        self._test_append_inactive()

    def _test_append_active(self):

        expected_active_start_dict = {}
        real_alarm_ids = []

        for alarm in ACTIVE_ALARMS:

            alarm_name = alarm[VProps.RAWTEXT] if alarm.get(VProps.RAWTEXT) \
                else alarm[VProps.NAME]

            alarm_id, timestamp = ADProcessor.\
                _get_alarm_id_and_timestamp(alarm, alarm_name)

            self.activate_timestamps[alarm_id] = timestamp
            expected_active_start_dict[alarm_id] = \
                datetime.datetime.strptime(alarm.get(VProps.UPDATE_TIMESTAMP),
                                           TIMESTAMP_FORMAT)

            real_alarm_ids.append(alarm_id)
            self.data_manager.append_active(alarm_id, timestamp)

        # assert all alarm ids are right
        for i in range(len(self.alarm_ids)):
            self.assertEqual(self.alarm_ids[i], real_alarm_ids[i], '')

        self.assertEqual(expected_active_start_dict,
                         self.data_manager.active_start_times)

        self.assertEqual({}, self.data_manager.alarms_activity)
        self.assertEqual({}, self.data_manager.alarms_intersects)

    def _test_flush_accumulations(self):

        prev_active_start_dict = self.data_manager.active_start_times

        time.sleep(2)
        self.data_manager.flush_accumulations()

        self.assertEqual(prev_active_start_dict,
                         self.data_manager.active_start_times)

        expected_activity_dict_len = len(ACTIVE_ALARMS)
        self.assertThat(self.data_manager.alarms_activity,
                        matchers.HasLength(expected_activity_dict_len))

        # choose 2
        expected_intersections_dict_len = \
            (len(ACTIVE_ALARMS) * (len(ACTIVE_ALARMS) - 1)) / 2
        self.assertThat(self.data_manager.alarms_intersects,
                        matchers.HasLength(expected_intersections_dict_len))

    def _test_append_inactive(self):
        deleted_alarm_ids = []

        for alarm in INACTIVE_ALARMS:
            alarm_name = alarm[VProps.RAWTEXT] if alarm.get(VProps.RAWTEXT) \
                else alarm[VProps.NAME]

            alarm_id, timestamp = ADProcessor.\
                _get_alarm_id_and_timestamp(alarm, alarm_name)

            expected_alarm_id = \
                AlarmID(alarm.get(VProps.VITRAGE_RESOURCE_ID),
                        alarm.get(VProps.VITRAGE_RESOURCE_TYPE),
                        alarm_name)

            self.assertEqual(expected_alarm_id, alarm_id, '')

            self.inactivate_timestamps[alarm_id] = timestamp
            deleted_alarm_ids.append(alarm_id)

            self.data_manager.append_inactive(alarm_id, timestamp)

        # assert all deleted alarms has same alarm ids as activated alarms
        self.assertEqual(self.alarm_ids, deleted_alarm_ids)

        # all alarm are inactive at this moment
        expected_active_start_dict = {}
        self.assertEqual(expected_active_start_dict,
                         self.data_manager.active_start_times)

        expected_activity_dict = {}

        for alarm_id in self.alarm_ids:
            expected_activity_dict[alarm_id] = \
                self.inactivate_timestamps[alarm_id]\
                - self.activate_timestamps[alarm_id]

        self.assertEqual(expected_activity_dict,
                         self.data_manager.alarms_activity)

        expected_intersections_dict = {}

        # all alarms started and ended at the same time,
        # intersection time equals activity time
        for alarm_id1 in self.alarm_ids:
            for alarm_id2 in self.alarm_ids:
                # exclude intersection of alarm with itself
                if alarm_id1 != alarm_id2:
                    key = frozenset([alarm_id1, alarm_id2])
                    expected_intersections_dict[key] = \
                        self.inactivate_timestamps[alarm_id]\
                        - self.activate_timestamps[alarm_id]

        self.assertEqual(expected_intersections_dict,
                         self.data_manager.alarms_intersects)

    def _test_correlation_collection(self):
        self._test_correlation_list()
        self._test_correlations_aggregation()
        self.collection = CCollection(0.9, 0.5)

    def _test_correlation_list(self):
        offset_delta = 0
        high_correlation = 0.9
        med_correlation = 0.7
        low_correlation = 0.4

        correlations = [high_correlation, med_correlation, low_correlation]
        alarms_pairs = []
        cnt = 0

        seen_pairs = []

        for alarm1 in self.alarm_ids:
            for alarm2 in self.alarm_ids:
                if alarm1 != alarm2 \
                        and frozenset([alarm1, alarm2]) not in seen_pairs:
                    seen_pairs.append(frozenset([alarm1, alarm2]))
                    correlation = correlations[cnt % 3]
                    alarms_pairs.append(
                        (alarm1 + alarm2 + (offset_delta, correlation)))

                    self.collection.set(alarm1, alarm2, offset_delta,
                                        correlation)
                    cnt += 1

        self.assertEqual(alarms_pairs, self.collection.correlation_list)

    def _test_correlations_aggregation(self):

        aggregated = self.collection.get_aggregated()
        cnt_high_correlations = 0
        cnt_med_correlations = 0
        cnt_low_correlations = 0

        for correlation_level in aggregated:
            if correlation_level[0] == CPriorities.HIGH:
                cnt_high_correlations = len(correlation_level[1])
            if correlation_level[0] == CPriorities.MEDIUM:
                cnt_med_correlations = len(correlation_level[1])
            if correlation_level[0] == CPriorities.LOW:
                cnt_low_correlations = len(correlation_level[1])

        self.assertEqual(cnt_high_correlations, 2, '')
        self.assertEqual(cnt_med_correlations, 2, '')
        self.assertEqual(cnt_low_correlations, 2, '')

    def _test_correlation_manager(self):
        report = []
        self._test_generate_report(report)
        self._test_dump_correlations(report)

    def _test_generate_report(self, report):
        self.data_manager.flush_accumulations()
        report.extend(
            self.correlation_manager._generate_report(self.data_manager))

        # all intersects correlations are 1
        self.assertEqual(CPriorities.HIGH, report[0][0])
        self.assertEqual(len(self.data_manager.alarms_intersects),
                         len(report[0][1]))

    def _test_dump_correlations(self, report):
        now = int(time.time())

        self.correlation_manager.\
            _dump_correlations(str(now) + "_correlations_test.out",
                               report)

        file_path = self.conf.jaccard_correlation.output_folder + '/' + \
            str(now) + "_correlations_test.out"
        is_file = os.path.isfile(file_path)

        self.assertTrue(is_file)

        if os.path.isfile(file_path):
            os.remove(file_path)
Exemplo n.º 26
0
import time

from rally.common import logging
from rally import exceptions
from rally.task import utils

from glanceclient import exc as glance_exc
from oslo_config import cfg
import requests
import six

LOG = logging.getLogger(__name__)

GLANCE_BENCHMARK_OPTS = [
    cfg.FloatOpt("glance_image_create_prepoll_delay",
                 default=2.0,
                 help="Time to sleep after creating a resource before "
                 "polling for it status"),
    cfg.FloatOpt("glance_image_create_timeout",
                 default=120.0,
                 help="Time to wait for glance image to be created."),
    cfg.FloatOpt("glance_image_create_poll_interval",
                 default=1.0,
                 help="Interval between checks when waiting for image "
                 "creation."),
    cfg.FloatOpt("glance_image_delete_timeout",
                 default=120.0,
                 help="Time to wait for glance image to be deleted."),
    cfg.FloatOpt("glance_image_delete_poll_interval",
                 default=1.0,
                 help="Interval between checks when waiting for image "
                 "deletion.")
Exemplo n.º 27
0
    cfg.StrOpt('lvm_type',
               default='auto',
               choices=['default', 'thin', 'auto'],
               help='Type of LVM volumes to deploy; (default, thin, or auto). '
                    'Auto defaults to thin if thin is supported.'),
    cfg.StrOpt('lvm_conf_file',
               default='/etc/cinder/lvm.conf',
               help='LVM conf file to use for the LVM driver in Cinder; '
                    'this setting is ignored if the specified file does '
                    'not exist (You can also specify \'None\' to not use '
                    'a conf file even if one exists).'),
    cfg.FloatOpt('lvm_max_over_subscription_ratio',
                 # This option exists to provide a default value for the
                 # LVM driver which is different than the global default.
                 default=1.0,
                 help='max_over_subscription_ratio setting for the LVM '
                      'driver. This takes precedence over the general '
                      'max_over_subscription_ratio by default. If set '
                      'to None, the general max_over_subscription_ratio '
                      'is used.'),
    cfg.BoolOpt('lvm_suppress_fd_warnings',
                default=False,
                help='Suppress leaked file descriptor warnings in LVM '
                     'commands.')
]

CONF = cfg.CONF
CONF.register_opts(volume_opts, group=configuration.SHARED_CONF_GROUP)


@interface.volumedriver
Exemplo n.º 28
0
               help='Path of qemu-img command which is used to convert '
               'between different image types'),
    cfg.BoolOpt('config_drive_cdrom',
                default=False,
                help='Attaches the Config Drive image as a cdrom drive '
                'instead of a disk drive'),
    cfg.BoolOpt('enable_instance_metrics_collection',
                default=False,
                help='Enables metrics collections for an instance by using '
                'Hyper-V\'s metric APIs. Collected data can by retrieved '
                'by other apps and services, e.g.: Ceilometer. '
                'Requires Hyper-V / Windows Server 2012 and above'),
    cfg.FloatOpt('dynamic_memory_ratio',
                 default=1.0,
                 help='Enables dynamic memory allocation (ballooning) when '
                 'set to a value greater than 1. The value expresses '
                 'the ratio between the total RAM assigned to an '
                 'instance and its startup RAM amount. For example a '
                 'ratio of 2.0 for an instance with 1024MB of RAM '
                 'implies 512MB of RAM allocated at startup'),
    cfg.IntOpt('wait_soft_reboot_seconds',
               default=60,
               help='Number of seconds to wait for instance to shut down after'
               ' soft reboot request is made. We fall back to hard reboot'
               ' if instance does not shutdown within this window.'),
]

CONF = cfg.CONF
CONF.register_opts(hyperv_opts, 'hyperv')
CONF.import_opt('use_cow_images', 'nova.virt.driver')
CONF.import_opt('network_api_class', 'nova.network')
Exemplo n.º 29
0
            "done and subsequently backs to level 1. "
            "Default 0 (No Incremental)"),
 cfg.IntOpt('always-level',
            dest='always_level',
            default=DEFAULT_PARAMS['always_level'],
            help="Set backup maximum level used with tar to implement "
            "incremental backup. If a level 3 is specified, the backup"
            " will be executed from level 0 to level 3 and to that "
            "point always a backup level 3 will be executed.  It will "
            "not restart from level 0. This option has precedence over"
            " --max-backup-level. Default False (Disabled)"),
 cfg.FloatOpt('restart-always-level',
              dest='restart_always_level',
              default=DEFAULT_PARAMS['restart_always_level'],
              help="Restart the backup from level 0 after n days. Valid "
              "only if --always-level option if set. If "
              "--always-level is used together with "
              "--remove-older-than, there might be "
              "the chance where the initial level 0 will be removed. "
              "Default False (Disabled)"),
 cfg.FloatOpt('remove-older-than',
              short='R',
              default=DEFAULT_PARAMS['remove_older_than'],
              dest='remove_older_than',
              help="Checks in the specified container for objects older "
              "than the specified days. If i.e. 30 is specified, it "
              "will remove the remote object older than 30 days. "
              "Default False (Disabled)"),
 cfg.StrOpt('remove-from-date',
            dest='remove_from_date',
            default=DEFAULT_PARAMS['remove_from_date'],
Exemplo n.º 30
0
    # REST server
    cfg.IPOpt('bind_host', default='0.0.0.0',
              help=_("The host IP to bind to")),
    cfg.PortOpt('bind_port', default=9443, help=_("The port to bind to")),
    cfg.StrOpt('haproxy_cmd',
               default='/usr/sbin/haproxy',
               help=_("The full path to haproxy")),
    cfg.IntOpt('respawn_count',
               default=2,
               help=_("The respawn count for haproxy's upstart script")),
    cfg.IntOpt('respawn_interval',
               default=2,
               help=_("The respawn interval for haproxy's upstart script")),
    cfg.FloatOpt('rest_request_conn_timeout',
                 default=10,
                 help=_("The time in seconds to wait for a REST API "
                        "to connect.")),
    cfg.FloatOpt('rest_request_read_timeout',
                 default=60,
                 help=_("The time in seconds to wait for a REST API "
                        "response.")),
    # REST client
    cfg.StrOpt('client_cert',
               default='/etc/octavia/certs/client.pem',
               help=_("The client certificate to talk to the agent")),
    cfg.StrOpt('server_ca',
               default='/etc/octavia/certs/server_ca.pem',
               help=_("The ca which signed the server certificates")),
    cfg.BoolOpt('use_upstart', default=True,
                help=_("If False, use sysvinit.")),
]