Example #1
0
def parse_args(argv, default_config_files=None, configure_db=True,
               init_rpc=True):
    log.register_options(CONF)
    # We use the oslo.log default log levels which includes suds=INFO
    # and add only the extra levels that Nova needs
    if CONF.glance.debug:
        extra_default_log_levels = ['glanceclient=DEBUG']
    else:
        extra_default_log_levels = ['glanceclient=WARN']

    # NOTE(danms): DEBUG logging in privsep will result in some large
    # and potentially sensitive things being logged.
    extra_default_log_levels.append('oslo.privsep.daemon=INFO')

    log.set_defaults(default_log_levels=log.get_default_log_levels() +
                     extra_default_log_levels)
    rpc.set_defaults(control_exchange='nova')
    if profiler:
        profiler.set_defaults(CONF)
    config.set_middleware_defaults()

    CONF(argv[1:],
         project='nova',
         version=version.version_string(),
         default_config_files=default_config_files)

    if init_rpc:
        rpc.init(CONF)

    if configure_db:
        sqlalchemy_api.configure(CONF)
        placement_db.configure(CONF)
Example #2
0
def parse_args(argv, default_config_files=None, configure_db=True,
               init_rpc=True):
    log.register_options(CONF)
    # We use the oslo.log default log levels which includes suds=INFO
    # and add only the extra levels that Nova needs
    if CONF.glance.debug:
        extra_default_log_levels = ['glanceclient=DEBUG']
    else:
        extra_default_log_levels = ['glanceclient=WARN']
    log.set_defaults(default_log_levels=log.get_default_log_levels() +
                     extra_default_log_levels)
    rpc.set_defaults(control_exchange='nova')
    if profiler:
        profiler.set_defaults(CONF)
    config.set_middleware_defaults()

    CONF(argv[1:],
         project='nova',
         version=version.version_string(),
         default_config_files=default_config_files)

    if init_rpc:
        rpc.init(CONF)

    if configure_db:
        sqlalchemy_api.configure(CONF)
Example #3
0
def parse_args(argv, default_config_files=None):
    db_session.set_defaults(sql_connection=_DEFAULT_SQL_CONNECTION,
                            sqlite_db='nova.sqlite')
    rpc.set_defaults(control_exchange='nova')
    cfg.CONF(argv[1:],
             project='nova',
             version=version.version_string(),
             default_config_files=default_config_files)
Example #4
0
def parse_args(argv, default_config_files=None):
    options.set_defaults(CONF, connection=_DEFAULT_SQL_CONNECTION,
                         sqlite_db='nova.sqlite')
    rpc.set_defaults(control_exchange='nova')
    debugger.register_cli_opts()
    CONF(argv[1:],
         project='nova',
         version=version.version_string(),
         default_config_files=default_config_files)
    rpc.init(CONF)
Example #5
0
def parse_args(argv, default_config_files=None):
    options.set_defaults(sql_connection=_DEFAULT_SQL_CONNECTION,
                         sqlite_db='nova.sqlite')
    rpc.set_defaults(control_exchange='nova')
    nova_default_log_levels = (log.DEFAULT_LOG_LEVELS +
            ["keystonemiddleware=WARN", "routes.middleware=WARN"])
    log.set_defaults(default_log_levels=nova_default_log_levels)
    debugger.register_cli_opts()
    cfg.CONF(argv[1:],
             project='nova',
             version=version.version_string(),
             default_config_files=default_config_files)
    rpc.init(cfg.CONF)
def parse_args(argv, default_config_files=None, configure_db=True):
    log.set_defaults(_DEFAULT_LOGGING_CONTEXT_FORMAT, _DEFAULT_LOG_LEVELS)
    log.register_options(CONF)
    options.set_defaults(CONF, connection=_DEFAULT_SQL_CONNECTION,
                         sqlite_db='nova.sqlite')
    rpc.set_defaults(control_exchange='nova')
    debugger.register_cli_opts()
    CONF(argv[1:],
         project='nova',
         version=version.version_string(),
         default_config_files=default_config_files)
    rpc.init(CONF)

    if configure_db:
        sqlalchemy_api.configure(CONF)
def check_openstack_compute():
    # Let's detect if we have nova-compute on the system
    nova_cmp = utils.helper.pack_exists("nova-compute")
    global py_path
    if nova_cmp:
        # check the openstack version
        if "12" not in version.version_string():
            print "This installation is not  based on openstack liberty"
            exit()
        # This is most likely the compute node. Let's try to detect where
        # nova is installed.
        for path in sys.path:
            if os.path.isdir(path + '/nova') and "python" in path:
                py_path = path + '/nova'
                apply_compute_changes()
                break
