コード例 #1
0
    def __init__(self, read_only=False):
        super(BareMetalDriver, self).__init__()

        self.baremetal_nodes = importutils.import_object(
            FLAGS.baremetal_driver)
        self._vif_driver = importutils.import_object(
            FLAGS.baremetal_vif_driver)
        self._firewall_driver = firewall.load_driver(
            default=DEFAULT_FIREWALL_DRIVER)
        self._volume_driver = importutils.import_object(
            FLAGS.baremetal_volume_driver)
        self._image_cache_manager = imagecache.ImageCacheManager()

        extra_specs = {}
        extra_specs["baremetal_driver"] = FLAGS.baremetal_driver
        for pair in FLAGS.instance_type_extra_specs:
            keyval = pair.split(':', 1)
            keyval[0] = keyval[0].strip()
            keyval[1] = keyval[1].strip()
            extra_specs[keyval[0]] = keyval[1]
        if not 'cpu_arch' in extra_specs:
            LOG.warning('cpu_arch is not found in instance_type_extra_specs')
            extra_specs['cpu_arch'] = ''
        self._extra_specs = extra_specs

        self._supported_instances = [
            (extra_specs['cpu_arch'], 'baremetal', 'baremetal'),
        ]
コード例 #2
0
    def __init__(self, virtapi, read_only=False):
        super(BareMetalDriver, self).__init__(virtapi)

        self.driver = importutils.import_object(CONF.baremetal.driver, virtapi)
        self.vif_driver = importutils.import_object(CONF.baremetal.vif_driver)
        self.firewall_driver = firewall.load_driver(
            default=DEFAULT_FIREWALL_DRIVER)
        self.volume_driver = importutils.import_object(
            CONF.baremetal.volume_driver, virtapi)
        self.image_cache_manager = imagecache.ImageCacheManager()

        extra_specs = {}
        extra_specs["baremetal_driver"] = CONF.baremetal.driver
        for pair in CONF.baremetal.instance_type_extra_specs:
            keyval = pair.split(':', 1)
            keyval[0] = keyval[0].strip()
            keyval[1] = keyval[1].strip()
            extra_specs[keyval[0]] = keyval[1]
        if 'cpu_arch' not in extra_specs:
            LOG.warning(
                _('cpu_arch is not found in instance_type_extra_specs'))
            extra_specs['cpu_arch'] = ''
        self.extra_specs = extra_specs

        self.supported_instances = [
            (extra_specs['cpu_arch'], 'baremetal', 'baremetal'),
        ]
コード例 #3
0
    def __init__(self, virtapi, read_only=False):
        super(BareMetalDriver, self).__init__(virtapi)

        self.driver = importutils.import_object(
                CONF.baremetal.driver, virtapi)
        self.vif_driver = importutils.import_object(
                CONF.baremetal.vif_driver)
        self.firewall_driver = firewall.load_driver(
                default=DEFAULT_FIREWALL_DRIVER)
        self.volume_driver = importutils.import_object(
                CONF.baremetal.volume_driver, virtapi)
        self.image_cache_manager = imagecache.ImageCacheManager()

        extra_specs = {}
        extra_specs["baremetal_driver"] = CONF.baremetal.driver
        for pair in CONF.baremetal.flavor_extra_specs:
            keyval = pair.split(':', 1)
            keyval[0] = keyval[0].strip()
            keyval[1] = keyval[1].strip()
            extra_specs[keyval[0]] = keyval[1]

        self.extra_specs = extra_specs

        if 'cpu_arch' not in extra_specs:
            LOG.info(
                _('cpu_arch is not found in flavor_extra_specs'))
            self.supported_instances = []
        else:
            self.supported_instances = [(
                arch.canonicalize(extra_specs['cpu_arch']),
                hvtype.BAREMETAL,
                vm_mode.HVM
            ), ]
