The nova.service Module

Generic Node base class for all workers that run on hosts.

class Service(host, binary, topic, manager, report_interval=None, periodic_enable=None, periodic_fuzzy_delay=None, periodic_interval_max=None, db_allowed=True, *args, **kwargs)

Bases: oslo_service.service.Service

Service object for binaries running on hosts.

A service takes a manager and enables rpc by listening to queues based on topic. It also periodically runs tasks on the manager and reports its state to the database services table.

basic_config_check()

Perform basic config checks before starting processing.

classmethod create(host=None, binary=None, topic=None, manager=None, report_interval=None, periodic_enable=None, periodic_fuzzy_delay=None, periodic_interval_max=None, db_allowed=True)

Instantiates class and passes back application object.

Parameters:
  • host – defaults to CONF.host
  • binary – defaults to basename of executable
  • topic – defaults to bin_name - ‘nova-‘ part
  • manager – defaults to CONF.<topic>_manager
  • report_interval – defaults to CONF.report_interval
  • periodic_enable – defaults to CONF.periodic_enable
  • periodic_fuzzy_delay – defaults to CONF.periodic_fuzzy_delay
  • periodic_interval_max – if set, the max time to wait between runs
kill()

Destroy the service object in the datastore.

NOTE: Although this method is not used anywhere else than tests, it is convenient to have it here, so the tests might easily and in clean way stop and remove the service_ref.

periodic_tasks(raise_on_error=False)

Tasks to be run at a periodic interval.

reset()
start()
stop()
class WSGIService(name, loader=None, use_ssl=False, max_url_len=None)

Bases: oslo_service.service.Service

Provides ability to launch API from a ‘paste’ configuration.

reset()

Reset server greenpool size to default.

Returns:None
start()

Start serving this service using loaded configuration.

Also, retrieve updated port number in case ‘0’ was passed in, which indicates a random port should be used.

Returns:None
stop()

Stop serving this API.

Returns:None
wait()

Wait for the service to stop serving this API.

Returns:None
process_launcher()
serve(server, workers=None)
wait()

Previous topic

The nova.scheduler.weights.ram Module

Next topic

The nova.servicegroup.api Module

Project Source

This Page