def check_openstack_scheduler():
    # This changes the scheduler of openstack with the required changes.
    nova_cmp = utils.helper.pack_exists("nova-scheduler")
    global py_path
    if nova_cmp:
        # check the openstack version
        if "12" not in version.version_string():
            print "This installation is not  based on openstack liberty"
            exit()
        # This is most likely the compute node. Let's try to detect where
        # nova is installed.
        for path in sys.path:
            if os.path.isdir(path + '/nova') and "python" in path:
                py_path = path + '/nova'
                apply_scheduler_changes()
                break
Example #9
0
 def _make_iso9660(self, path):
     utils.execute(CONF.mkisofs_cmd,
                   '-o', path,
                   '-ldots',
                   '-allow-lowercase',
                   '-allow-multidot',
                   '-l',
                   '-publisher', ('"OpenStack nova %s"'
                                  % version.version_string()),
                   '-quiet',
                   '-J',
                   '-r',
                   '-V', 'config-2',
                   self.tempdir,
                   attempts=1,
                   run_as_root=False)
Example #10
0
def parse_args(argv, default_config_files=None, configure_db=True,
               init_rpc=True):
    log.register_options(CONF)
    # We use the oslo.log default log levels which includes suds=INFO
    # and add only the extra levels that Nova needs
    log.set_defaults(default_log_levels=log.get_default_log_levels() +
                     _EXTRA_DEFAULT_LOG_LEVELS)
    rpc.set_defaults(control_exchange='nova')
    config.set_middleware_defaults()

    CONF(argv[1:],
         project='nova',
         version=version.version_string(),
         default_config_files=default_config_files)

    if init_rpc:
        rpc.init(CONF)

    if configure_db:
        sqlalchemy_api.configure(CONF)
Example #11
0
 def _make_iso9660(self, path):
     utils.execute(
         "genisoimage",
         "-o",
         path,
         "-ldots",
         "-allow-lowercase",
         "-allow-multidot",
         "-l",
         "-publisher",
         ('"OpenStack nova %s"' % version.version_string()),
         "-quiet",
         "-J",
         "-r",
         "-V",
         "config-2",
         self.tempdir,
         attempts=1,
         run_as_root=False,
     )
def main():
    if len(sys.argv) < 2:
        print "insufficient arguments"
        exit()

    cfg.CONF(sys.argv[1:],
             project='nova',
             version=version.version_string(),
             default_config_files=None)

    test_api_opts = [
        cfg.StrOpt('cidr_hns',
                   help='The provider CIDR block for the HyperNode subnet',
                   required=True),
        cfg.StrOpt('subnet_tunnel_bearing',
                   help='The provider subnet ID of the Tunnel Bearing subnet',
                   required=True),
        cfg.StrOpt('ip_vpngw',
                   help='IP address of the VPN gateway on the cascading node',
                   required=True),
        cfg.StrOpt('subnet_internal_base',
                   help='The provider subnet ID of the Internal Base subnet',
                   required=True),
    ]

    cfg.CONF.register_opts(test_api_opts, 'hypernode_api')

    installer = HyperNodeInstaller()
    # Start everything.
    LOG.info("Installer initialized successfully, now running... ")
    hn_cidr_block = cfg.CONF.hypernode_api.cidr_hns
    tb_subnet_id = cfg.CONF.hypernode_api.subnet_tunnel_bearing
    vpngw_ip = cfg.CONF.hypernode_api.ip_vpngw
    ib_subnet_id = cfg.CONF.hypernode_api.subnet_internal_base
    opq = installer.start_install(
        hn_cidr_block=hn_cidr_block,
        tunnel_bearing_subnet_id=tb_subnet_id,
        vpngw_ip=vpngw_ip,
        internal_base_subnet_id=ib_subnet_id)

    opq.wait()