コード例 #4
0
    def __init__(self, virtapi, read_only=False):
        super(BareMetalDriver, self).__init__(virtapi)

        self.driver = importutils.import_object(
                CONF.baremetal.driver, virtapi)
        self.vif_driver = importutils.import_object(
                CONF.baremetal.vif_driver)
        self.firewall_driver = firewall.load_driver(
                default=DEFAULT_FIREWALL_DRIVER)
        self.volume_driver = importutils.import_object(
                CONF.baremetal.volume_driver, virtapi)
        self.image_cache_manager = imagecache.ImageCacheManager()

        extra_specs = {}
        extra_specs["baremetal_driver"] = CONF.baremetal.driver
        for pair in CONF.baremetal.flavor_extra_specs:
            keyval = pair.split(':', 1)
            keyval[0] = keyval[0].strip()
            keyval[1] = keyval[1].strip()
            extra_specs[keyval[0]] = keyval[1]
        if 'cpu_arch' not in extra_specs:
            LOG.warning(
                    _('cpu_arch is not found in flavor_extra_specs'))
            extra_specs['cpu_arch'] = ''
        self.extra_specs = extra_specs

        self.supported_instances = [
                (extra_specs['cpu_arch'], 'baremetal', 'baremetal'),
                ]
コード例 #5
0
ファイル: driver.py プロジェクト: yuanying/ironic
    def __init__(self, virtapi, read_only=False):
        super(IronicDriver, self).__init__(virtapi)
        global ironic
        if ironic is None:
            ironic = importutils.import_module('ironicclient')
            # NOTE(deva): work around a lack of symbols in the current version.
            if not hasattr(ironic, 'exc'):
                ironic.exc = importutils.import_module('ironicclient.exc')
            if not hasattr(ironic, 'client'):
                ironic.client = importutils.import_module(
                                                    'ironicclient.client')

        self.firewall_driver = firewall.load_driver(
            default='nova.virt.firewall.NoopFirewallDriver')
        extra_specs = {}
        extra_specs["ironic_driver"] = \
            "ironic.nova.virt.ironic.driver.IronicDriver"
        self.extra_specs = extra_specs
        self.node_cache = {}
        self.node_cache_time = 0

        icli_log_level = CONF.ironic.client_log_level
        if icli_log_level:
            level = py_logging.getLevelName(icli_log_level)
            logger = py_logging.getLogger('ironicclient')
            logger.setLevel(level)
コード例 #6
0
    def __init__(self, virtapi, read_only=False):
        super(IronicDriver, self).__init__(virtapi)
        global ironic
        if ironic is None:
            ironic = importutils.import_module('ironicclient')
            # NOTE(deva): work around a lack of symbols in the current version.
            if not hasattr(ironic, 'exc'):
                ironic.exc = importutils.import_module('ironicclient.exc')
            if not hasattr(ironic, 'client'):
                ironic.client = importutils.import_module(
                                                    'ironicclient.client')

        self.firewall_driver = firewall.load_driver(
            default='nova.virt.firewall.NoopFirewallDriver')
        self.node_cache = {}
        self.node_cache_time = 0

        # TODO(mrda): Bug ID 1365230 Logging configurability needs
        # to be addressed
        ironicclient_log_level = CONF.ironic.client_log_level
        if ironicclient_log_level:
            level = py_logging.getLevelName(ironicclient_log_level)
            logger = py_logging.getLogger('ironicclient')
            logger.setLevel(level)

        self.ironicclient = client_wrapper.IronicClientWrapper()
