Esempio n. 1
0
    def _configure_quantum(self, nova_conf):
        params = self.get_keystone_params('nova')
        params['quantum'] = qhelper.get_shared_params(
            ip=self.installer.get_option('ip'),
            **self.installer.get_option('quantum'))

        nova_conf.add("network_api_class", "nova.network.quantumv2.api.API")
        nova_conf.add("quantum_admin_username", params['service_user'])
        nova_conf.add("quantum_admin_password", params['service_password'])
        nova_conf.add("quantum_admin_auth_url",
                      params['endpoints']['public']['uri'])
        nova_conf.add("quantum_auth_strategy", "keystone")
        nova_conf.add("quantum_admin_tenant_name", params['service_tenant'])
        nova_conf.add("quantum_url", params['quantum']['endpoints']['uri'])
        libvirt_vif_drivers = {
            "linuxbridge": "nova.virt.libvirt.vif.QuantumLinuxBridgeVIFDriver",
            "openvswitch":
            "nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver",
        }
        # FIXME(aababilov): error on KeyError
        nova_conf.add(
            "libvirt_vif_driver", libvirt_vif_drivers[
                self.installer.get_option('quantum-core-plugin')])

        # FIXME(aababilov): add for linuxbridge:
        nova_conf.add("libvirt_vif_type", "ethernet")
        nova_conf.add("connection_type", "libvirt")
        nova_conf.add("quantum_use_dhcp",
                      self.installer.get_bool_option('quantum-use-dhcp'))
Esempio n. 2
0
    def _configure_quantum(self, nova_conf):
        params = self.get_keystone_params('nova')
        params['quantum'] = qhelper.get_shared_params(
            ip=self.installer.get_option('ip'),
            **self.installer.get_option('quantum'))

        nova_conf.add("network_api_class", "nova.network.quantumv2.api.API")
        nova_conf.add("quantum_admin_username", params['service_user'])
        nova_conf.add("quantum_admin_password", params['service_password'])
        nova_conf.add("quantum_admin_auth_url", params['endpoints']['public']['uri'])
        nova_conf.add("quantum_auth_strategy", "keystone")
        nova_conf.add("quantum_admin_tenant_name", params['service_tenant'])
        nova_conf.add("quantum_url", params['quantum']['endpoints']['uri'])
        libvirt_vif_drivers = {
            "linuxbridge": "nova.virt.libvirt.vif.QuantumLinuxBridgeVIFDriver",
            "openvswitch": "nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver",
        }
        # FIXME(aababilov): error on KeyError
        nova_conf.add(
            "libvirt_vif_driver",
            libvirt_vif_drivers[self.installer.get_option('quantum-core-plugin')])

        # FIXME(aababilov): add for linuxbridge:
        nova_conf.add("libvirt_vif_type", "ethernet")
        nova_conf.add("connection_type", "libvirt")
        nova_conf.add("quantum_use_dhcp",
                      self.installer.get_bool_option('quantum-use-dhcp'))
Esempio n. 3
0
 def post_start(self):
     if not sh.isfile(self.init_fn) and self.get_bool_option('do-init'):
         self.wait_active()
         LOG.info("Running commands to initialize keystone.")
         (fn, contents) = utils.load_template(self.name, INIT_WHAT_FN)
         LOG.debug("Initializing with contents of %s", fn)
         params = {}
         params['keystone'] = khelper.get_shared_params(**utils.merge_dicts(self.options, khelper.get_shared_passwords(self)))
         params['glance'] = ghelper.get_shared_params(ip=self.get_option('ip'), **self.get_option('glance'))
         params['nova'] = nhelper.get_shared_params(ip=self.get_option('ip'), **self.get_option('nova'))
         params['quantum'] = qhelper.get_shared_params(ip=self.get_option('ip'), **self.get_option('quantum'))
         params['cinder'] = chelper.get_shared_params(ip=self.get_option('ip'), **self.get_option('cinder'))
         wait_urls = [
             params['keystone']['endpoints']['admin']['uri'],
             params['keystone']['endpoints']['public']['uri'],
         ]
         for url in wait_urls:
             utils.wait_for_url(url)
         init_what = utils.load_yaml_text(contents)
         init_what = utils.expand_template_deep(self._filter_init(init_what), params)
         khelper.Initializer(params['keystone']['service_token'],
                             params['keystone']['endpoints']['admin']['uri']).initialize(**init_what)
         # Writing this makes sure that we don't init again
         sh.write_file(self.init_fn, utils.prettify_yaml(init_what))
         LOG.info("If you wish to re-run initialization, delete %s", colorizer.quote(self.init_fn))
Esempio n. 4
0
 def post_start(self):
     if not sh.isfile(self.init_fn) and self.get_bool_option('do-init'):
         self.wait_active()
         LOG.info("Running commands to initialize keystone.")
         (fn, contents) = utils.load_template(self.name, INIT_WHAT_FN)
         LOG.debug("Initializing with contents of %s", fn)
         params = {}
         params['keystone'] = khelper.get_shared_params(**utils.merge_dicts(
             self.options, khelper.get_shared_passwords(self)))
         params['glance'] = ghelper.get_shared_params(
             ip=self.get_option('ip'), **self.get_option('glance'))
         params['nova'] = nhelper.get_shared_params(
             ip=self.get_option('ip'), **self.get_option('nova'))
         params['quantum'] = qhelper.get_shared_params(
             ip=self.get_option('ip'), **self.get_option('quantum'))
         params['cinder'] = chelper.get_shared_params(
             ip=self.get_option('ip'), **self.get_option('cinder'))
         wait_urls = [
             params['keystone']['endpoints']['admin']['uri'],
             params['keystone']['endpoints']['public']['uri'],
         ]
         for url in wait_urls:
             utils.wait_for_url(url)
         init_what = utils.load_yaml_text(contents)
         init_what = utils.expand_template_deep(
             self._filter_init(init_what), params)
         khelper.Initializer(
             params['keystone']['service_token'],
             params['keystone']['endpoints']['admin']['uri']).initialize(
                 **init_what)
         # Writing this makes sure that we don't init again
         sh.write_file(self.init_fn, utils.prettify_yaml(init_what))
         LOG.info("If you wish to re-run initialization, delete %s",
                  colorizer.quote(self.init_fn))