Browse Source

Expose 'mem_stats_period_seconds' config parameter

Add support for configuring 'mem_stats_period_seconds'
libvirt config option.

When using the balloon stats in the XML configuration, user gets
latency violation in guests, because balloon stats causes QEMU to
periodically send asynchronous requests to balloon driver in the guest.

Conflicts:
      manifests/compute/libvirt.pp

Resolved conflicts related to other parameter defined in
newer releases but not available in this release.

Change-Id: If69d32fb4b718b97efbfbe0d58a37966af957be9
(cherry picked from commit 05d7733e2a)
(cherry picked from commit 4c5881a746)
(cherry picked from commit 070f926a65)
tags/12.5.0
Rajesh Tailor 4 months ago
parent
commit
dde32ec40b

+ 21
- 14
manifests/compute/libvirt.pp View File

@@ -148,6 +148,11 @@
148 148
 #   nfs man page for details.
149 149
 #   Defaults to $::os_service_default
150 150
 #
151
+# [*mem_stats_period_seconds*]
152
+#   (optional) A number of seconds to memory usage statistics period,
153
+#   zero or negative value mean to disable memory usage statistics.
154
+#   Defaults to $::os_service_default
155
+#
151 156
 class nova::compute::libvirt (
152 157
   $ensure_package                             = 'present',
153 158
   $libvirt_virt_type                          = 'kvm',
@@ -176,6 +181,7 @@ class nova::compute::libvirt (
176 181
   $log_outputs                                = undef,
177 182
   $volume_use_multipath                       = $::os_service_default,
178 183
   $nfs_mount_options                          = $::os_service_default,
184
+  $mem_stats_period_seconds                   = $::os_service_default,
179 185
 ) inherits nova::params {
180 186
 
181 187
   include ::nova::deps
@@ -235,20 +241,21 @@ class nova::compute::libvirt (
235 241
   }
236 242
 
237 243
   nova_config {
238
-    'DEFAULT/compute_driver':        value => $compute_driver;
239
-    'DEFAULT/preallocate_images':    value => $preallocate_images;
240
-    'vnc/vncserver_listen':          value => $vncserver_listen;
241
-    'libvirt/virt_type':             value => $libvirt_virt_type;
242
-    'libvirt/cpu_mode':              value => $libvirt_cpu_mode_real;
243
-    'libvirt/snapshot_image_format': value => $libvirt_snapshot_image_format;
244
-    'libvirt/inject_password':       value => $libvirt_inject_password;
245
-    'libvirt/inject_key':            value => $libvirt_inject_key;
246
-    'libvirt/inject_partition':      value => $libvirt_inject_partition;
247
-    'libvirt/hw_disk_discard':       value => $libvirt_hw_disk_discard;
248
-    'libvirt/hw_machine_type':       value => $libvirt_hw_machine_type;
249
-    'libvirt/enabled_perf_events':   value => join(any2array($libvirt_enabled_perf_events), ',');
250
-    'libvirt/volume_use_multipath':  value => $volume_use_multipath;
251
-    'libvirt/nfs_mount_options':     value => $nfs_mount_options;
244
+    'DEFAULT/compute_driver':           value => $compute_driver;
245
+    'DEFAULT/preallocate_images':       value => $preallocate_images;
246
+    'vnc/vncserver_listen':             value => $vncserver_listen;
247
+    'libvirt/virt_type':                value => $libvirt_virt_type;
248
+    'libvirt/cpu_mode':                 value => $libvirt_cpu_mode_real;
249
+    'libvirt/snapshot_image_format':    value => $libvirt_snapshot_image_format;
250
+    'libvirt/inject_password':          value => $libvirt_inject_password;
251
+    'libvirt/inject_key':               value => $libvirt_inject_key;
252
+    'libvirt/inject_partition':         value => $libvirt_inject_partition;
253
+    'libvirt/hw_disk_discard':          value => $libvirt_hw_disk_discard;
254
+    'libvirt/hw_machine_type':          value => $libvirt_hw_machine_type;
255
+    'libvirt/enabled_perf_events':      value => join(any2array($libvirt_enabled_perf_events), ',');
256
+    'libvirt/volume_use_multipath':     value => $volume_use_multipath;
257
+    'libvirt/nfs_mount_options':        value => $nfs_mount_options;
258
+    'libvirt/mem_stats_period_seconds': value => $mem_stats_period_seconds;
252 259
   }
253 260
 
254 261
   # cpu_model param is only valid if cpu_mode=custom

+ 6
- 0
releasenotes/notes/nova_libvirt_mem_stats_period_seconds-679de08855e07254.yaml View File

@@ -0,0 +1,6 @@
1
+---
2
+features:
3
+  - |
4
+    Add parameter `mem_stats_period_seconds` to specify number
5
+    of seconds to memory usage statistics period, zero or negative
6
+    value mean to disable memory usage statistics.

+ 7
- 2
spec/classes/nova_compute_libvirt_spec.rb View File

@@ -62,6 +62,7 @@ describe 'nova::compute::libvirt' do
62 62
       it { is_expected.to contain_nova_config('libvirt/remove_unused_resized_minimum_age_seconds').with_ensure('absent')}
63 63
       it { is_expected.to contain_nova_config('libvirt/volume_use_multipath').with_value('<SERVICE DEFAULT>')}
64 64
       it { is_expected.to contain_nova_config('libvirt/nfs_mount_options').with_ensure('<SERVICE DEFAULT>')}
65
+      it { is_expected.to contain_nova_config('libvirt/mem_stats_period_seconds').with_value('<SERVICE DEFAULT>')}
65 66
     end
66 67
 
67 68
     describe 'with params' do
@@ -87,7 +88,8 @@ describe 'nova::compute::libvirt' do
87 88
           :preallocate_images                         => 'space',
88 89
           :log_outputs                                => '1:file:/var/log/libvirt/libvirtd.log',
89 90
           :volume_use_multipath                       => false,
90
-          :nfs_mount_options                          => 'rw,intr,nolock'
91
+          :nfs_mount_options                          => 'rw,intr,nolock',
92
+          :mem_stats_period_seconds                   => 20,
91 93
         }
92 94
       end
93 95
 
@@ -113,6 +115,7 @@ describe 'nova::compute::libvirt' do
113 115
       it { is_expected.to contain_libvirtd_config('log_outputs').with_value("\"#{params[:log_outputs]}\"")}
114 116
       it { is_expected.to contain_nova_config('libvirt/volume_use_multipath').with_value(false)}
115 117
       it { is_expected.to contain_nova_config('libvirt/nfs_mount_options').with_value('rw,intr,nolock')}
118
+      it { is_expected.to contain_nova_config('libvirt/mem_stats_period_seconds').with_value(20)}
116 119
       it {
117 120
         is_expected.to contain_service('libvirt').with(
118 121
           :name     => 'custom_service',
@@ -292,7 +295,8 @@ describe 'nova::compute::libvirt' do
292 295
           :remove_unused_resized_minimum_age_seconds  => 3600,
293 296
           :remove_unused_original_minimum_age_seconds => 3600,
294 297
           :libvirt_enabled_perf_events                => ['cmt', 'mbml', 'mbmt'],
295
-          :nfs_mount_options                          => 'rw,intr,nolock'
298
+          :nfs_mount_options                          => 'rw,intr,nolock',
299
+          :mem_stats_period_seconds                   => 20,
296 300
         }
297 301
       end
298 302
 
@@ -303,6 +307,7 @@ describe 'nova::compute::libvirt' do
303 307
       it { is_expected.to contain_nova_config('libvirt/remove_unused_resized_minimum_age_seconds').with_value(3600)}
304 308
       it { is_expected.to contain_nova_config('libvirt/enabled_perf_events').with_value('cmt,mbml,mbmt')}
305 309
       it { is_expected.to contain_nova_config('libvirt/nfs_mount_options').with_value('rw,intr,nolock')}
310
+      it { is_expected.to contain_nova_config('libvirt/mem_stats_period_seconds').with_value(20)}
306 311
       it { is_expected.to contain_package('libvirt').with(
307 312
         :name   => 'libvirt-daemon-kvm',
308 313
         :ensure => 'present'

Loading…
Cancel
Save