コード例 #7
0
ファイル: driver.py プロジェクト: hesamrahimi/nova
    def __init__(self, read_only=False):
        super(BareMetalDriver, self).__init__()

        self.baremetal_nodes = importutils.import_object(
                FLAGS.baremetal_driver)
        self._vif_driver = importutils.import_object(
                FLAGS.baremetal_vif_driver)
        self._firewall_driver = firewall.load_driver(
                default=DEFAULT_FIREWALL_DRIVER)
        self._volume_driver = importutils.import_object(
                FLAGS.baremetal_volume_driver)
        self._image_cache_manager = imagecache.ImageCacheManager()

        extra_specs = {}
        extra_specs["baremetal_driver"] = FLAGS.baremetal_driver
        for pair in FLAGS.instance_type_extra_specs:
            keyval = pair.split(':', 1)
            keyval[0] = keyval[0].strip()
            keyval[1] = keyval[1].strip()
            extra_specs[keyval[0]] = keyval[1]
        if not 'cpu_arch' in extra_specs:
            LOG.warning('cpu_arch is not found in instance_type_extra_specs')
            extra_specs['cpu_arch'] = ''
        self._extra_specs = extra_specs

        self._supported_instances = [
                (extra_specs['cpu_arch'], 'baremetal', 'baremetal'),
                ]
コード例 #8
0
 def __init__(self, virtapi):
     super(DockerDriver, self).__init__(virtapi)
     self._docker = None
     vif_class = importutils.import_class(CONF.docker.vif_driver)
     self.vif_driver = vif_class()
     self.firewall_driver = firewall.load_driver(
         default='nova.virt.firewall.NoopFirewallDriver')
コード例 #9
0
ファイル: driver.py プロジェクト: cc272309126/nova-docker
 def __init__(self, virtapi):
     super(DockerDriver, self).__init__(virtapi)
     self._docker = None
     vif_class = importutils.import_class(CONF.docker.vif_driver)
     self.vif_driver = vif_class()
     self.firewall_driver = firewall.load_driver(
         default='nova.virt.firewall.NoopFirewallDriver')
コード例 #10
0
ファイル: driver.py プロジェクト: openstack/higgins
 def __init__(self, virtapi):
     super(DockerDriver, self).__init__(virtapi)
     self._docker = None
     vif_class = importutils.import_class(CONF.docker.vif_driver)
     self.vif_driver = vif_class()
     self.firewall_driver = firewall.load_driver(
         default='nova.virt.firewall.NoopFirewallDriver')
     # NOTE(zhangguoqing): For passing the nova unit tests
     self.active_migrations = {}
コード例 #11
0
    def __init__(self, virtapi):
        super(LXDDriver, self).__init__(virtapi)

        self.client = None  # Initialized by init_host
        self.host = NOVA_CONF.host
        self.network_api = network.API()
        self.vif_driver = lxd_vif.LXDGenericVifDriver()
        self.firewall_driver = firewall.load_driver(
            default='nova.virt.firewall.NoopFirewallDriver')
コード例 #12
0
ファイル: driver.py プロジェクト: Juniper/nova-docker
 def __init__(self, virtapi):
     super(DockerDriver, self).__init__(virtapi)
     self._docker = None
     vif_class = importutils.import_class(CONF.docker.vif_driver)
     self.vif_driver = vif_class()
     self.firewall_driver = firewall.load_driver(
         default='nova.virt.firewall.NoopFirewallDriver')
     # NOTE(zhangguoqing): For passing the nova unit tests
     self.active_migrations = {}
コード例 #13
0
    def __init__(self, virtapi):
        super(LXDDriver, self).__init__(virtapi)

        self.client = None  # Initialized by init_host
        self.host = NOVA_CONF.host
        self.network_api = network.API()
        self.vif_driver = lxd_vif.LXDGenericVifDriver()
        self.firewall_driver = firewall.load_driver(
            default='nova.virt.firewall.NoopFirewallDriver')

        self.storage_driver = connector.InitiatorConnector.factory(
            'ISCSI', utils.get_root_helper(),
            use_multipath=CONF.libvirt.volume_use_multipath,
            device_scan_attempts=CONF.libvirt.num_iscsi_scan_tries,
            transport='default')