Example #13
0
def main():
    if len(sys.argv) < 2:
        print "insufficient arguments"
        exit()

    cfg.CONF(sys.argv[1:],
             project='nova',
             version=version.version_string(),
             default_config_files=None)

    test_api_opts = [
        cfg.StrOpt('cidr_hns',
                   help='The provider CIDR block for the HyperNode subnet',
                   required=True),
        cfg.StrOpt('subnet_tunnel_bearing',
                   help='The provider subnet ID of the Tunnel Bearing subnet',
                   required=True),
        cfg.StrOpt('ip_vpngw',
                   help='IP address of the VPN gateway on the cascading node',
                   required=True),
        cfg.StrOpt('subnet_internal_base',
                   help='The provider subnet ID of the Internal Base subnet',
                   required=True),
    ]

    cfg.CONF.register_opts(test_api_opts, 'hypernode_api')

    installer = HyperNodeInstaller()
    # Start everything.
    LOG.info("Installer initialized successfully, now running... ")
    hn_cidr_block = cfg.CONF.hypernode_api.cidr_hns
    tb_subnet_id = cfg.CONF.hypernode_api.subnet_tunnel_bearing
    vpngw_ip = cfg.CONF.hypernode_api.ip_vpngw
    ib_subnet_id = cfg.CONF.hypernode_api.subnet_internal_base
    opq = installer.start_install(hn_cidr_block=hn_cidr_block,
                                  tunnel_bearing_subnet_id=tb_subnet_id,
                                  vpngw_ip=vpngw_ip,
                                  internal_base_subnet_id=ib_subnet_id)

    opq.wait()
Example #14
0
def parse_args(argv,
               default_config_files=None,
               configure_db=True,
               init_rpc=True):
    log.register_options(CONF)
    # We use the oslo.log default log levels which includes suds=INFO
    # and add only the extra levels that Nova needs
    log.set_defaults(default_log_levels=log.get_default_log_levels() +
                     _EXTRA_DEFAULT_LOG_LEVELS)
    rpc.set_defaults(control_exchange='nova')
    config.set_middleware_defaults()

    CONF(argv[1:],
         project='nova',
         version=version.version_string(),
         default_config_files=default_config_files)

    if init_rpc:
        rpc.init(CONF)

    if configure_db:
        sqlalchemy_api.configure(CONF)
Example #15
0
def parse_args(argv,
               default_config_files=None,
               configure_db=True,
               init_rpc=True):
    log.set_defaults(_DEFAULT_LOGGING_CONTEXT_FORMAT, _DEFAULT_LOG_LEVELS)
    log.register_options(CONF)
    options.set_defaults(CONF,
                         connection=_DEFAULT_SQL_CONNECTION,
                         sqlite_db='nova.sqlite')
    rpc.set_defaults(control_exchange='nova')
    cache.configure(CONF)
    debugger.register_cli_opts()
    CONF(argv[1:],
         project='nova',
         version=version.version_string(),
         default_config_files=default_config_files)

    if init_rpc:
        rpc.init(CONF)

    if configure_db:
        sqlalchemy_api.configure(CONF)
Example #16
0
def parse_args(argv, default_config_files=None, configure_db=True,
               init_rpc=True):
    log.register_options(CONF)
    # We use the oslo.log default log levels which includes suds=INFO
    # and add only the extra levels that Nova needs
    if CONF.glance.debug:
        extra_default_log_levels = ['glanceclient=DEBUG']
    else:
        extra_default_log_levels = ['glanceclient=WARN']

    # NOTE(sean-k-mooney): this filter addresses bug #1825584
    # https://bugs.launchpad.net/nova/+bug/1825584
    # eventlet monkey-patching breaks AMQP heartbeat on uWSGI
    rabbit_logger = logging.getLogger('oslo.messaging._drivers.impl_rabbit')
    rabbit_logger.addFilter(rabbit_heartbeat_filter)

    # NOTE(danms): DEBUG logging in privsep will result in some large
    # and potentially sensitive things being logged.
    extra_default_log_levels.append('oslo.privsep.daemon=INFO')

    log.set_defaults(default_log_levels=log.get_default_log_levels() +
                     extra_default_log_levels)
    rpc.set_defaults(control_exchange='nova')
    if profiler:
        profiler.set_defaults(CONF)
    middleware.set_defaults()

    CONF(argv[1:],
         project='nova',
         version=version.version_string(),
         default_config_files=default_config_files)

    if init_rpc:
        rpc.init(CONF)

    if configure_db:
        sqlalchemy_api.configure(CONF)
Example #17
0
def parse_args(argv, default_config_files=None, configure_db=True,
               init_rpc=True):
    log.register_options(CONF)

    # NOTE(sean-k-mooney): this filter addresses bug #1825584
    # https://bugs.launchpad.net/nova/+bug/1825584
    # eventlet monkey-patching breaks AMQP heartbeat on uWSGI
    rabbit_logger = logging.getLogger('oslo.messaging._drivers.impl_rabbit')
    rabbit_logger.addFilter(rabbit_heartbeat_filter)

    set_lib_defaults()
    if profiler:
        profiler.set_defaults(CONF)

    CONF(argv[1:],
         project='nova',
         version=version.version_string(),
         default_config_files=default_config_files)

    if init_rpc:
        rpc.init(CONF)

    if configure_db:
        sqlalchemy_api.configure(CONF)
