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 if $compute == 'True' {
20 # adapt configuration files
21 exec {'adapt_nova_conf':
22 command => "${plugin_dir}/files/set_vcpu_pin.sh ${nova_conf}",
23 path => ['/usr/bin','/bin'],
25 onlyif => "test -f ${nova_conf}",
26 require => Package['crudini'],
29 exec {'adapt_ml2_conf_datapath':
30 command => "sudo crudini --set ${ml2_ovs_conf} ovs datapath_type ${ovs_datapath_type}",
31 path => ['/usr/bin','/bin'],
33 onlyif => "test -f ${ml2_ovs_conf}",
34 require => Package['crudini'],
37 exec {'adapt_neutron_l3':
38 command => "sudo crudini --set ${neutron_l3_conf} DEFAULT external_network_bridge br-ex",
39 path => ['/usr/bin','/bin'],
41 onlyif => "test -f ${neutron_l3_conf}",
42 require => Package['crudini'],
46 service {"${openvswitch_service_name}": ensure => 'running' }
48 # restart OVS to synchronize ovsdb-server with ovs-vswitchd needed
49 # due to several new --no-wait entries
51 command => "/usr/sbin/service ${openvswitch_service_name} restart",
53 require => Service["${openvswitch_service_name}"],
56 exec { "${plugin_dir}/files/configure_bridges.sh ${ovs_datapath_type}":
58 require => Exec['restart_ovs'],
61 service { 'libvirtd': ensure => running }
63 exec {'libvirtd_disable_tls':
64 command => "sudo crudini --set /etc/libvirt/libvirtd.conf '' listen_tls 0",
65 path => ['/usr/bin','/bin'],
67 require => Package['crudini'],
68 notify => Service['libvirtd'],
71 exec {'restart_nova_compute':
72 command => "/usr/sbin/service nova-compute restart",
74 require => [ Exec['libvirtd_disable_tls'], Service['libvirtd'] ],
78 exec {'adapt_ml2_conf_mechanism_driver':
79 command => "sudo crudini --set ${ml2_conf} ml2 mechanism_drivers ovsdpdk",
80 path => ['/usr/bin','/bin'],
82 onlyif => "test -f ${ml2_conf}",
83 require => Package['crudini'],
86 exec {'adapt_ml2_conf_security_group':
87 command => "sudo crudini --set ${ml2_conf} securitygroup firewall_driver neutron.agent.firewall.NoopFirewallDriver",
88 path => ['/usr/bin','/bin'],
90 onlyif => "test -f ${ml2_conf}",
91 require => Package['crudini'],
94 if $controller == 'True' {
95 service {'neutron-server':
99 exec {'append_NUMATopologyFilter':
100 command => "sudo crudini --set ${nova_conf} DEFAULT scheduler_default_filters RetryFilter,AvailabilityZoneFilter,RamFilter,CoreFilter,DiskFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter,NUMATopologyFilter",
101 path => ['/usr/bin','/bin'],
103 onlyif => "test -f ${nova_conf}",
104 require => Package['crudini'],
107 exec { 'remove_old_agent':
108 command => "${plugin_dir}/files/remove_agent.sh $adminrc_user $adminrc_password $adminrc_tenant $adminrc_hostname",
112 require => [ Service['neutron-server'], Exec['append_NUMATopologyFilter'] ],
115 exec {'restart_neutron_server':
116 command => "/usr/sbin/service neutron-server restart",
118 require => Exec['remove_old_agent'],
121 exec {'restart_nova_scheduler':
122 command => "/usr/sbin/service nova-scheduler restart",
124 require => Exec['remove_old_agent'],
129 if $compute == 'True' {
130 exec { 'patch_ovs_agent':
131 command => "cp ${plugin_dir}/files/neutron-plugin-openvswitch-agent.conf /etc/init/neutron-plugin-openvswitch-agent.conf",
132 path => ['/usr/bin','/bin'],
136 service {"${openvswitch_agent}":
138 require => [ Exec['restart_ovs'], Service["${openvswitch_service_name}"], Exec['patch_ovs_agent'] ],
141 exec { "ovs-vsctl --no-wait set Open_vSwitch . other_config:pmd-cpu-mask=${ovs_pmd_core_mask}":
142 path => ['/usr/bin','/bin'],
144 require => Service["${openvswitch_agent}"],