コード例 #14
0
ファイル: driver.py プロジェクト: portdirect/nova-docker
 def __init__(self, virtapi):
     super(DockerDriver, self).__init__(virtapi)
     self._docker = None
     vif_class = importutils.import_class(CONF.docker.vif_driver)
     self.vif_driver = vif_class()
     self._initiator = None
     self._fc_wwnns = None
     self._fc_wwpns = None
     self._volume_api = volume.API()
     self.volume_drivers = driver.driver_dict_from_config(
         self._get_volume_drivers(), self)
     self.firewall_driver = firewall.load_driver(
         default='nova.virt.firewall.NoopFirewallDriver')
     # NOTE(zhangguoqing): For passing the nova unit tests
     self.active_migrations = {}
コード例 #15
0
ファイル: driver.py プロジェクト: rahulgopan/ironic
    def __init__(self, virtapi, read_only=False):
        super(IronicDriver, self).__init__(virtapi)

        self.firewall_driver = firewall.load_driver(default=_FIREWALL_DRIVER)
        # TODO(deva): sort out extra_specs and nova-scheduler interaction
        extra_specs = {}
        extra_specs["ironic_driver"] = \
                "ironic.nova.virt.ironic.driver.IronicDriver"
        # cpu_arch set per node.
        extra_specs['cpu_arch'] = ''
        for pair in CONF.ironic.instance_type_extra_specs:
            keyval = pair.split(':', 1)
            keyval[0] = keyval[0].strip()
            keyval[1] = keyval[1].strip()
            extra_specs[keyval[0]] = keyval[1]

        self.extra_specs = extra_specs
コード例 #16
0
    def __init__(self, virtapi, read_only=False):
        super(IronicDriver, self).__init__(virtapi)

        self.firewall_driver = firewall.load_driver(default=_FIREWALL_DRIVER)
        # TODO(deva): sort out extra_specs and nova-scheduler interaction
        extra_specs = {}
        extra_specs["ironic_driver"] = \
                "ironic.nova.virt.ironic.driver.IronicDriver"
        # cpu_arch set per node.
        extra_specs['cpu_arch'] = ''
        for pair in CONF.ironic.instance_type_extra_specs:
            keyval = pair.split(':', 1)
            keyval[0] = keyval[0].strip()
            keyval[1] = keyval[1].strip()
            extra_specs[keyval[0]] = keyval[1]

        self.extra_specs = extra_specs
コード例 #17
0
ファイル: driver.py プロジェクト: zhouyang1222/nova
    def __init__(self, virtapi, read_only=False):
        super(IronicDriver, self).__init__(virtapi)
        global ironic
        if ironic is None:
            ironic = importutils.import_module('ironicclient')
            # NOTE(deva): work around a lack of symbols in the current version.
            if not hasattr(ironic, 'exc'):
                ironic.exc = importutils.import_module('ironicclient.exc')
            if not hasattr(ironic, 'client'):
                ironic.client = importutils.import_module(
                                                    'ironicclient.client')

        self.firewall_driver = firewall.load_driver(
            default='nova.virt.firewall.NoopFirewallDriver')
        self.node_cache = {}
        self.node_cache_time = 0

        self.ironicclient = client_wrapper.IronicClientWrapper()
コード例 #18
0
ファイル: driver.py プロジェクト: duanxiaoyu/nova
    def __init__(self, virtapi, read_only=False):
        super(IronicDriver, self).__init__(virtapi)
        global ironic
        if ironic is None:
            ironic = importutils.import_module('ironicclient')
            # NOTE(deva): work around a lack of symbols in the current version.
            if not hasattr(ironic, 'exc'):
                ironic.exc = importutils.import_module('ironicclient.exc')
            if not hasattr(ironic, 'client'):
                ironic.client = importutils.import_module(
                                                    'ironicclient.client')

        self.firewall_driver = firewall.load_driver(
            default='nova.virt.firewall.NoopFirewallDriver')
        self.node_cache = {}
        self.node_cache_time = 0

        self.ironicclient = client_wrapper.IronicClientWrapper()
