1 # == Class ovsdpdk::postinstall_ovs_dpdk
3 # Postinstall configuration of ovs-dpdk service
5 class ovsdpdk::postinstall_ovs_dpdk (
6 $plugin_dir = $::ovsdpdk::params::plugin_dir,
7 $nova_conf = $::ovsdpdk::params::nova_conf,
8 $openvswitch_service_name = $::ovsdpdk::params::openvswitch_service_name,
9 $ml2_conf = $::ovsdpdk::params::ml2_conf,
10 $ml2_ovs_conf = $::ovsdpdk::params::ml2_ovs_conf,
11 $neutron_l3_conf = $::ovsdpdk::params::neutron_l3_conf,
12 $openvswitch_agent = $::ovsdpdk::params::openvswitch_agent,
15 require ovsdpdk::install_ovs_dpdk
17 package {'crudini': ensure => installed }
19 # compute node specific changes
20 if $compute == 'True' {
21 # adapt configuration files
22 exec {'adapt_nova_conf':
23 command => "${plugin_dir}/files/set_vcpu_pin.sh ${nova_conf}",
24 path => ['/usr/bin','/bin'],
26 onlyif => "test -f ${nova_conf}",
27 require => Package['crudini'],
30 exec {'adapt_ml2_conf_datapath':
31 command => "sudo crudini --set ${ml2_conf} ovs datapath_type ${ovs_datapath_type}",
32 path => ['/usr/bin','/bin'],
34 onlyif => "test -f ${ml2_conf}",
35 require => Package['crudini'],
38 exec {'adapt_ml2_conf_agent_type':
39 command => "sudo crudini --set ${ml2_conf} agent agent_type 'DPDK OVS Agent'",
40 path => ['/usr/bin','/bin'],
42 onlyif => "test -f ${ml2_conf}",
43 require => Package['crudini'],
46 exec {'adapt_neutron_l3':
47 command => "sudo crudini --set ${neutron_l3_conf} DEFAULT external_network_bridge br-ex",
48 path => ['/usr/bin','/bin'],
50 onlyif => "test -f ${neutron_l3_conf}",
51 require => Package['crudini'],
55 service {"${openvswitch_service_name}": ensure => 'running' }
57 # restart OVS to synchronize ovsdb-server with ovs-vswitchd needed
58 # due to several new --no-wait entries
60 command => "/usr/sbin/service ${openvswitch_service_name} restart",
62 require => Service["${openvswitch_service_name}"],
65 exec {'configure_bridges':
66 command => "${plugin_dir}/files/configure_bridges.sh ${ovs_datapath_type}",
68 require => Exec['restart_ovs'],
71 service { 'libvirtd': ensure => running }
73 exec {'libvirtd_disable_tls':
74 command => "sudo crudini --set /etc/libvirt/libvirtd.conf '' listen_tls 0",
75 path => ['/usr/bin','/bin'],
77 require => Package['crudini'],
78 notify => Service['libvirtd'],
81 exec {'restart_nova_compute':
82 command => "/usr/sbin/service nova-compute restart",
84 require => [ Exec['libvirtd_disable_tls'], Service['libvirtd'] ],
87 service {"${openvswitch_agent}":
89 require => [ Exec['restart_ovs'], Service["${openvswitch_service_name}"], Exec['adapt_ml2_conf_datapath'], Exec['adapt_ml2_conf_agent_type'] ],
92 exec { "ovs-vsctl --no-wait set Open_vSwitch . other_config:pmd-cpu-mask=${ovs_pmd_core_mask}":
93 path => ['/usr/bin','/bin'],
95 require => Service["${openvswitch_agent}"],
99 # controller specific part
100 if $controller == 'True' {
101 service {'neutron-server':
105 exec {'append_NUMATopologyFilter':
106 command => "sudo crudini --set ${nova_conf} DEFAULT scheduler_default_filters RetryFilter,AvailabilityZoneFilter,RamFilter,\
107 CoreFilter,DiskFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter,NUMATopologyFilter",
108 path => ['/usr/bin','/bin'],
110 onlyif => "test -f ${nova_conf}",
111 require => Package['crudini'],
114 exec { 'agents_flavors_update':
115 command => "${plugin_dir}/files/agents_flavors_update.sh",
119 require => [ Service['neutron-server'], Exec['append_NUMATopologyFilter'] ],
122 exec {'restart_neutron_server':
123 command => "/usr/sbin/service neutron-server restart",
125 require => Exec['agents_flavors_update'],
128 exec {'restart_nova_scheduler':
129 command => "/usr/sbin/service nova-scheduler restart",
131 require => Exec['agents_flavors_update'],
137 exec {'adapt_ml2_conf_mechanism_driver':
138 command => "sudo crudini --set ${ml2_conf} ml2 mechanism_drivers ovsdpdk",
139 path => ['/usr/bin','/bin'],
141 onlyif => "test -f ${ml2_conf}",
142 require => Package['crudini'],
145 exec {'adapt_ml2_conf_security_group':
146 command => "sudo crudini --set ${ml2_conf} securitygroup firewall_driver neutron.agent.firewall.NoopFirewallDriver",
147 path => ['/usr/bin','/bin'],
149 onlyif => "test -f ${ml2_conf}",
150 require => Package['crudini'],