Exemple #1
0
 def _setup_pw(self):
     user_id = self.get_option('user_id')
     LOG.info("Setting up your rabbit-mq %s password.", colorizer.quote(user_id))
     self.runtime.start()
     self.runtime.wait_active()
     cmd = list(self.distro.get_command('rabbit-mq', 'change_password'))
     cmd += [user_id, rhelper.get_shared_passwords(self)['pw']]
     sh.execute(cmd)
     LOG.info("Restarting so that your rabbit-mq password is reflected.")
     self.runtime.restart()
     self.runtime.wait_active()
Exemple #2
0
 def _setup_pw(self):
     user_id = self.get_option("user_id")
     LOG.info("Setting up your rabbit-mq %s password.", colorizer.quote(user_id))
     self.runtime.start()
     self.runtime.wait_active()
     cmd = list(self.distro.get_command("rabbit-mq", "change_password"))
     cmd += [user_id, rhelper.get_shared_passwords(self)["pw"]]
     sh.execute(*cmd, run_as_root=True)
     LOG.info("Restarting so that your rabbit-mq password is reflected.")
     self.runtime.restart()
     self.runtime.wait_active()
Exemple #3
0
 def _setup_pw(self):
     user_id = self.get_option('user_id')
     LOG.info("Setting up your rabbit-mq %s password.",
              colorizer.quote(user_id))
     self.runtime.start()
     self.runtime.wait_active()
     cmd = list(self.distro.get_command('rabbit-mq', 'change_password'))
     cmd += [user_id, rhelper.get_shared_passwords(self)['pw']]
     sh.execute(cmd)
     LOG.info("Restarting so that your rabbit-mq password is reflected.")
     self.runtime.restart()
     self.runtime.wait_active()
Exemple #4
0
 def setup_rpc(self, conf, rpc_backend=None):
     # How is your message queue setup?
     mq_type = utils.canon_mq_type(self.installer.get_option("mq-type"))
     if mq_type == "rabbit":
         conf.add(
             "rabbit_host",
             self.installer.get_option("rabbit", "host", default_value=self.installer.get_option("ip")),
         )
         conf.add("rabbit_password", rhelper.get_shared_passwords(self.installer)["pw"])
         conf.add("rabbit_userid", self.installer.get_option("rabbit", "user_id"))
         if rpc_backend:
             conf.add("rpc_backend", rpc_backend)
Exemple #5
0
 def setup_rpc(self, conf, rpc_backend=None):
     # How is your message queue setup?
     mq_type = utils.canon_mq_type(self.installer.get_option('mq-type'))
     if mq_type == 'rabbit':
         conf.add(
             'rabbit_host',
             self.installer.get_option(
                 'rabbit', 'host',
                 default_value=self.installer.get_option('ip')))
         conf.add('rabbit_password',
                  rhelper.get_shared_passwords(self.installer)['pw'])
         conf.add('rabbit_userid',
                  self.installer.get_option('rabbit', 'user_id'))
         if rpc_backend:
             conf.add('rpc_backend', rpc_backend)
Exemple #6
0
 def setup_rpc(self, conf, rpc_backend=None):
     # How is your message queue setup?
     mq_type = utils.canon_mq_type(self.installer.get_option('mq-type'))
     if mq_type == 'rabbit':
         conf.add(
             'rabbit_host',
             self.installer.get_option(
                 'rabbit',
                 'host',
                 default_value=self.installer.get_option('ip')))
         conf.add('rabbit_password',
                  rhelper.get_shared_passwords(self.installer)['pw'])
         conf.add('rabbit_userid',
                  self.installer.get_option('rabbit', 'user_id'))
         if rpc_backend:
             conf.add('rpc_backend', rpc_backend)
Exemple #7
0
 def warm_configs(self):
     mq_type = nhelper.canon_mq_type(self.get_option('mq-type'))
     if mq_type == 'rabbit':
         rhelper.get_shared_passwords(self)
Exemple #8
0
 def warm_configs(self):
     mq_type = nhelper.canon_mq_type(self.get_option('mq-type'))
     if mq_type == 'rabbit':
         rhelper.get_shared_passwords(self)