Example #18
0
 def service_version(self, context):
     return version.version_string()
Example #19
0
################################################
## Chuong trinh kiem tra phien ban OpenStack
## VDC-IT
## Ngay cap nhat: 18/08/2014
###############################################
## Cach thu hien
# python kt-phienban-openstack.py
################################################

#!/bin/python


from nova import version
print "Phien ban OpenStack hien tai la: ", version.version_string()
Example #20
0
# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'nova'
copyright = u'2010-present, OpenStack, LLC'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
from nova import version as nova_version
#import nova.version
# The full version, including alpha/beta/rc tags.
release = nova_version.version_string()
# The short X.Y version.
version = nova_version.canonical_version_string()

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'

# List of documents that shouldn't be included in the build.
unused_docs = [
################################################
## Chuong trinh kiem tra phien ban OpenStack
## VDC-IT
## Ngày cập nhật: 18/08/2014
###############################################
## Cách thực hiện
# python kt-phienban-openstack.py
################################################

#!/bin/python

from nova import version
print "Phien ban OpenStack hien tai la: ", version.version_string()
Example #22
0
 def service_version(self, context):
     return version.version_string()
Example #23
0
# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'nova'
copyright = u'2010-present, OpenStack, LLC'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
from nova import version as nova_version
#import nova.version
# The full version, including alpha/beta/rc tags.
release = nova_version.version_string()
# The short X.Y version.
version = nova_version.canonical_version_string()

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'

# List of documents that shouldn't be included in the build.
unused_docs = [
Example #24
0
    def gen_router_resources(self):
        """ Generate all the router resources """

        print "\t* Adding router resources to compute template"

        from nova import version
        year = version.version_string()

        for idx, router in enumerate(self.tenant_routers):
            router_ports = []
            for port in self.all_ports:
                if router["id"] == port["device_id"]:
                    router_ports.append(port)

            # add the router definition
            if "2013" in year:
                # Havana Format
                data = {"type": "OS::Neutron::Router"}
                self.compute_data["resources"]["router%s" % str(idx)] = data

                #  routers without external gateway
                if router["external_gateway_info"] is not None:

                    name = {"get_resource": "router%s" % str(idx)}
                    netid = {"get_param": "public_net_%s" % str(idx)}

                    # add the router gateway
                    data = {"type": "OS::Neutron::RouterGateway",
                            "properties": {
                                "router_id": name,
                                "network_id": netid
                            }}

                    self.compute_data["resources"]["router_gateway%s" % str(idx)] = data

            else:
                # Icehouse Format
                rtrName = router["name"]
                #  routers without external gateway
                if router["external_gateway_info"] is not None:
                    data = {"type": "OS::Neutron::Router",
                            "properties": {
                                "name": rtrName,
                                "external_gateway_info": {
                                    "network": {
                                        "get_param": "public_net_%s" % str(idx)
                                    }
                                }
                            }}
                else:
                    data = {"type": "OS::Neutron::Router",
                            "properties": {
                                "name": rtrName
                                }
                            }
                self.compute_data["resources"]["router%s" % str(idx)] = data

            # internal port information needed
            internal_interfaces = filter(lambda port: port["device_owner"] == "network:router_interface", router_ports)

            for idxs, interface in enumerate(internal_interfaces):
                # add the router interface

                for fixedip in interface["fixed_ips"]:

                    #  create router interface
                    data = {"type": "OS::Neutron::RouterInterface",
                            "properties": {
                                "router_id": {"get_resource": "router%s" % str(idx)},
                                "port_id": {"get_resource": "port_%s_%s" % (str(idx), str(idxs))}
                            }}
                    self.compute_data["resources"]["router_interface%s_%s" % (str(idx), str(idxs))] = data

                    #  create router port
                    network = self.neutronclient.show_subnet(fixedip["subnet_id"])["subnet"]["network_id"]
                    net_name = "%s" % str(self.neutronclient.show_network(network)["network"]["name"])
                    net_id = self.neutronclient.show_network(network)["network"]["id"]

                    fixed_ips = [{"ip_address": fixedip["ip_address"]}]
                    net = self.neutronclient.show_network(network)["network"]
                    if net["shared"] is True:
                        data = {"type": "OS::Neutron::Port",
                                "properties": {
                                    "fixed_ips": fixed_ips,
                                    "network_id": net_id
                                }}
                    else:
                        data = {"type": "OS::Neutron::Port",
                                "properties": {
                                    "fixed_ips": fixed_ips,
                                    "network_id": {"get_resource": net_name}
                                }}
                    self.compute_data["resources"]["port_%s_%s" % (str(idx), str(idxs))] = data