diff --git a/README.md b/README.md index c1e2e593..4c672841 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/attributes/default.rb b/attributes/default.rb index 677b1370..56b2a49f 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -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 diff --git a/spec/nova-common_spec.rb b/spec/nova-common_spec.rb index 76e1f3a3..f043ea25 100644 --- a/spec/nova-common_spec.rb +++ b/spec/nova-common_spec.rb @@ -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 diff --git a/templates/default/nova.conf.erb b/templates/default/nova.conf.erb index 6f2d7ce4..5f3fbac2 100644 --- a/templates/default/nova.conf.erb +++ b/templates/default/nova.conf.erb @@ -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 %>