Merge "Adding back kvm_advance_timer service"
This commit is contained in:
commit
bdce5bb829
|
@ -1,2 +1,2 @@
|
||||||
SRC_DIR="src"
|
SRC_DIR="src"
|
||||||
TIS_PATCH_VER=91
|
TIS_PATCH_VER=92
|
||||||
|
|
|
@ -351,6 +351,38 @@ class platform::compute::machine {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class platform::compute::kvm_timer_advance(
|
||||||
|
$enabled = False,
|
||||||
|
$vcpu_pin_set = undef
|
||||||
|
) {
|
||||||
|
if $enabled {
|
||||||
|
# include the declaration of the kubelet service
|
||||||
|
include ::platform::kubernetes::worker
|
||||||
|
|
||||||
|
file { '/etc/kvm-timer-advance/kvm-timer-advance.conf':
|
||||||
|
ensure => 'present',
|
||||||
|
replace => true,
|
||||||
|
content => template('platform/kvm_timer_advance.conf.erb')
|
||||||
|
}
|
||||||
|
-> service { 'kvm_timer_advance_setup':
|
||||||
|
ensure => 'running',
|
||||||
|
enable => true,
|
||||||
|
before => Service['kubelet'],
|
||||||
|
}
|
||||||
|
# A separate enable is required since we have modified the service resource
|
||||||
|
# to never enable/disable services in puppet.
|
||||||
|
-> exec { 'Enable kvm_timer_advance_setup':
|
||||||
|
command => '/usr/bin/systemctl enable kvm_timer_advance_setup.service',
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
# A disable is required since we have modified the service resource
|
||||||
|
# to never enable/disable services in puppet and stop has no effect.
|
||||||
|
exec { 'Disable kvm_timer_advance_setup':
|
||||||
|
command => '/usr/bin/systemctl disable kvm_timer_advance_setup.service',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class platform::compute {
|
class platform::compute {
|
||||||
|
|
||||||
Class[$name] -> Class['::platform::vswitch']
|
Class[$name] -> Class['::platform::vswitch']
|
||||||
|
@ -362,4 +394,5 @@ class platform::compute {
|
||||||
require ::platform::compute::resctrl
|
require ::platform::compute::resctrl
|
||||||
require ::platform::compute::machine
|
require ::platform::compute::machine
|
||||||
require ::platform::compute::config
|
require ::platform::compute::config
|
||||||
|
require ::platform::compute::kvm_timer_advance
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
[kvm-timer-advance]
|
||||||
|
vcpu_pin_set=<%= @vcpu_pin_set %>
|
|
@ -68,6 +68,7 @@ class PlatformPuppet(base.BasePuppet):
|
||||||
config.update(self._get_host_tpm_config(host))
|
config.update(self._get_host_tpm_config(host))
|
||||||
config.update(self._get_host_cpu_config(host))
|
config.update(self._get_host_cpu_config(host))
|
||||||
config.update(self._get_host_memory_config(host))
|
config.update(self._get_host_memory_config(host))
|
||||||
|
config.update(self._get_kvm_timer_advance_config(host))
|
||||||
config.update(self._get_host_lldp_config(host))
|
config.update(self._get_host_lldp_config(host))
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
@ -718,6 +719,31 @@ class PlatformPuppet(base.BasePuppet):
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
def _get_vcpu_pin_set(self, host):
|
||||||
|
vm_cpus = self._get_host_cpu_list(
|
||||||
|
host, function=constants.APPLICATION_FUNCTION, threads=True)
|
||||||
|
cpu_list = [c.cpu for c in vm_cpus]
|
||||||
|
return "\"%s\"" % utils.format_range_set(cpu_list)
|
||||||
|
|
||||||
|
# kvm-timer-advance only enabled on computes with openstack compute label
|
||||||
|
# vcpu_pin_set is only used when kvm-timer-advance is enabled
|
||||||
|
def _get_kvm_timer_advance_config(self, host):
|
||||||
|
kvm_timer_advance_enabled = False
|
||||||
|
vcpu_pin_set = None
|
||||||
|
|
||||||
|
if constants.WORKER in utils.get_personalities(host):
|
||||||
|
host_labels = self.dbapi.label_get_by_host(host.id)
|
||||||
|
if utils.has_openstack_compute(host_labels):
|
||||||
|
kvm_timer_advance_enabled = True
|
||||||
|
vcpu_pin_set = self._get_vcpu_pin_set(host)
|
||||||
|
|
||||||
|
return {
|
||||||
|
'platform::compute::kvm_timer_advance::enabled':
|
||||||
|
kvm_timer_advance_enabled,
|
||||||
|
'platform::compute::kvm_timer_advance::vcpu_pin_set':
|
||||||
|
vcpu_pin_set,
|
||||||
|
}
|
||||||
|
|
||||||
def _get_nfs_config(self, host):
|
def _get_nfs_config(self, host):
|
||||||
|
|
||||||
# Calculate the optimal NFS r/w size based on the network mtu based
|
# Calculate the optimal NFS r/w size based on the network mtu based
|
||||||
|
|
Loading…
Reference in New Issue