Exemple #9
0
    def generate(self, fn):

        # Everything built goes in here
        nova_conf = Conf(fn, self.installer)

        # Used more than once so we calculate it ahead of time
        hostip = self.installer.get_option('ip')

        nova_conf.add('verbose', self.installer.get_bool_option('log_verbose'))

        # Allow destination machine to match source for resize.
        nova_conf.add('allow_resize_to_same_host', True)

        # Which scheduler do u want?
        nova_conf.add('compute_scheduler_driver',
                      self.installer.get_option('scheduler', default_value='nova.scheduler.filter_scheduler.FilterScheduler'))

        # Rate limit the api??
        nova_conf.add('api_rate_limit', self.installer.get_bool_option('api_rate_limit'))

        # Ensure the policy.json is referenced correctly
        nova_conf.add('policy_file', '/etc/nova/policy.json')

        # Setup nova network/settings
        self._configure_network_settings(nova_conf)

        # Setup nova volume/settings
        if self.installer.get_option('volumes'):
            self._configure_vols(nova_conf)

        # The ip of where we are running
        nova_conf.add('my_ip', hostip)

        # Setup your sql connection
        dbdsn = dbhelper.fetch_dbdsn(dbname=DB_NAME,
                                     utf8=True,
                                     dbtype=self.installer.get_option('db', 'type'),
                                     **utils.merge_dicts(self.installer.get_option('db'),
                                                         dbhelper.get_shared_passwords(self.installer)))
        nova_conf.add('sql_connection', dbdsn)

        # Configure anything libvirt related?
        virt_driver = canon_virt_driver(self.installer.get_option('virt_driver'))
        if virt_driver == 'libvirt':
            self._configure_libvirt(lv.canon_libvirt_type(self.installer.get_option('libvirt_type')), nova_conf)

        # How instances will be presented
        instance_template = "%s%s" % (self.installer.get_option('instance_name_prefix'),
                                      self.installer.get_option('instance_name_postfix'))
        if not instance_template:
            instance_template = 'instance-%08x'
        nova_conf.add('instance_name_template', instance_template)

        # Enable the standard extensions
        nova_conf.add('osapi_compute_extension',
                      'nova.api.openstack.compute.contrib.standard_extensions')

        # Auth will be using keystone
        nova_conf.add('auth_strategy', 'keystone')

        # Is config drive being forced on?
        if self.installer.get_bool_option('force_cfg_drive'):
            nova_conf.add('force_config_drive', 'always')

        # Don't always force images to raw, which makes things take time to get to raw...
        nova_conf.add('force_raw_images', self.installer.get_bool_option('force_raw_images'))

        # Add a checksum for images fetched for each hypervisor?
        # This check absorbs cpu cycles, warning....
        nova_conf.add('checksum_base_images', self.installer.get_bool_option('checksum_base_images'))

        # Setup the interprocess locking directory (don't put me on shared storage)
        lock_path = self.installer.get_option('lock_path')
        if not lock_path:
            lock_path = sh.joinpths(self.installer.get_option('component_dir'), 'locks')
        sh.mkdirslist(lock_path, tracewriter=self.tracewriter)
        nova_conf.add('lock_path', lock_path)

        # Vnc settings setup
        self._configure_vnc(nova_conf)

        # Where our paste config is
        nova_conf.add('api_paste_config', self.installer.target_config(PASTE_CONF))

        # What our imaging service will be
        self._configure_image_service(nova_conf, hostip)

        # Configs for ec2 / s3 stuff
        nova_conf.add('ec2_dmz_host', self.installer.get_option('ec2_dmz_host', default_value=hostip))
        nova_conf.add('s3_host', hostip)

        # How is your message queue setup?
        mq_type = canon_mq_type(self.installer.get_option('mq-type'))
        if mq_type == 'rabbit':
            nova_conf.add('rabbit_host', self.installer.get_option('rabbit', 'host', default_value=hostip))
            nova_conf.add('rabbit_password', rbhelper.get_shared_passwords(self.installer)['pw'])
            nova_conf.add('rabbit_userid', self.installer.get_option('rabbit', 'user_id'))
            nova_conf.add('rpc_backend', 'nova.rpc.impl_kombu')

        # The USB tablet device is meant to improve mouse behavior in
        # the VNC console, but it has the side effect of increasing
        # the CPU usage of an idle VM tenfold.
        nova_conf.add('use_usb_tablet', False)

        # Where instances will be stored
        instances_path = self.installer.get_option('instances_path')
        if not instances_path:
            instances_path = sh.joinpths(self.installer.get_option('component_dir'), 'instances')
        self._configure_instances_path(instances_path, nova_conf)

        # Is this a multihost setup?
        self._configure_multihost(nova_conf)

        # Handle any virt driver specifics
        self._configure_virt_driver(nova_conf)

        # Handle configuring the conductor service
        self._configure_conductor(nova_conf)

        # Annnnnd extract to finish
        return self._get_content(nova_conf)
Exemple #10
0
    def generate(self, fn):

        # Everything built goes in here
        nova_conf = Conf(fn)

        # Used more than once so we calculate it ahead of time
        hostip = self.installer.get_option('ip')

        nova_conf.add('verbose', self.installer.get_bool_option('verbose'))

        # Allow destination machine to match source for resize. 
        nova_conf.add('allow_resize_to_same_host', True)

        # Which scheduler do u want?
        nova_conf.add('compute_scheduler_driver',
                      self.installer.get_option('scheduler', default_value='nova.scheduler.filter_scheduler.FilterScheduler'))

        # Rate limit the api??
        nova_conf.add('api_rate_limit', self.installer.get_bool_option('api_rate_limit'))

        # Setup nova network/settings
        self._configure_network_settings(nova_conf)

        # Setup nova volume/settings
        if self.installer.get_option('volumes'):
            self._configure_vols(nova_conf)

        # The ip of where we are running
        nova_conf.add('my_ip', hostip)

        # Setup your sql connection
        dbdsn = dbhelper.fetch_dbdsn(dbname=DB_NAME,
                                     utf8=True,
                                     dbtype=self.installer.get_option('db', 'type'),
                                     **utils.merge_dicts(self.installer.get_option('db'),
                                                         dbhelper.get_shared_passwords(self.installer)))
        nova_conf.add('sql_connection', dbdsn)

        # Configure anything libvirt related?
        virt_driver = canon_virt_driver(self.installer.get_option('virt_driver'))
        if virt_driver == 'libvirt':
            self._configure_libvirt(lv.canon_libvirt_type(self.installer.get_option('libvirt_type')), nova_conf)

        # How instances will be presented
        instance_template = "%s%s" % (self.installer.get_option('instance_name_prefix'),
                                      self.installer.get_option('instance_name_postfix'))
        if not instance_template:
            instance_template = 'instance-%08x'
        nova_conf.add('instance_name_template', instance_template)

        # Enable the standard extensions
        nova_conf.add('osapi_compute_extension',
                      'nova.api.openstack.compute.contrib.standard_extensions')

        # Auth will be using keystone
        nova_conf.add('auth_strategy', 'keystone')

        # Don't always force images to raw
        nova_conf.add('force_raw_images', self.installer.get_bool_option('force_raw_images'))

        # Add a checksum for images fetched to a hypervisor
        nova_conf.add('checksum_base_images', self.installer.get_bool_option('checksum_base_images'))

        # Vnc settings setup
        self._configure_vnc(nova_conf)

        # Where our paste config is
        nova_conf.add('api_paste_config',
                      self.installer.target_config(PASTE_CONF))

        # What our imaging service will be
        self._configure_image_service(nova_conf, hostip)

        # Configs for ec2 / s3 stuff
        nova_conf.add('ec2_dmz_host', self.installer.get_option('ec2_dmz_host', default_value=hostip))
        nova_conf.add('s3_host', hostip)

        # How is your message queue setup?
        mq_type = canon_mq_type(self.installer.get_option('mq-type'))
        if mq_type == 'rabbit':
            nova_conf.add('rabbit_host', self.installer.get_option('rabbit', 'host', default_value=hostip))
            nova_conf.add('rabbit_password', rbhelper.get_shared_passwords(self.installer)['pw'])
            nova_conf.add('rabbit_userid', self.installer.get_option('rabbit', 'user_id'))
            nova_conf.add('rpc_backend', 'nova.rpc.impl_kombu')

        # Where instances will be stored
        instances_path = self.installer.get_option('instances_path')
        if not instances_path:
            instances_path = sh.joinpths(self.installer.get_option('component_dir'), 'instances')
        self._configure_instances_path(instances_path, nova_conf)

        # Is this a multihost setup?
        self._configure_multihost(nova_conf)

        # Handle any virt driver specifics
        self._configure_virt_driver(nova_conf)

        # Annnnnd extract to finish
        return self._get_content(nova_conf)
