Configure "reserved_host_memory_mb" attribute to support bare metal

The "reserved_host_memory_mb" attribute is default to 512MB when not
setting, it will make flavor match failed, so for bare metal service,
we need to set it to "0", no need to reserve host memory.

Change-Id: Idce5e5c223fdcbd59ae9304819ae04b1de8c1c3c
Closes-bug: #1446035
This commit is contained in:
wenchma 2015-04-20 11:57:45 +08:00
parent ef08b0e157
commit e8ccaa22b4
4 changed files with 6 additions and 0 deletions

View File

@ -137,6 +137,7 @@ Openstack Compute attributes are in the attribute namespace ["openstack"]["compu
* `openstack["compute"]["config"]["disk_allocation_ratio"]` - Virtual disk to physical disk allocation ratio (default 1.0)
* `openstack["compute"]["config"]["allow_resize_to_same_host"]` - Allow destination machine to match source for resize. Useful when testing in single-host environments (default is false)
* `openstack["compute"]["config"]["resize_confirm_window"]` - Automatically confirm resizes after N seconds, Set to 0 to disable (default is 0)
* `openstack["compute"]["config"]["reserved_host_memory_mb"]` - Amount of disk in MB to reserve for the host (default is 512)
* `openstack["compute"]["config"]["disk_cachemodes"]` - Cachemodes to use for different disk types e.g: "file=directsync,block=none". Valid cache values are "default", "none", "writethrough", "writeback", "directsync" and "unsafe".
* `openstack["compute"]["config"]["live_migration_retry_count"]` - Number of 1 second retries needed in live_migration
* `openstack["compute"]["config"]["flat_injected"]` - Whether to attempt to inject network setup into guest. Used by config_drive support.

View File

@ -315,6 +315,7 @@ default['openstack']['compute']['config']['snapshot_image_format'] = 'qcow2'
default['openstack']['compute']['config']['allow_resize_to_same_host'] = false
default['openstack']['compute']['config']['resize_confirm_window'] = 0
default['openstack']['compute']['config']['reserved_host_disk_mb'] = 0
default['openstack']['compute']['config']['reserved_host_memory_mb'] = 512
# `start` will cause nova-compute to error out if a VM is already running, where
# `resume` checks to see if it is running first.
default['openstack']['compute']['config']['start_guests_on_host_boot'] = false

View File

@ -549,6 +549,7 @@ describe 'openstack-compute::nova-common' do
%r{^injected_network_template=\$pybasedir/nova/virt/interfaces.template$},
/^flat_injected=false$/,
/^reserved_host_disk_mb=0$/,
/^reserved_host_memory_mb=512$/,
/^use_ipv6=false$/].each do |line|
expect(chef_run).to render_file(file.name).with_content(line)
end

View File

@ -230,6 +230,9 @@ flat_injected=<%= node["openstack"]["compute"]["config"]["flat_injected"] %>
# Amount of disk in MB to reserve for the host (default: 0)
reserved_host_disk_mb=<%= node["openstack"]["compute"]["config"]["reserved_host_disk_mb"] %>
# Amount of disk in MB to reserve for the host (default: 512)
reserved_host_memory_mb=<%= node["openstack"]["compute"]["config"]["reserved_host_memory_mb"] %>
<% if node["openstack"]["compute"]["enabled_apis"].include?("ec2") %>
# The IP address on which the EC2 API will listen. (string value)
ec2_listen=<%= @ec2_api_bind_ip %>