diff --git a/README.md b/README.md index 8b7232755..d42dc4dc9 100644 --- a/README.md +++ b/README.md @@ -188,8 +188,6 @@ NOTE: service password is no longer set statically in the attributes file, but s * `nova["services"]["volume"]["path"]` - URI to use * `nova["services"]["volume"]["cinder_catalog_info"]` - URL used for cinder -* `nova["compute"]["region"]` - Region name, defaults to RegionOne - * `nova["scheduler"]["scheduler_driver"]` - The scheduler driver to use NOTE: The filter scheduler currently does not work with ec2. * `nova["scheduler"]["scheduler_weight_classes"]` - A list of weight class names (separated by commas) to use for weighing hosts, defaults to nova.scheduler.weights.ram.RAMWeigher @@ -206,11 +204,15 @@ NOTE: The filter scheduler currently does not work with ec2. * `nova["libvirt"]["libvirt_inject_key"]` - Inject ssh public key at boot? * `nova["libvirt"]["libvirt_inject_password"]` - Inject root password at boot? * `nova["libvirt"]["libvirt_inject_partition"]` - The partition to inject to: -2 = disable, -1 = inspect (libguestfs only), 0 = not partitioned, >0 = partition number +* `nova["libvirt"]["libvirt_cpu_mode"]` - Options include "host-model", "host-passthrough", "custom", and "none"; cookbook defaults to nil and does not insert into nova.conf unless adjusted +* `nova["libvirt"]["libvirt_cpu_model"]` - This attribute is only applicable when `virt_type` is "kvm" or "qemu" and `libvirt_cpu_mode` is "custom"; cookbook defaults to nil and does not insert into nova.conf unless changed and applicable * `nova["libvirt"]["disk_cachemodes"]` - KVM disk caching modes. Defaults to "file=none". To set writeback mode use "file=writeback". To set multiple modes use "file=writeback,block=none" * `nova["config"]["use_single_default_gateway"]` - Use single default gateway? * `nova["config"]["availability_zone"]` - Nova availability zone. Usually set at the node level to place a compute node in another az * `nova["config"]["default_schedule_zone"]` - The availability zone to schedule instances in when no az is specified in the request * `nova["config"]["force_raw_images"]` - Convert all images used as backing files for instances to raw (we default to false) +* `nova["config"]["libvirt_images_type"]` - VM backing file format. If set to default the use_cow_images is used. Possible values are raw, qcow2, lvm, rbd . +* `nova["config"]["preallocate_images"]` - Pre-allocate VM backing image if set to 'space' (default to none) * `nova["config"]["allow_same_net_traffic"]` - Disable security groups for internal networks (we default to true) * `nova["config"]["osapi_max_limit"]` - The maximum number of items returned in a single response from a collection resource (default is 1000) * `nova["config"]["cpu_allocation_ratio"]` - Virtual CPU to Physical CPU allocation ratio (default 16.0) diff --git a/VERSION b/VERSION index 6aba2b245..af8c8ec7c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.0 +4.2.2 diff --git a/attributes/default.rb b/attributes/default.rb index 6a3a4c360..16c2c09b6 100755 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -50,6 +50,13 @@ default["nova"]["services"]["admin-api"]["port"] = 8774 default["nova"]["services"]["admin-api"]["path"] = "/v2/%(tenant_id)s" +default["nova"]["services"]["api-metadata"]["scheme"] = "http" +# TODO(breu): do we need network here? +default["nova"]["services"]["api-metadata"]["network"] = "management" +default["nova"]["services"]["api-metadata"]["port"] = 8775 +# TODO(breu): do we need path here? +default["nova"]["services"]["api-metadata"]["path"] = "/" + default["nova"]["services"]["ec2-admin"]["scheme"] = "http" default["nova"]["services"]["ec2-admin"]["network"] = "public" default["nova"]["services"]["ec2-admin"]["port"] = 8773 @@ -91,8 +98,6 @@ default["nova"]["services"]["volume"]["path"] = "/v1/%(tenant_id)s" default["nova"]["services"]["volume"]["cinder_catalog_info"] = "volume:cinder:publicURL" -# can this be wedged into the "api" endpoint? -default["nova"]["compute"]["region"] = "RegionOne" default["nova"]["compute"]["connection_type"] = "libvirt" default["nova"]["scheduler"]["scheduler_driver"] = "nova.scheduler.filter_scheduler.FilterScheduler" @@ -107,6 +112,7 @@ "DifferentHostFilter", "RetryFilter" ] +default["nova"]["scheduler"]["scheduler_host_subset_size"] = 1 default["nova"]["libvirt"]["virt_type"] = "kvm" default["nova"]["libvirt"]["vncserver_listen"] = nil @@ -118,12 +124,17 @@ default["nova"]["libvirt"]["checksum_base_images"] = false default["nova"]["libvirt"]["libvirt_inject_key"] = false default["nova"]["libvirt"]["libvirt_inject_password"] = false -default["nova"]["libvirt"]["libvirt_inject_partition"] = 1 +default["nova"]["libvirt"]["libvirt_inject_partition"] = -2 +default["nova"]["libvirt"]["libvirt_cpu_mode"] = nil +default["nova"]["libvirt"]["libvirt_cpu_model"] = nil default["nova"]["libvirt"]["disk_cachemodes"] = ["file=none"] +default["nova"]["libvirt"]["block_migration_flag"] = "VIR_MIGRATE_UNDEFINE_SOURCE, VIR_MIGRATE_PEER2PEER, VIR_MIGRATE_NON_SHARED_INC" default["nova"]["config"]["use_single_default_gateway"] = false default["nova"]["config"]["availability_zone"] = "nova" default["nova"]["config"]["default_schedule_zone"] = "nova" default["nova"]["config"]["force_raw_images"] = false +default["nova"]["config"]["libvirt_images_type"] = "default" +default["nova"]["config"]["preallocate_images"] = "none" default["nova"]["config"]["allow_same_net_traffic"] = true default["nova"]["config"]["osapi_max_limit"] = 1000 default["nova"]["config"]["cpu_allocation_ratio"] = 16.0 @@ -144,19 +155,49 @@ # requires https://review.openstack.org/#/c/8423/ default["nova"]["config"]["resume_guests_state_on_host_boot"] = false default["nova"]["config"]["force_config_drive"] = false +default["nova"]["config"]["config_drive_format"] = "iso9660" default['nova']['config']['image_cache_manager_interval'] = 2400 default["nova"]["config"]["max_age"] = 0 default["nova"]["config"]["reserved_host_disk_mb"] = 0 # LOGGING VERBOSITY +# # in order of verbosity (most to least) # DEBUG, INFO, WARNING, ERROR, CRITICAL default["nova"]["config"]["log_verbosity"] = "INFO" -# quota settings +# QUOTA SETTINGS +# default["nova"]["config"]["quota_security_groups"] = 50 default["nova"]["config"]["quota_security_group_rules"] = 20 +# DB CONNECTION SETTINGS +# +# (IntOpt) Verbosity of SQL debugging information. 0=None, 100=Everything +default["nova"]["config"]["sql_connection_debug"] = 0 + +# (IntOpt) Timeout before idle sql connections are reaped +default["nova"]["config"]["sql_idle_timeout"] = 3600 + +# (IntOpt) Interval between retries of opening a sql connection +default["nova"]["config"]["sql_retry_interval"] = 10 + +# (IntOpt) Maximum db connection retries during startup. +# Setting -1 implies an infinite retry count. +default["nova"]["config"]["sql_max_retries"] = 10 + +# (IntOpt) Minimum number of SQL connections to keep open in a pool +default["nova"]["config"]["sql_min_pool_size"] = 1 + +# (IntOpt) If set, Maximum number of SQL connections to keep open in a pool +#default["nova"]["config"]["sql_max_pool_size"] = 5 + +# (IntOpt) If set, use this value for max_overflow with sqlalchemy +# http://docs.sqlalchemy.org/en/rel_0_9/core/pooling.html#sqlalchemy.pool.QueuePool +#default["nova"]["config"]["sql_max_overflow"] = 10 + +# NOVA RATELIMIT SETTINGS +# default["nova"]["ratelimit"]["settings"] = { "generic-post-limit" => { "verb" => "POST", "uri" => "*", "regex" => ".*", "limit" => "10", "interval" => "MINUTE" }, "create-servers-limit" => { "verb" => "POST", "uri" => "*/servers", "regex" => "^/servers", "limit" => "50", "interval" => "DAY" }, @@ -303,10 +344,10 @@ "iscsi_helper" => "tgtadm", "iscsi_service" => "tgt", # README(shep): python-libvirt does not get automatically upgraded - "libvirt_packages" => ["libvirt-bin", "python-libvirt", "pm-utils"], + "libvirt_packages" => ["libvirt-bin", "python-libvirt", "pm-utils", "sysfsutils"], "libvirt_service" => "libvirt-bin", "mysql_service" => "mysql", - "package_options" => + "package_options" => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'" } default["nova"]["ssl"]["dir"] = "/etc/ssl" diff --git a/files/default/ec2api_modwsgi.py b/files/default/ec2api_modwsgi.py index a44c86227..f510411aa 100644 --- a/files/default/ec2api_modwsgi.py +++ b/files/default/ec2api_modwsgi.py @@ -2,7 +2,7 @@ from nova import config from paste import deploy -config_files = ['/etc/nova/api-paste.ini', '/etc/nova/nova.comf'] +config_files = ['/etc/nova/api-paste.ini', '/etc/nova/nova.conf'] config.parse_args([], default_config_files=config_files) LOG = logging.getLogger(__name__) diff --git a/files/default/novncproxy.ico b/files/default/novncproxy.ico new file mode 100644 index 000000000..c999634f0 Binary files /dev/null and b/files/default/novncproxy.ico differ diff --git a/providers/conf.rb b/providers/conf.rb index 1165e5de7..12978e457 100755 --- a/providers/conf.rb +++ b/providers/conf.rb @@ -7,7 +7,7 @@ Chef::Log.info("Creating #{new_resource.name}") # Search for mysql endpoint info - mysql_info = get_access_endpoint("mysql-master", "mysql", "db") + mysql_info = get_mysql_endpoint # Search for rabbit endpoint info rabbit_info = get_access_endpoint("rabbitmq-server", "rabbitmq", "queue") @@ -28,6 +28,9 @@ # Get endpoint info for nova-api api_bind = get_bind_endpoint("nova", "api") + # Get the socket bind information for nova-api-metadata + metadata_api_bind = get_bind_endpoint("nova", "api-metadata") + # Get endpoint info for nova-api-ec2 ec2_bind = get_bind_endpoint("nova", "ec2-public") @@ -93,6 +96,7 @@ network_options["dmz_cidr"] = node[net_provider]["network"]["dmz_cidr"] network_options["force_dhcp_release"] = node[net_provider]["network"]["force_dhcp_release"] network_options["send_arp_for_ha"] = node[net_provider]["network"]["send_arp_for_ha"] + network_options["send_arp_for_ha_count"] = node[net_provider]["network"]["send_arp_for_ha_count"] network_options["auto_assign_floating_ip"] = node[net_provider]["network"]["auto_assign_floating_ip"] network_options["dhcp_domain"] = node[net_provider]["network"]["dhcp_domain"] network_options["dhcpbridge_flagfile"] = "/etc/nova/nova.conf" @@ -188,6 +192,7 @@ "scheduler_default_filters" => node["nova"]["scheduler"]["default_filters"].join(","), "scheduler_weight_classes" => node["nova"]["scheduler"]["scheduler_weight_classes"], "scheduler_ram_weight_multiplier" => node["nova"]["scheduler"]["ram_weight_multiplier"], + "scheduler_host_subset_size" => node["nova"]["scheduler"]["scheduler_host_subset_size"], "availability_zone" => node["nova"]["config"]["availability_zone"], "default_schedule_zone" => node["nova"]["config"]["default_schedule_zone"], "connection_type" => node["nova"]["compute"]["connection_type"], @@ -200,7 +205,12 @@ "libvirt_inject_key" => node["nova"]["libvirt"]["libvirt_inject_key"], "libvirt_inject_password" => node["nova"]["libvirt"]["libvirt_inject_password"], "libvirt_inject_partition" => node["nova"]["libvirt"]["libvirt_inject_partition"], + "block_migration_flag" => node["nova"]["libvirt"]["block_migration_flag"], + "libvirt_cpu_mode" => node["nova"]["libvirt"]["libvirt_cpu_mode"], + "libvirt_cpu_model" => node["nova"]["libvirt"]["libvirt_cpu_model"], "force_raw_images" => node["nova"]["config"]["force_raw_images"], + "libvirt_images_type" => node["nova"]["config"]["libvirt_images_type"], + "preallocate_images" => node["nova"]["config"]["preallocate_images"], "allow_same_net_traffic" => node["nova"]["config"]["allow_same_net_traffic"], "quota_instances" => node["nova"]["config"]["quota_instances"], "quota_fixed_ips" => node["nova"]["config"]["quota_fixed_ips"], @@ -219,7 +229,10 @@ "scheduler_max_attempts" => node["nova"]["config"]["scheduler_max_attempts"], "vpn_image_id" => node["nova"]["config"]["vpn_image_id"], "force_config_drive" => node["nova"]["config"]["force_config_drive"], + "config_drive_format" => node["nova"]["config"]["config_drive_format"], "cinder_catalog_info" => node["nova"]["services"]["volume"]["cinder_catalog_info"], + "metadata_listen" => metadata_api_bind["host"], + "metadata_listen_port" => metadata_api_bind["port"], "osapi_compute_listen" => api_bind["host"], "osapi_compute_listen_port" => api_bind["port"], "ec2_listen" => ec2_bind["host"], @@ -230,7 +243,14 @@ "memcached_servers" => memcached_servers, "image_cache_manager_interval" => node["nova"]["config"]["image_cache_manager_interval"], "max_age" => node["nova"]["config"]["max_age"], - "reserved_host_disk_mb" => node["nova"]["config"]["reserved_host_disk_mb"] + "reserved_host_disk_mb" => node["nova"]["config"]["reserved_host_disk_mb"], + "sql_connection_debug" => node["nova"]["config"]["sql_connection_debug"], + "sql_idle_timeout" => node["nova"]["config"]["sql_idle_timeout"], + "sql_retry_interval" => node["nova"]["config"]["sql_retry_interval"], + "sql_max_retries" => node["nova"]["config"]["sql_max_retries"], + "sql_min_pool_size" => node["nova"]["config"]["sql_min_pool_size"], + "sql_max_pool_size" => node["nova"]["config"]["sql_max_pool_size"] || nil, + "sql_max_overflow" => node["nova"]["config"]["sql_max_overflow"] || nil ) end new_resource.updated_by_last_action(t.updated_by_last_action?) diff --git a/recipes/api-ec2.rb b/recipes/api-ec2.rb index 050d66f31..34052da40 100644 --- a/recipes/api-ec2.rb +++ b/recipes/api-ec2.rb @@ -157,9 +157,9 @@ api_ver ks_admin_endpoint["path"] auth_token keystone["admin_token"] service_type "ec2" - endpoint_region node["nova"]["compute"]["region"] + endpoint_region node["osops"]["region"] endpoint_adminurl ec2_admin_endpoint["uri"] endpoint_internalurl ec2_public_endpoint["uri"] endpoint_publicurl ec2_public_endpoint["uri"] - action :create + action :recreate end diff --git a/recipes/api-os-compute.rb b/recipes/api-os-compute.rb index 079dcd853..b79fc6132 100644 --- a/recipes/api-os-compute.rb +++ b/recipes/api-os-compute.rb @@ -157,11 +157,11 @@ api_ver ks_admin_endpoint["path"] auth_token keystone["admin_token"] service_type "compute" - endpoint_region node["nova"]["compute"]["region"] + endpoint_region node["osops"]["region"] endpoint_adminurl api_admin_endpoint["uri"] endpoint_internalurl api_internal_endpoint["uri"] endpoint_publicurl api_endpoint["uri"] - action :create + action :recreate end include_recipe "nova::nova-osapi-patch" diff --git a/recipes/compute.rb b/recipes/compute.rb index f1247d3eb..6e2910c81 100644 --- a/recipes/compute.rb +++ b/recipes/compute.rb @@ -93,17 +93,6 @@ include_recipe "nova::libvirt" -# The bridge checksum issue is fixed with a fill-checksum -# rule in grizzly (also fixed in upstream libvirt), at least -# in ubuntu - -execute "remove vhost-net module" do - command "rmmod vhost_net" - notifies :restart, "service[nova-compute]" - notifies :restart, "service[libvirt-bin]" - only_if { node["kernel"]["modules"].has_key?('vhost_net') and node["platform_family"] == "rhel" } -end - # Sysctl tunables sysctl_multi "nova" do instructions "net.ipv4.ip_forward" => "1" diff --git a/recipes/nova-common.rb b/recipes/nova-common.rb index 64aad0866..58c420799 100644 --- a/recipes/nova-common.rb +++ b/recipes/nova-common.rb @@ -77,7 +77,7 @@ "password" => keystone["users"][keystone["admin_user"]]["password"], "keystone_auth_uri" => ks_internal_endpoint["uri"], "nova_api_version" => "1.1", - "keystone_region" => node["nova"]["compute"]["region"], + "nova_region" => node["osops"]["region"], "auth_strategy" => "keystone", "ec2_url" => ec2_public_endpoint["uri"], "ec2_access_key" => ec2_creds["EC2"][keystone['admin_user']]["access"], diff --git a/recipes/vncproxy.rb b/recipes/vncproxy.rb index d8b5ee802..a8bca7f10 100644 --- a/recipes/vncproxy.rb +++ b/recipes/vncproxy.rb @@ -95,3 +95,10 @@ owner "root" group "root" end + +cookbook_file "/usr/share/novnc/favicon.ico" do + source "novncproxy.ico" + mode 0644 + owner "root" + group "root" +end diff --git a/templates/default/nova.conf.erb b/templates/default/nova.conf.erb index c0114b0a7..2e90de6fe 100755 --- a/templates/default/nova.conf.erb +++ b/templates/default/nova.conf.erb @@ -41,6 +41,8 @@ glance_api_servers=<%= @glance_serverlist %> ##### MISC ##### # force backing images to raw format force_raw_images=<%= @force_raw_images %> +libvirt_images_type=<%= @libvirt_images_type %> +preallocate_images=<%= @preallocate_images %> allow_same_net_traffic=<%= @allow_same_net_traffic %> osapi_max_limit=<%= @osapi_max_limit %> snapshot_image_format=<%= @snapshot_image_format %> @@ -56,6 +58,7 @@ max_age=<%= @max_age %> rpc_backend=nova.openstack.common.rpc.impl_kombu <% if @force_config_drive -%> force_config_drive=<%= @force_config_drive %> +config_drive_format=<%= @config_drive_format %> <% end -%> <% unless @memcached_servers.nil? -%> memcached_servers=<%= @memcached_servers %> @@ -103,6 +106,8 @@ cinder_catalog_info=<%= @cinder_catalog_info %> ##### API ##### ec2_workers=<%= node["nova"]["config"]["ec2_workers"] %> osapi_compute_workers=<%= node["nova"]["config"]["osapi_compute_workers"] %> +metadata_listen=<%= @metadata_listen %> +metadata_listen_port=<%= @metadata_listen_port %> metadata_workers=<%= node["nova"]["config"]["metadata_workers"] %> osapi_volume_workers=<%= node["nova"]["config"]["osapi_volume_workers"] %> osapi_compute_listen=<%= @osapi_compute_listen %> @@ -119,7 +124,7 @@ ec2_private_dns_show_ip=True <% if @iscsi_use_multipath == true -%> ##### EMC Multi-Path #### libvirt_iscsi_use_multipath = "True" -<% end %> +<% end -%> ##### CEILOMETER ##### <% if @use_ceilometer.to_s.capitalize() == "True" -%> @@ -130,3 +135,17 @@ notification_driver=ceilometer.compute.nova_notifier <% else -%> # disabled because ceilometer::ceilometer-compute is not in the run_list <% end -%> + +##### DATABASE CONNECTIONS ##### +[DATABASE] +connection_debug=<%= @sql_connection_debug %> +idle_timeout=<%= @sql_idle_timeout %> +retry_interval=<%= @sql_retry_interval %> +max_retries=<%= @sql_max_retries %> +min_pool_size=<%= @sql_min_pool_size %> +<% if @sql_max_pool_size -%> +max_pool_size=<%= @sql_max_pool_size %> +<% end -%> +<% if @sql_max_overflow -%> +max_overflow=<%= @sql_max_overflow %> +<% end -%> diff --git a/templates/default/openrc.erb b/templates/default/openrc.erb index b169a5d4f..3cbc3a22f 100644 --- a/templates/default/openrc.erb +++ b/templates/default/openrc.erb @@ -19,7 +19,7 @@ export NOVA_PASSWORD=${OS_PASSWORD} export NOVA_API_KEY=${OS_PASSWORD} export NOVA_URL=${OS_AUTH_URL} export NOVA_VERSION=<%= @nova_api_version %> -export NOVA_REGION_NAME=<%= @keystone_region %> +export NOVA_REGION_NAME=<%= @nova_region %> # EUCA2OOLs ENV VARIABLES export EC2_ACCESS_KEY=<%= @ec2_access_key %> diff --git a/templates/default/partials/compute-options.partial.erb b/templates/default/partials/compute-options.partial.erb index a1b25bfe0..f7fe659f0 100644 --- a/templates/default/partials/compute-options.partial.erb +++ b/templates/default/partials/compute-options.partial.erb @@ -10,7 +10,14 @@ libvirt_type=<%= @virt_type %> libvirt_inject_key=<%= @libvirt_inject_key %> libvirt_inject_password=<%= @libvirt_inject_password %> libvirt_inject_partition=<%= @libvirt_inject_partition %> +<% if not @libvirt_cpu_mode.nil? -%> +libvirt_cpu_mode=<%= @libvirt_cpu_mode %> +<% end %> +<% if @libvirt_cpu_mode == "custom" and %w{kvm qemu}.include?(@virt_type) -%> +libvirt_cpu_model=<%= @libvirt_cpu_model %> +<% end %> disk_cachemodes="<%= @disk_cachemodes.sort.join(',') %>" +block_migration_flag=<%= @block_migration_flag %> <% end -%> # Command prefix to use for running commands as root (default: sudo) rootwrap_config=/etc/nova/rootwrap.conf diff --git a/templates/default/partials/scheduler-options.partial.erb b/templates/default/partials/scheduler-options.partial.erb index 3bf2a5bbb..11c31c3f1 100644 --- a/templates/default/partials/scheduler-options.partial.erb +++ b/templates/default/partials/scheduler-options.partial.erb @@ -9,5 +9,6 @@ scheduler_weight_classes=<%= @scheduler_weight_classes %> /all_weighers/.match(@scheduler_weight_classes) %> ram_weight_multiplier=<%= @scheduler_ram_weight_multiplier %> <%- end %> +scheduler_host_subset_size=<%= @scheduler_host_subset_size %> default_availability_zone=<%= @availability_zone %> default_schedule_zone=<%= @default_schedule_zone %>