Nova servers should have separate configuration files
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Opinion
|
Wishlist
|
Unassigned | ||
oslo-incubator |
Fix Released
|
Wishlist
|
Davanum Srinivas (DIMS) | ||
Grizzly |
Fix Released
|
Wishlist
|
Davanum Srinivas (DIMS) |
Bug Description
Nova servers should have separate configuration files and use common bind_host/
In addition to simplifying configuration, we can get the following benefits:
* Would be able to use a standard WSGI Server class
* Would be able to take advantage of the SSL and socket-wrapping work done in Glance and Swift
* Would be able to take advantage of the multi-processed servers in Glance and Swift
Essentially, each server/service config would have this:
[DEFAULT]
# Address to bind the server
bind_host = 0.0.0.0
# Port the bind the server to
bind_port = 9292
# Backlog requests when creating socket
backlog = 4096
# Number of worker processes to start.
# On machines with more than one CPU increasing this value
# may improve performance (especially if using SSL with
# compression turned on). It is typically recommended to set
# this value to the number of CPUs present on your machine.
workers = 0
as well as (eventually) all the SSL configuration options like cert_file, key_file, etc
No need for duplicate cfg options for all the different services. Instead, all the services define a common bind_host / bind_port and the WSGI socket handling code can be standardized to what is in Glance (and Swift without the openstack-common cfg module...):
bind_opts = [
cfg.
cfg.
]
socket_opts = [
cfg.
cfg.
cfg.
]
workers_opt = cfg.IntOpt(
def get_bind_addr(conf, default_port=None):
"""Return the host and port to bind to."""
conf.
return (conf.bind_host, conf.bind_port or default_port)
def get_socket(conf, default_port):
"""
Bind socket to bind ip:port in conf
note: Mostly comes from Swift with a few small changes...
:param conf: a cfg.ConfigOpts object
:param default_port: port to bind to if none is specified in conf
:returns : a socket object as returned from socket.listen or
"""
bind_addr = get_bind_addr(conf, default_port)
# TODO(jaypipes): eventlet's greened socket module does not actually
# support IPv6 in getaddrinfo(). We need to get around this in the
# future or monitor upstream for a fix
address_family = [addr[0] for addr in socket.
if addr[0] in (socket.AF_INET, socket.
conf.
cert_file = conf.cert_file
key_file = conf.key_file
use_ssl = cert_file or key_file
if use_ssl and (not cert_file or not key_file):
raise RuntimeError(
sock = None
retry_until = time.time() + 30
while not sock and time.time() < retry_until:
try:
sock = eventlet.
if use_ssl:
except socket.error, err:
if err.args[0] != errno.EADDRINUSE:
if not sock:
raise RuntimeError(
sock.
# in my experience, sockets can hang around forever without keepalive
sock.
# This option isn't available in the OS X version of eventlet
if hasattr(socket, 'TCP_KEEPIDLE'):
return sock
Changed in nova: | |
importance: | Undecided → Wishlist |
status: | New → Confirmed |
Changed in nova: | |
status: | New → Confirmed |
assignee: | nobody → Davanum Srinivas (DIMS) (dims-v) |
Changed in oslo: | |
status: | Confirmed → In Progress |
Changed in nova: | |
importance: | Undecided → Wishlist |
Changed in oslo: | |
status: | In Progress → Confirmed |
Changed in nova: | |
assignee: | Davanum Srinivas (DIMS) (dims-v) → nobody |
Changed in oslo: | |
assignee: | Davanum Srinivas (DIMS) (dims-v) → nobody |
Changed in oslo: | |
assignee: | nobody → Davanum Srinivas (DIMS) (dims-v) |
status: | Confirmed → In Progress |
Changed in oslo: | |
milestone: | none → grizzly-3 |
status: | Fix Committed → Fix Released |
Should probably start from the glance copy of this code - https:/ /github. com/openstack/ glance/ blob/master/ glance/ common/ wsgi.py