Exemple #11
0
    def generate(self, fn):

        # Everything built goes in here
        nova_conf = Conf(fn, self.installer)

        # Used more than once so we calculate it ahead of time
        hostip = self.installer.get_option('ip')

        nova_conf.add('verbose', self.installer.get_bool_option('verbose'))

        # Allow destination machine to match source for resize.
        nova_conf.add('allow_resize_to_same_host', True)

        # Which scheduler do u want?
        nova_conf.add(
            'compute_scheduler_driver',
            self.installer.get_option(
                'scheduler',
                default_value='nova.scheduler.filter_scheduler.FilterScheduler'
            ))

        # Rate limit the api??
        nova_conf.add('api_rate_limit',
                      self.installer.get_bool_option('api_rate_limit'))

        # Setup nova network/settings
        self._configure_network_settings(nova_conf)

        # Setup nova volume/settings
        if self.installer.get_option('volumes'):
            self._configure_vols(nova_conf)

        # The ip of where we are running
        nova_conf.add('my_ip', hostip)

        # Setup your sql connection
        dbdsn = dbhelper.fetch_dbdsn(
            dbname=DB_NAME,
            utf8=True,
            dbtype=self.installer.get_option('db', 'type'),
            **utils.merge_dicts(self.installer.get_option('db'),
                                dbhelper.get_shared_passwords(self.installer)))
        nova_conf.add('sql_connection', dbdsn)

        # Configure anything libvirt related?
        virt_driver = canon_virt_driver(
            self.installer.get_option('virt_driver'))
        if virt_driver == 'libvirt':
            self._configure_libvirt(
                lv.canon_libvirt_type(
                    self.installer.get_option('libvirt_type')), nova_conf)

        # How instances will be presented
        instance_template = "%s%s" % (
            self.installer.get_option('instance_name_prefix'),
            self.installer.get_option('instance_name_postfix'))
        if not instance_template:
            instance_template = 'instance-%08x'
        nova_conf.add('instance_name_template', instance_template)

        # Enable the standard extensions
        nova_conf.add(
            'osapi_compute_extension',
            'nova.api.openstack.compute.contrib.standard_extensions')

        # Auth will be using keystone
        nova_conf.add('auth_strategy', 'keystone')

        # Is config drive being forced?
        if self.installer.get_bool_option('force_cfg_drive'):
            nova_conf.add('force_config_drive', 'always')

        # Don't always force images to raw
        nova_conf.add('force_raw_images',
                      self.installer.get_bool_option('force_raw_images'))

        # Add a checksum for images fetched to a hypervisor
        nova_conf.add('checksum_base_images',
                      self.installer.get_bool_option('checksum_base_images'))

        # Vnc settings setup
        self._configure_vnc(nova_conf)

        # Where our paste config is
        nova_conf.add('api_paste_config',
                      self.installer.target_config(PASTE_CONF))

        # What our imaging service will be
        self._configure_image_service(nova_conf, hostip)

        # Configs for ec2 / s3 stuff
        nova_conf.add(
            'ec2_dmz_host',
            self.installer.get_option('ec2_dmz_host', default_value=hostip))
        nova_conf.add('s3_host', hostip)

        # How is your message queue setup?
        mq_type = canon_mq_type(self.installer.get_option('mq-type'))
        if mq_type == 'rabbit':
            nova_conf.add(
                'rabbit_host',
                self.installer.get_option('rabbit',
                                          'host',
                                          default_value=hostip))
            nova_conf.add('rabbit_password',
                          rbhelper.get_shared_passwords(self.installer)['pw'])
            nova_conf.add('rabbit_userid',
                          self.installer.get_option('rabbit', 'user_id'))
            nova_conf.add('rpc_backend', 'nova.rpc.impl_kombu')

        # The USB tablet device is meant to improve mouse behavior in
        # the VNC console, but it has the side effect of increasing
        # the CPU usage of an idle VM tenfold.
        nova_conf.add('use_usb_tablet', False)

        # Where instances will be stored
        instances_path = self.installer.get_option('instances_path')
        if not instances_path:
            instances_path = sh.joinpths(
                self.installer.get_option('component_dir'), 'instances')
        self._configure_instances_path(instances_path, nova_conf)

        # Is this a multihost setup?
        self._configure_multihost(nova_conf)

        # Handle any virt driver specifics
        self._configure_virt_driver(nova_conf)

        # Annnnnd extract to finish
        return self._get_content(nova_conf)
Exemple #12
0
 def warm_configs(self):
     rhelper.get_shared_passwords(self)
Exemple #13
0
 def warm_configs(self):
     mq_type = nhelper.canon_mq_type(self.get_option("mq-type"))
     if mq_type == "rabbit":
         rhelper.get_shared_passwords(self)
Exemple #14
0
 def warm_configs(self):
     rhelper.get_shared_passwords(self)