Skip to content

Instantly share code, notes, and snippets.

@ananya23d

ananya23d/updatefilter.pp Secret

Created Feb 21, 2018
Embed
What would you like to do?
update filter
# == Class: dellnfv::updatefilter
#
# Update scheduler_delault_filters attribute in nova.conf of controller nodes via composable services.
#
class dellnfv::updatefilter (
$step = hiera('step'),
$numa_state = hiera('dellnfv::numa::enable'),
$hugepages_state = hiera('dellnfv::hugepages::enable')
) {
if ($step>=4) {
if ($numa_state == true || $hugepages_state == true){
#update scheduler filter in nova.conf
$scheduler_filter = "RetryFilter,AvailabilityZoneFilter,RamFilter,DiskFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter,CoreFilter,NUMATopologyFilter,AggregateInstanceExtraSpecsFilter"
exec {'set_scheduler_NUMATopologyFilter':
path => ['/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/'],
command => "sudo crudini --set /etc/nova/nova.conf DEFAULT scheduler_default_filters $scheduler_filter",
}
exec {'restart_scheduler':
require => Exec['set_scheduler_NUMATopologyFilter'],
path => ['/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/'],
command => "systemctl restart openstack-nova-scheduler.service",
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment