openstack几百个参数被广为诟病,我当初使用时也非常不爽。谁知道他们之间什么关系,对于初学者门槛实在是高了点,偶尔侥幸配置起来,也累地够呛。不过回头想想,毕竟是免费的,总要研究,彻底玩熟悉了才可以使用吧。这里就看看模块的参数。
一般参数配置在/etc/nova/nova.conf文件里面,格式为--${name}=${value}。如果从源码安装,/etc/nova/nova.conf文件根本就没有,倒是里面有个示列配置文件,不过还是太长了点。那么怎么查看每个模块的参数?方法如下:
[root@xgtest scripts]# pwd
/usr/lib/python2.6/site-packages/nova-2012.2-py2.6.egg/EGG-INFO/scripts
[root@xgtest scripts]#
[root@xgtest scripts]#
[root@xgtest scripts]# python nova-api --help
Usage: nova-api [options]
Options:
-h, --help show this help message and exit
--sql_connection_debug=SQL_CONNECTION_DEBUG
Verbosity of SQL debugging information. 0=None,
100=Everything
--compute_topic=COMPUTE_TOPIC
the topic compute nodes listen on
--glance_port=GLANCE_PORT
default glance port
--glance_api_servers=GLANCE_API_SERVERS
A list of the glance api servers available to nova
([hostname|ip]:port)
--osapi_compute_listen_port=OSAPI_COMPUTE_LISTEN_PORT
list port for osapi compute
--s3_dmz=S3_DMZ hostname or ip for the instances to use when accessing
the s3 api
--osapi_compute_listen=OSAPI_COMPUTE_LISTEN
IP address for OpenStack API to listen
--cache_images=CACHE_IMAGES
Cache glance images locally. `all` will cache all
images, `some` will only cache images that have the
image_property `cache_in_nova=True`, and `none` turns
off caching entirely
--aws_access_key_id=AWS_ACCESS_KEY_ID
AWS Access ID
--bandwith_poll_interval=BANDWITH_POLL_INTERVAL
interval to pull bandwidth usage info
--backdoor_port=BACKDOOR_PORT
port for eventlet backdoor to listen
--enable_new_services
Services to be added to the available pool on create
--noenable_new_services
The inverse of --enable_new_services
--my_ip=MY_IP ip address of this host
--ec2_dmz_host=EC2_DMZ_HOST
the internal ip of the ec2 api server
--password_length=PASSWORD_LENGTH
Length of generated instance admin passwords
--security_group_handler=SECURITY_GROUP_HANDLER
The full class name of the security group handler
class
--default_schedule_zone=DEFAULT_SCHEDULE_ZONE
availability zone to use when user doesn't specify one
--logdir=LOGDIR Log output to a per-service log file in named
directory
--osapi_volume_listen=OSAPI_VOLUME_LISTEN
IP address for OpenStack Volume API to listen
--sqlite_db=SQLITE_DB
the filename to use with sqlite
--osapi_compute_extension=OSAPI_COMPUTE_EXTENSION
osapi compute extension to load
--allow_resize_to_same_host
Allow destination machine to match source for resize.
Useful when testing in single-host environments.
--noallow_resize_to_same_host
The inverse of --allow_resize_to_same_host
--reclaim_instance_interval=RECLAIM_INSTANCE_INTERVAL
Interval in seconds for reclaiming deleted instances
--rootwrap_config=ROOTWRAP_CONFIG
Path to the rootwrap configuration file to use for
running commands as root
--osapi_max_limit=OSAPI_MAX_LIMIT
the maximum number of items returned in a single
response from a collection resource
--enable_instance_password
Allows use of instance password during server creation
--noenable_instance_password
The inverse of --enable_instance_password
--compute_api_class=COMPUTE_API_CLASS
The full class name of the compute API class to use
--default_access_ip_network_name=DEFAULT_ACCESS_IP_NETWORK_NAME
Name of network to use to set access ips for instances
--resume_guests_state_on_host_boot
Whether to start guests that were running before the
host rebooted
--noresume_guests_state_on_host_boot
The inverse of --resume_guests_state_on_host_boot
--ec2_listen=EC2_LISTEN
IP address for EC2 API to listen
--logfile=LOGFILE Log output to a named file
--floating_ip_dns_manager=FLOATING_IP_DNS_MANAGER
full class name for the DNS Manager for floating IPs
--periodic_fuzzy_delay=PERIODIC_FUZZY_DELAY
range of seconds to randomly delay when starting the
periodic task scheduler to reduce stampeding. (Disable
by setting to 0)
--snapshot_name_template=SNAPSHOT_NAME_TEMPLATE
Template string to be used to generate snapshot names
--metadata_host=METADATA_HOST
the ip for the metadata api server
-d, --debug Print debugging output
--nodebug The inverse of --debug
--osapi_volume_workers=OSAPI_VOLUME_WORKERS
Number of workers for OpenStack Volume API service
--volume_topic=VOLUME_TOPIC
the topic volume nodes listen on
--osapi_glance_link_prefix=OSAPI_GLANCE_LINK_PREFIX
Base URL that will be presented to users in links to
glance resources
--volume_name_template=VOLUME_NAME_TEMPLATE
Template string to be used to generate instance names
--lock_path=LOCK_PATH
Directory to use for lock files
--rpc_cast_timeout=RPC_CAST_TIMEOUT
Seconds to wait before a cast expires (TTL). Only
supported by impl_zmq.
--state_path=STATE_PATH
Top-level directory for maintaining nova's state
--metadata_manager=METADATA_MANAGER
OpenStack metadata service manager
--config-dir=DIR Path to a config directory to pull *.conf files from.
This file set is sorted, so as to provide a
predictable parse order if individual options are
over-ridden. The set is parsed after the file(s), if
any, specified via --config-file, hence over-ridden
options in the directory take precedence.
--log-config=PATH If this option is specified, the logging configuration
file specified is used and overrides any other logging
options specified. Please see the Python logging
module documentation for details on logging
configuration files.
--use_stderr Log output to standard error
--nouse_stderr The inverse of --use_stderr
--connection_type=CONNECTION_TYPE
Deprecated (use compute_driver instead):
Virtualization api connection type : libvirt, xenapi,
or fake
--default_project=DEFAULT_PROJECT
the default project to use for openstack
--s3_port=S3_PORT port used when accessing the s3 api
--logfile_mode=LOGFILE_MODE
Default file mode used when creating log files
--default_ephemeral_format=DEFAULT_EPHEMERAL_FORMAT
The default format an ephemeral_volume will be
formatted with on creation.
--logging_context_format_string=LOGGING_CONTEXT_FORMAT_STRING
format string to use for log messages with context
--metadata_listen_port=METADATA_LISTEN_PORT
port for metadata api to listen
--isolated_hosts=ISOLATED_HOSTS
Host reserved for specific images
--instance_name_template=INSTANCE_NAME_TEMPLATE
Template string to be used to generate instance names
--ec2_host=EC2_HOST the ip of the ec2 api server
--instance_usage_audit_period=INSTANCE_USAGE_AUDIT_PERIOD
time period to generate instance usages for. Time
period must be hour, day, month or year
--log-dir=LOG_DIR (Optional) The directory to keep log files in (will be
prepended to --logfile)
--cert_manager=CERT_MANAGER
full class name for the Manager for cert
--logging_debug_format_suffix=LOGGING_DEBUG_FORMAT_SUFFIX
data to append to log format when level is DEBUG
--stub_network Stub network related code
--nostub_network The inverse of --stub_network
--console_manager=CONSOLE_MANAGER
full class name for the Manager for console proxy
--zombie_instance_updated_at_window=ZOMBIE_INSTANCE_UPDATED_AT_WINDOW
Number of seconds zombie instances are cleaned up.
--rpc_backend=RPC_BACKEND
The messaging module to use, defaults to kombu.
--default_log_levels=DEFAULT_LOG_LEVELS
list of logger=LEVEL pairs
--osapi_volume_extension=OSAPI_VOLUME_EXTENSION
osapi volume extension to load
--osapi_scheme=OSAPI_SCHEME
the protocol to use when connecting to the openstack
api server (http, https)
--sql_connection=SQL_CONNECTION
The SQLAlchemy connection string used to connect to
the database
--console_topic=CONSOLE_TOPIC
the topic console proxy nodes listen on
--api_rate_limit whether to rate limit the api
--noapi_rate_limit The inverse of --api_rate_limit
--host=HOST Name of this node. This can be an opaque identifier.
It is not necessarily a hostname, FQDN, or IP address.
However, the node name must be valid within an AMQP
key, and if using ZeroMQ, a valid hostname, FQDN, or
IP address
--instance_dns_domain=INSTANCE_DNS_DOMAIN
full class name for the DNS Zone for instance IPs
--non_inheritable_image_properties=NON_INHERITABLE_IMAGE_PROPERTIES
These are image properties which a snapshot should not
inherit from an instance
--fatal_deprecations make deprecations fatal
--nofatal_deprecations
The inverse of --fatal_deprecations
--glance_num_retries=GLANCE_NUM_RETRIES
Number retries when downloading an image from glance
--db_backend=DB_BACKEND
The backend to use for db
--sql_retry_interval=SQL_RETRY_INTERVAL
interval between retries of opening a sql connection
--monkey_patch Whether to log monkey patching
--nomonkey_patch The inverse of --monkey_patch
--rpc_conn_pool_size=RPC_CONN_POOL_SIZE
Size of RPC connection pool
--s3_host=S3_HOST hostname or ip for openstack to use when accessing the
s3 api
--osapi_compute_workers=OSAPI_COMPUTE_WORKERS
Number of workers for OpenStack API service
--sqlite_synchronous If passed, use synchronous mode for sqlite
--nosqlite_synchronous
The inverse of --sqlite_synchronous
--scheduler_topic=SCHEDULER_TOPIC
the topic scheduler nodes listen on
-v, --verbose Print more verbose output
--noverbose The inverse of --verbose
整理下有134项配置
1 sql_connection_debug
2 compute_topic
3 glance_port
4 glance_api_servers
5 osapi_compute_listen_port
6 s3_dmz
7 osapi_compute_listen
8 cache_images
9 aws_access_key_id
10 bandwith_poll_interval
11 backdoor_port
12 my_ip
13 ec2_dmz_host
14 password_length
15 security_group_handler
16 default_schedule_zone
17 logdir
18 osapi_volume_listen
19 sqlite_db
20 osapi_compute_extension
21 reclaim_instance_interval
22 rootwrap_config
23 osapi_max_limit
24 compute_api_class
25 default_access_ip_network_name
26 ec2_listen
27 logfile
28 floating_ip_dns_manager
29 periodic_fuzzy_delay
30 snapshot_name_template
31 metadata_host
32 osapi_volume_workers
33 volume_topic
34 osapi_glance_link_prefix
35 volume_name_template
36 lock_path
37 rpc_cast_timeout
38 state_path
39 metadata_manager
40 config-dir
41 log-config
42 connection_type
43 default_project
44 s3_port
45 logfile_mode
46 default_ephemeral_format
47 logging_context_format_string
48 metadata_listen_port
49 isolated_hosts
50 instance_name_template
51 ec2_host
52 instance_usage_audit_period
53 log-dir
54 cert_manager
55 logging_debug_format_suffix
56 console_manager
57 zombie_instance_updated_at_window
58 rpc_backend
59 default_log_levels
60 osapi_volume_extension
61 osapi_scheme
62 sql_connection
63 console_topic
64 host
65 instance_dns_domain
66 non_inheritable_image_properties
67 glance_num_retries
68 db_backend
69 sql_retry_interval
70 rpc_conn_pool_size
71 s3_host
72 osapi_compute_workers
73 scheduler_topic
74 sql_max_retries
75 default_instance_type
76 metadata_listen
77 firewall_driver
78 metadata_workers
79 periodic_interval
80 vpn_key_suffix
81 osapi_volume_listen_port
82 null_kernel
83 instance_format
84 osapi_compute_link_prefix
85 rpc_response_timeout
86 osapi_compute_ext_list
87 service_down_time
88 logging_exception_prefix
89 enabled_apis
90 volume_api_class
91 report_interval
92 scheduler_manager
93 ec2_port
94 monkey_patch_modules
95 auth_token_ttl
96 ec2_listen_port
97 ec2_scheme
98 vpn_image_id
99 allowed_rpc_exception_modules
100 cert_topic
101 instance_dns_manager
102 sql_idle_timeout
103 glance_host
104 default_image
105 aws_secret_access_key
106 log-format
107 metadata_port
108 region_list
109 ec2_workers
110 network_manager
111 root_helper
112 memcached_servers
113 logging_default_format_string
114 osapi_volume_ext_list
115 log-date-format
116 osapi_path
117 syslog-log-facility
118 ec2_path
119 bindir
120 auth_strategy
121 config-file
122 network_api_class
123 node_availability_zone
124 instance_uuid_format
125 volume_manager
126 pybasedir
127 rpc_thread_pool_size
128 isolated_images
129 api_paste_config
130 network_driver
131 control_exchange
132 log-file
133 compute_manager
134 network_topic
------------------------------------------------------------------------------------
这里给个可以让nova-api起来的配置
python nova-api --glance_port=9292 --glance_api_servers=10.28.163.158:9292 --osapi_compute_listen_port=8774 --osapi_compute_listen=0.0.0.0 --osapi_compute_listen_port=8774 --ec2_dmz_host=169.254.169.254 --osapi_volume_listen=0.0.0.0 --osapi_volume_listen_port=8776 --ec2_listen=0.0.0.0 --ec2_listen_port=8773 --lock_path=/var/lock/nova --state_path=/home/nova --connection_type=libvirt --metadata_listen_port=8775 --log-dir=/var/log/nova --sql_connection=mysql://nova:nova@10.28.163.158/nova --glance_host=10.28.163.158 --ec2_dmz_host=169.254.169.254 --default_instance_type=6 --metadata_listen=0.0.0.0 --metadata_listen_port=8775 --osapi_volume_listen_port=8776 --ec2_listen_port=8773 --glance_host=10.28.163.158 --network_manager=nova.network.manager.FlatDHCPManager --root_helper=sudo --bindir=/usr/bin --auth_strategy=keystone --node_availability_zone=nova --api_paste_config=/etc/nova/api-paste.ini
获取模块参数可以这样:
python nova-compute --help |grep "\-\-" |awk '{print $1}' |grep "\-\-" |awk -F "=" '{print $1}' |awk -F "--" '{print $2}' > /tmp/nova_compute.txt