コード例 #19
0
ファイル: driver.py プロジェクト: JoProvost/ironic
    def __init__(self, virtapi, read_only=False):
        super(IronicDriver, self).__init__(virtapi)

        self.firewall_driver = firewall.load_driver(default=_FIREWALL_DRIVER)
        extra_specs = {}
        extra_specs["ironic_driver"] = \
            "ironic.nova.virt.ironic.driver.IronicDriver"
        for pair in CONF.ironic.instance_type_extra_specs:
            keyval = pair.split(':', 1)
            keyval[0] = keyval[0].strip()
            keyval[1] = keyval[1].strip()
            extra_specs[keyval[0]] = keyval[1]

        self.extra_specs = extra_specs

        icli_log_level = CONF.ironic.client_log_level
        if icli_log_level:
            level = py_logging.getLevelName(icli_log_level)
            logger = py_logging.getLogger('ironicclient')
            logger.setLevel(level)
コード例 #20
0
ファイル: driver.py プロジェクト: JoProvost/ironic
    def __init__(self, virtapi, read_only=False):
        super(IronicDriver, self).__init__(virtapi)

        self.firewall_driver = firewall.load_driver(default=_FIREWALL_DRIVER)
        extra_specs = {}
        extra_specs["ironic_driver"] = \
            "ironic.nova.virt.ironic.driver.IronicDriver"
        for pair in CONF.ironic.instance_type_extra_specs:
            keyval = pair.split(':', 1)
            keyval[0] = keyval[0].strip()
            keyval[1] = keyval[1].strip()
            extra_specs[keyval[0]] = keyval[1]

        self.extra_specs = extra_specs

        icli_log_level = CONF.ironic.client_log_level
        if icli_log_level:
            level = py_logging.getLevelName(icli_log_level)
            logger = py_logging.getLogger('ironicclient')
            logger.setLevel(level)
コード例 #21
0
ファイル: driver.py プロジェクト: zouyapeng/nova
    def __init__(self, virtapi, read_only=False):
        super(IronicDriver, self).__init__(virtapi)
        global ironic
        if ironic is None:
            ironic = importutils.import_module("ironicclient")
            # NOTE(deva): work around a lack of symbols in the current version.
            if not hasattr(ironic, "exc"):
                ironic.exc = importutils.import_module("ironicclient.exc")
            if not hasattr(ironic, "client"):
                ironic.client = importutils.import_module("ironicclient.client")

        self.firewall_driver = firewall.load_driver(default="nova.virt.firewall.NoopFirewallDriver")
        self.node_cache = {}
        self.node_cache_time = 0

        ironicclient_log_level = CONF.ironic.client_log_level
        if ironicclient_log_level:
            level = py_logging.getLevelName(ironicclient_log_level)
            logger = py_logging.getLogger("ironicclient")
            logger.setLevel(level)

        self.ironicclient = client_wrapper.IronicClientWrapper()
コード例 #22
0
 def __init__(self):
     self.firewall_driver = firewall.load_driver(
         default='nova.virt.firewall.NoopFirewallDriver')
コード例 #23
0
ファイル: driver.py プロジェクト: njuicsgz/jay-work
 def __init__(self):
     self._docker = None
     vif_class = importutils.import_class(CONF.docker2.vif_driver)
     self.vif_driver = vif_class()
     self.firewall_driver = firewall.load_driver(
         default='nova.virt.firewall.NoopFirewallDriver')
コード例 #24
0
 def __init__(self):
     self.firewall_driver = firewall.load_driver(
         default='nova.virt.firewall.NoopFirewallDriver')
コード例 #25
0
ファイル: driver.py プロジェクト: kapilt/graviton
 def __init__(self, virtapi, read_only=False):
     super(GravitonDriver, self).__init__(virtapi)
     self.firewall_driver = firewall.load_driver(default=_FIREWALL_DRIVER)
コード例 #26
0
 def __init__(self):
     self._docker = None
     vif_class = importutils.import_class(CONF.docker2.vif_driver)
     self.vif_driver = vif_class()
     self.firewall_driver = firewall.load_driver(
         default='nova.virt.firewall.NoopFirewallDriver')