DPDK vrouter configuration management

- Added routines for creation nova-aggregate with hugepages support
- Added global variable for DPDK
- Added restrictions for options in environment_config.yaml
- Added AggregateInstanceExtraSpecFilter in nova.conf on controllers at scheduler_default_filters.
- Repo management script updated
- Nova compute configuration for dpdk
- Add possibility install nova from contrail repository
- Add possibility install qemu, libvirt from contrail repository
- Add possibility change CPU pinning through contrail WebUI settings
- Idempotency enabled for compute::vrouter class

Change-Id: I8000f9f08f007bf092c76fd5835a7348477ba272
Signed-off-by: Oleksandr Martsyniuk <omartsyniuk@mirantis.com>
This commit is contained in:
Pavel Basov 2016-02-20 00:41:23 +03:00 committed by Oleksandr Martsyniuk
parent d11ff91c79
commit ce2b027806
24 changed files with 484 additions and 104 deletions

View File

@ -1,4 +1,4 @@
# Copyright 2015 Mirantis, Inc.
# Copyright 2016 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
@ -27,6 +27,12 @@ case $operatingsystem
file { "/etc/apt/preferences.d/contrail-${plugin_version}.pref":
ensure => absent,
}
apt::pin { 'dependency-fix':
explanation => 'Temporary fix for contrail analytics',
packages => 'libperl5.18',
priority => 1400,
version => '5.18.2-2ubuntu1.1',
}
}
default: {}
}

View File

@ -0,0 +1,104 @@
# Copyright 2016 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
notice('MODULAR: contrail/contrail-compute-override.pp')
include contrail
$common_pkg = ['iproute2', 'haproxy', 'libatm1']
$nova_pkg = ['nova-compute', 'nova-common', 'python-nova', 'python-urllib3']
$libvirt_pkg = ['libvirt-bin', 'libvirt0']
$install_cmd = 'apt-get install --yes -o Dpkg::Options::="--force-overwrite" -o Dpkg::Options::="--force-confold"'
$path_cmd = ['/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin']
apt::pin { 'contrail-override-common':
explanation => 'Set priority for packages that need to override from contrail repository',
priority => 1200,
label => 'contrail',
packages => $common_pkg,
}
if $contrail::compute_dpdk_enabled {
# Create local dpdk repository
package { 'dpdk-depends-packages':
ensure => present,
} ->
exec {'setup_dpdk_repo':
command => 'bash /opt/contrail/contrail_packages_dpdk/setup.sh',
path => $path_cmd,
}
# Override nova packages if it set on Fuel UI
if $contrail::install_contrail_nova {
apt::pin { 'contrail-override-nova':
explanation => 'Set priority for packages that need to override from contrail repository',
priority => 1200,
label => 'contrail',
packages => $nova_pkg,
} ->
#TODO rewrite using package
exec { 'override-nova':
command => "${install_cmd} nova-compute",
path => $path_cmd,
}
}
# Override libvirt and qemu packages if it set on Fuel UI
if $contrail::install_contrail_qemu_lv {
# For qemu you don't need additional pinning, only dpdk repository
package { 'qemu-system-x86':
ensure => 'latest',
} ~>
service { 'qemu-kvm':
ensure => running,
enable => true,
} ->
apt::pin { 'contrail-override-libvirt':
explanation => 'Set priority for packages that need to override from contrail repository',
packages => $libvirt_pkg,
priority => 1200,
version => '2:1.2.12-0ubuntu7+contrail2',
} ->
#TODO rewrite using package
exec { 'override-libvirt':
command => "${install_cmd} libvirt-bin libvirt0",
path => $path_cmd,
} ->
# With a new libvirt packages this init script must be stopped
service { 'libvirtd':
ensure => stopped,
enable => false,
} ->
# This options must be uncommented for correct work with nova-compute
file_line { 'add_libvirt_opt1':
path => '/etc/libvirt/libvirtd.conf',
match => 'auth_unix_ro',
line => 'auth_unix_ro = "none"',
} ->
file_line { 'add_libvirt_opt2':
path => '/etc/libvirt/libvirtd.conf',
match => 'auth_unix_rw',
line => 'auth_unix_rw = "none"',
} ~>
service { $contrail::libvirt_name:
ensure => running,
enable => true,
} ~>
service { 'nova-compute':
ensure => running,
enable => true,
}
}
}

View File

@ -14,9 +14,10 @@
notice('MODULAR: contrail/contrail-compute-repo.pp')
file { '/etc/apt/preferences.d/contrail-pin-110':
ensure => file,
source => 'puppet:///modules/contrail/contrail-pin-110',
apt::pin { 'contrail-main':
explanation => 'Set priority for common contrail packages',
priority => 200,
label => 'contrail',
}
# Temporary dirty hack. Network configuration fails because of deployed contrail vrouter [FIXME]

View File

@ -0,0 +1,19 @@
# Copyright 2016 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
notice('MODULAR: contrail/controller-dpdk.pp')
include contrail
class { 'contrail::controller::dpdk': }

View File

@ -1,7 +0,0 @@
Package: *
Pin: release l=contrail
Pin-Priority: 200
Package: iproute2 haproxy libatm1
Pin: release l=contrail
Pin-Priority: 1200

View File

@ -0,0 +1,33 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
require 'yaml'
module Puppet::Parser::Functions
newfunction(:get_dev_pci_addr, :type => :rvalue, :doc => <<-EOS
Returns interface's PCI address, else returns "0000:00:00.0"
EOS
) do |args|
# Get the real interface name if argument is '<ifname>.<vlanid>'
ifname = args[0].split('.').first
yml = YAML.load(File.open("/etc/astute.yaml"))
ifyml = yml['network_scheme']['interfaces'][ifname]
if ifyml and ifyml['vendor_specific']
return ifyml['vendor_specific']['bus_info']
else
return '0000:00:00.0'
end
end
end

View File

@ -0,0 +1,39 @@
# Copyright 2016 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
module Puppet::Parser::Functions
newfunction(:get_mac_from_vrouter, :type => :rvalue, :doc => <<-EOS
Returns mac address of interface used by DPDK vrouter
EOS
) do |args|
mac = "00:00:00:00:00:00"
begin
output=`vif --list`
result=$?.success?
if result
for int in output.split('vif')
if int.start_with?( '0/0')
mac = int.split[8][7..-1]
end
end
end
rescue Exception
warning 'Could not retrieve correct mac address from vrouter. Probably vrouter is running incorrectly.'
end
return mac
end
end

View File

@ -21,7 +21,7 @@ class contrail::compute::aggregate {
}
}
if $contrail::dpdk_enabled {
if $contrail::global_dpdk_enabled {
$nodes_hash = hiera('nodes')
$dpdk_compute_nodes = nodes_with_roles(['dpdk'], 'fqdn')

View File

@ -14,7 +14,7 @@
class contrail::compute::hugepages {
if $contrail::dpdk_enabled {
if $contrail::compute_dpdk_enabled {
# NOTE: To use hugepages we have to upgrade qemu packages to version 2.4
# The kernel configuration for hugepages
Kernel_parameter {
@ -25,11 +25,9 @@ class contrail::compute::hugepages {
sysctl::value { 'vm.nr_hugepages':
value => "${contrail::hugepages_number} ",
}
kernel_parameter { 'hugepagesz':
ensure => absent,
}
kernel_parameter { 'hugepages':
ensure => absent,
}
@ -39,7 +37,6 @@ class contrail::compute::hugepages {
ensure => present,
value => "${contrail::hugepages_size}M",
} ->
kernel_parameter { 'hugepages':
ensure => present,
value => $contrail::hugepages_size,
@ -51,8 +48,6 @@ class contrail::compute::hugepages {
command => 'sysctl -w vm.nr_hugepages=256',
onlyif => 'test ! -d /sys/kernel/mm/hugepages/hugepages-1048576kB',
}
exec { 'reboot_require':
path => ['/bin', '/usr/bin'],
command => 'touch /tmp/contrail-reboot-require',
@ -84,9 +79,9 @@ class contrail::compute::hugepages {
enable => true,
} ~>
service { 'libvirtd':
ensure => running,
enable => true,
service { $contrail::libvirt_name:
ensure => running,
enable => true,
}
}
}

View File

@ -22,26 +22,31 @@ class contrail::compute::nova {
setting => 'cgroup_device_acl',
value => $cgroup_acl_string,
} ~>
service { 'libvirtd' :
service { $contrail::libvirt_name :
ensure => 'running',
enable => true
}
nova_config {
'DEFAULT/neutron_url': value => "http://${contrail::mos_mgmt_vip}:9696";
'DEFAULT/neutron_admin_auth_url': value=> "http://${contrail::mos_mgmt_vip}:35357/v2.0/";
'DEFAULT/network_api_class': value=> 'nova.network.neutronv2.api.API';
'DEFAULT/neutron_admin_tenant_name': value=> 'services';
'DEFAULT/neutron_admin_username': value=> 'neutron';
'DEFAULT/neutron_admin_password': value=> $contrail::service_token;
'DEFAULT/neutron_url_timeout': value=> '300';
'DEFAULT/firewall_driver': value=> 'nova.virt.firewall.NoopFirewallDriver';
'DEFAULT/security_group_api': value=> 'neutron';
'DEFAULT/heal_instance_info_cache_interval': value=> '0';
} ~>
'DEFAULT/neutron_url': value => "http://${contrail::mos_mgmt_vip}:9696";
'DEFAULT/neutron_admin_auth_url': value => "http://${contrail::mos_mgmt_vip}:35357/v2.0/";
'DEFAULT/network_api_class': value => 'nova.network.neutronv2.api.API';
'DEFAULT/neutron_admin_tenant_name': value => 'services';
'DEFAULT/neutron_admin_username': value => 'neutron';
'DEFAULT/neutron_admin_password': value => $contrail::service_token;
'DEFAULT/neutron_url_timeout': value => '300';
'DEFAULT/firewall_driver': value => 'nova.virt.firewall.NoopFirewallDriver';
'DEFAULT/security_group_api': value => 'neutron';
'DEFAULT/heal_instance_info_cache_interval': value => '0';
}
if $contrail::compute_dpdk_enabled {
nova_config {
'CONTRAIL/use_userspace_vhost': value => true;
}
}
Nova_config <||> ~>
service { 'nova-compute':
ensure => running,
enable => true,
}
}

View File

@ -13,15 +13,39 @@
# under the License.
class contrail::compute::vrouter {
$dev_mac = getvar("::macaddress_${contrail::phys_dev}")
if $contrail::compute_dpdk_enabled {
if empty($dev_mac) {
$dpdk_dev_mac = get_mac_from_vrouter()
} else {
$dpdk_dev_mac = $dev_mac
}
$install_packages = ['contrail-openstack-vrouter','contrail-vrouter-dpdk-init','iproute2','haproxy','libatm1']
$delete_packages = ['openvswitch-common','openvswitch-datapath-dkms','openvswitch-datapath-lts-saucy-dkms','openvswitch-switch','nova-network','nova-api']
file {'/etc/contrail/supervisord_vrouter_files/contrail-vrouter-dpdk.ini':
ensure => present,
content => template('contrail/contrail-vrouter-dpdk.ini.erb'),
require => Class[Contrail::Package],
notify => Service['supervisor-vrouter'],
}
} else {
$install_packages = ['contrail-openstack-vrouter','contrail-vrouter-dkms','iproute2','haproxy','libatm1']
$delete_packages = ['openvswitch-common','openvswitch-datapath-dkms','openvswitch-datapath-lts-saucy-dkms','openvswitch-switch','nova-network','nova-api']
}
file { 'create_supervisor_vrouter_override':
ensure => present,
path => '/etc/init/supervisor-vrouter.override',
content => 'manual',
} ->
class { 'contrail::package':
install => ['contrail-openstack-vrouter','contrail-vrouter-dkms','iproute2','haproxy','libatm1'],
remove => ['openvswitch-common','openvswitch-datapath-dkms','openvswitch-datapath-lts-saucy-dkms','openvswitch-switch','nova-network','nova-api'],
install => [$install_packages],
remove => [$delete_packages],
} ->
exec { 'remove-ovs-modules':
command => '/sbin/modprobe -r openvswitch'
}
} ->
file {'/etc/contrail/agent_param':
ensure => present,
content => template('contrail/agent_param.erb'),
@ -35,26 +59,17 @@ class contrail::compute::vrouter {
ensure => present,
content => template('contrail/contrail-vrouter-nodemgr.conf.erb'),
}
file {'/etc/init.d/fixup-vrouter':
ensure => present,
mode => '0755',
owner => 'root',
group => 'root',
source => 'puppet:///modules/contrail/fixup-vrouter.init',
exec { 'remove_supervisor_override':
command => 'rm -rf /etc/init/supervisor-vrouter.override',
provider => shell,
require => Class[Contrail::Package],
} ->
service {'supervisor-vrouter':
ensure => running,
enable => true,
subscribe => [Package['contrail-openstack-vrouter','contrail-vrouter-dkms'],
subscribe => [Class[Contrail::Package],Exec['remove-ovs-modules'],
File['/etc/contrail/agent_param','/etc/contrail/contrail-vrouter-agent.conf',
'/etc/contrail/contrail-vrouter-nodemgr.conf']
],
} ~>
service {'fixup-vrouter':
ensure => running,
enable => true,
}
}

View File

@ -0,0 +1,36 @@
# Copyright 2016 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
class contrail::controller::dpdk {
if $contrail::global_dpdk_enabled {
ini_subsetting {'add_aggregateinstanceextraspecsfilter':
ensure => present,
section => 'DEFAULT',
key_val_separator => '=',
path => '/etc/nova/nova.conf',
setting => 'scheduler_default_filters',
subsetting => 'AggregateInstanceExtraSpecsFilter',
subsetting_separator => ',',
notify => Service['nova-scheduler'],
}
}
Ini_subsetting <||> ~>
service { 'nova-scheduler':
ensure => $ensure,
enable => $enabled,
hasstatus => true,
}
}

View File

@ -75,17 +75,29 @@ class contrail {
# Network configuration
prepare_network_config($network_scheme)
$interface = get_network_role_property('neutron/mesh', 'interface')
$gateway = $network_scheme['endpoints'][$interface]['gateway']
$address = get_network_role_property('neutron/mesh', 'ipaddr')
$cidr = get_network_role_property('neutron/mesh', 'cidr')
$netmask = get_network_role_property('neutron/mesh', 'netmask')
$netmask_short = netmask_to_cidr($netmask)
$phys_dev = get_private_ifname($interface)
$interface = get_network_role_property('neutron/mesh', 'interface')
$gateway = $network_scheme['endpoints'][$interface]['gateway']
$address = get_network_role_property('neutron/mesh', 'ipaddr')
$cidr = get_network_role_property('neutron/mesh', 'cidr')
$netmask = get_network_role_property('neutron/mesh', 'netmask')
$netmask_short = netmask_to_cidr($netmask)
$phys_dev = get_private_ifname($interface)
$phys_dev_pci = get_dev_pci_addr($phys_dev)
$vrouter_core_mask = pick($settings['vrouter_core_mask'], '0x3')
# DPDK settings
$dpdk_enabled = 'dpdk' in hiera_array('roles')
$global_dpdk_enabled = $settings['contrail_global_dpdk']
$compute_dpdk_enabled = $global_dpdk_enabled and 'dpdk' in hiera_array('roles')
# Package override
$install_contrail_nova = pick($settings['install_contrail_nova'], false)
$install_contrail_qemu_lv = pick($settings['install_contrail_qemu_lv'], false )
if $install_contrail_qemu_lv and $global_dpdk_enabled {
$libvirt_name = 'libvirt-bin'
} else {
$libvirt_name = 'libvirtd'
}
$mos_mgmt_vip = $network_metadata['vips']['management']['ipaddr']
$mos_public_vip = $network_metadata['vips']['public']['ipaddr']

View File

@ -18,19 +18,35 @@ class contrail::provision::compute {
provider => 'shell',
path => '/bin:/sbin:/usr/bin:/usr/sbin',
}
package { 'contrail-utils':
ensure => present,
} ->
file { '/opt/contrail':
ensure => 'directory',
} ->
exec { 'provision-vrouter':
command => "contrail-provision-vrouter \
}
if $contrail::compute_dpdk_enabled {
exec { 'provision-vrouter':
command => "contrail-provision-vrouter \
--api_server_ip ${contrail::contrail_mgmt_vip} --api_server_port 8082 --openstack_ip ${contrail::mos_mgmt_vip} \
--oper add --host_name ${::fqdn} --host_ip ${contrail::address} \
--admin_user neutron --admin_tenant_name services --admin_password '${contrail::service_token}' --dpdk_enabled \
&& touch /opt/contrail/provision-vrouter-DONE",
creates => '/opt/contrail/provision-vrouter-DONE',
require => File['/opt/contrail'],
}
}
else {
exec { 'provision-vrouter':
command => "contrail-provision-vrouter \
--api_server_ip ${contrail::contrail_mgmt_vip} --api_server_port 8082 --openstack_ip ${contrail::mos_mgmt_vip} \
--oper add --host_name ${::fqdn} --host_ip ${contrail::address} \
--admin_user neutron --admin_tenant_name services --admin_password '${contrail::service_token}' \
&& touch /opt/contrail/provision-vrouter-DONE",
creates => '/opt/contrail/provision-vrouter-DONE',
creates => '/opt/contrail/provision-vrouter-DONE',
require => File['/opt/contrail'],
}
}
}

View File

@ -19,6 +19,11 @@ class contrail::provision::db {
path => '/usr/bin:/bin:/sbin',
}
# VNC config for provision scripts
file { '/etc/contrail/vnc_api_lib.ini':
content => template('contrail/vnc_api_lib.ini.erb')
}
notify {'Waiting for contrail API':} ->
exec {'wait_for_api':

View File

@ -1,7 +1,9 @@
LOG=/var/log/contrail.log
CONFIG=/etc/contrail/agent.conf
CONFIG=/etc/contrail/contrail-vrouter-agent.conf
prog=/usr/bin/contrail-vrouter-agent
<%- unless scope.lookupvar('contrail::compute_dpdk_enabled') == true then -%>
kmod=vrouter
<%- end -%>
pname=contrail-vrouter-agent
LIBDIR=/usr/lib64
DEVICE=vhost0

View File

@ -4,6 +4,12 @@ log_file=/var/log/contrail/contrail-vrouter-agent.log
log_level=SYS_NOTICE
log_local=1
headless_mode=true
<%- if scope.lookupvar('contrail::compute_dpdk_enabled') == true then -%>
platform=dpdk
physical_interface_address=<%= scope.lookupvar('contrail::phys_dev_pci') %>
<% phys_dev_fact = scope.lookupvar('contrail::phys_dev').gsub(/[^a-z0-9_]/i,"_") -%>
physical_interface_mac=<%= @dpdk_dev_mac %>
<%- end -%>
[DISCOVERY]
server=<%= scope.lookupvar('contrail::contrail_private_vip') %>
max_control_nodes=2
@ -26,3 +32,4 @@ gateway=<%= scope.lookupvar('contrail::gateway') %>
[GATEWAY-1]
[SERVICE-INSTANCE]
netns_command=/usr/bin/opencontrail-vrouter-netns

View File

@ -0,0 +1,11 @@
[program:contrail-vrouter-dpdk]
command=taskset <%= scope.lookupvar('contrail::vrouter_core_mask') %> /usr/bin/contrail-vrouter-dpdk --no-daemon
priority=410
loglevel=debug
autostart=true
killasgroup=true
stdout_capture_maxbytes=1MB
redirect_stderr=true
stdout_logfile=/var/log/contrail/contrail-vrouter-dpdk-stdout.log
stderr_logfile=/var/log/contrail/contrail-vrouter-dpdk-stderr.log
exitcodes=0 ; 'expected' exit codes for process (default 0,2)

View File

@ -1,5 +1,6 @@
auto vhost0
iface vhost0 inet static
pre-up /opt/contrail/bin/if-vhost0
address <%= scope.lookupvar('contrail::address') %>/<%= scope.lookupvar('contrail::netmask_short') %>
<% if scope.lookupvar('contrail::gateway') != :undef -%>
gateway <%= scope.lookupvar('contrail::gateway') %>

View File

@ -234,6 +234,17 @@
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 1440
# Set proper apt pin for Contrail repository
- id: contrail-repository
type: puppet
groups: [compute]
required_for: [tools]
requires: [deploy_start, globals]
parameters:
puppet_manifest: puppet/manifests/contrail-compute-repo.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
# Create overrides for Hiera on Controllers: empty predefined_nets
- id: controller-hiera-pre
type: puppet
@ -323,11 +334,32 @@
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
# Congirures DPDK-filter scheduler
- id: controller-dpdk-scheduler
type: puppet
role: [primary-controller, controller]
required_for: [post_deployment_end]
requires: [post_deployment_start]
parameters:
puppet_manifest: puppet/manifests/controller-dpdk.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 120
# Workaround for #1550450
- id: enable_nova_compute_service
type: skipped
# Remove Open vSwitch packages, install and configure Contrail vRouter dkms kernel module
# Set apt pin for packeges that need to be override
- id: contrail-override-repository
type: puppet
role: [compute]
required_for: [post_deployment_end, contrail-compute-hugepages]
requires: [post_deployment_start]
parameters:
puppet_manifest: puppet/manifests/contrail-compute-override.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
# Configures hugepages kernel settings if dpdk is enabled
- id: contrail-compute-hugepages
type: puppet

View File

@ -40,6 +40,12 @@ attributes:
regex:
source: '^(?:(6553[0-5])|(655[0-2]\d)|(65[0-4]\d{2})|(6[0-4]\d{3})|([1-5]\d{4})|([1-9]\d{1,3})|([1-9]))$'
error: "Invalid target"
contrail_global_dpdk:
value: false
label: "Enable DPDK feature for this environment."
description: "Enable this option to unlock the DPDK feature.\nNOTE: You still have to assign DPDK-role to compute nodes to enable DPDK on them."
weight: 70
type: "checkbox"
hugepages_size:
type: 'select'
weight: 120
@ -51,6 +57,9 @@ attributes:
label: '2M'
- data: '1024'
label: "1G"
restrictions:
- action: hide
condition: not (settings:contrail.metadata.enabled == true and settings:contrail.contrail_global_dpdk.value == true)
hugepages_amount:
value: '10'
label: 'Hugepages amount (%)'
@ -60,3 +69,37 @@ attributes:
regex:
source: '^[1-9][0-9]?$|^100$'
error: "Invalid amount of percent"
restrictions:
- condition: "not (settings:contrail.metadata.enabled == true and settings:contrail.contrail_global_dpdk.value == true)"
action: "hide"
vrouter_core_mask:
value: "0x3"
label: "CPU pinning"
description: "Hexadecimal mask that determines how many and what exactly processors will be used for dpdk vrouter"
weight: 131
type: "text"
regex:
source: '0[xX][0-9a-fA-F]+'
error: "Invalid hexadecimal value"
restrictions:
- condition: "not (settings:contrail.metadata.enabled == true and settings:contrail.contrail_global_dpdk.value == true)"
action: "hide"
install_contrail_nova:
value: true
label: "Override Nova"
description: "Override Nova packages from contrail repository."
weight: 140
type: "checkbox"
restrictions:
- action: hide
condition: not (settings:contrail.metadata.enabled == true and settings:contrail.contrail_global_dpdk.value == true)
install_contrail_qemu_lv:
value: true
label: "Override Qemu, Libvirt"
description: "Override Qemu and Libvirt packages from contrail repository"
weight: 150
type: "checkbox"
restrictions:
- action: hide
condition: not (settings:contrail.metadata.enabled == true and settings:contrail.contrail_global_dpdk.value == true)

View File

@ -1,6 +1,5 @@
#!/bin/bash
# Copyright 2015 Mirantis, Inc.
# Copyright 2016 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
@ -31,43 +30,54 @@ PLUGIN_PATH="/var/www/nailgun/plugins/contrail-3.0"
#Now uses the latest package file
UBUNTU_PKG=`find $PLUGIN_PATH -maxdepth 1 -name 'contrail-install-packages*.deb' -exec stat -c "%y %n" {} + | sort -r | head -n 1 | cut -d' ' -f 4`
CENTOS_PKG=`find $PLUGIN_PATH -maxdepth 1 -name 'contrail-install-packages*.rpm' -exec stat -c "%y %n" {} + | sort -r | head -n 1 | cut -d' ' -f 4`
VMWARE_PKG=`find $PLUGIN_PATH -maxdepth 1 -name 'contrail-install-vcenter-plugin*.deb' -exec stat -c "%y %n" {} + | sort -r | head -n 1 | cut -d' ' -f 4`
yum -y install dpkg dpkg-dev createrepo
if [ ! -f "$UBUNTU_PKG" ] && [ ! -f "$CENTOS_PKG" ];
then
echo "No Juniper Contrail packages found at $PLUGIN_PATH. Updating existing plugin repos."
cd $PLUGIN_PATH/repositories/ubuntu/
dpkg-scanpackages ./ | gzip -c - > Packages.gz
cd $PLUGIN_PATH/repositories/centos/
createrepo .
fi
then
echo "No Juniper Contrail packages found at $PLUGIN_PATH. Updating existing plugin repos."
cd $PLUGIN_PATH/repositories/ubuntu/
dpkg-scanpackages ./ | gzip -c - > Packages.gz
cd $PLUGIN_PATH/repositories/centos/
createrepo .
fi
if [ -f "$UBUNTU_PKG" ];
then
DEB=`mktemp -d`
dpkg -x $UBUNTU_PKG $DEB
cd $PLUGIN_PATH/repositories/ubuntu/
find . -type f -name "*.deb" -delete
tar -xzvf $DEB/opt/contrail/contrail_packages/contrail_debs.tgz -C $PLUGIN_PATH/repositories/ubuntu/
if [ -f "$VMWARE_PKG" ];
then
DEB=`mktemp -d`
dpkg -x $UBUNTU_PKG $DEB
cd $PLUGIN_PATH/repositories/ubuntu/
find . -type f -name "*.deb" -delete
tar -xzvf $DEB/opt/contrail/contrail_packages/contrail_debs.tgz -C $PLUGIN_PATH/repositories/ubuntu/
dpkg-scanpackages ./ | gzip -c - > Packages.gz
cp $VMWARE_PKG $PLUGIN_PATH/repositories/ubuntu/
DEB2=`mktemp -d`
dpkg -x $VMWARE_PKG $DEB2
cp $DEB2/opt/contrail/contrail_vcenter_plugin_install_repo/*.deb $PLUGIN_PATH/repositories/ubuntu/
fi
DPDK_PKG=`find $PLUGIN_PATH -maxdepth 4 -name 'dpdk-depends-packages*.deb' -exec stat -c "%y %n" {} + | sort -r | head -n 1 | cut -d' ' -f 4`
if [ -f "$DPDK_PKG" ];
then
DEB3=`mktemp -d`
cp $DPDK_PKG $DEB3
cd $DEB3 && ar vx dpdk-depends-packages*.deb && tar xf data.tar.xz && cp $DEB3/opt/contrail/contrail_install_repo_dpdk/contrail-dpdk-kernel-modules-dkms*.deb $PLUGIN_PATH/repositories/ubuntu/
fi
cd $PLUGIN_PATH/repositories/ubuntu/
dpkg-scanpackages ./ | gzip -c - > Packages.gz
fi
if [ -f "$CENTOS_PKG" ];
then
RPM=`mktemp -d`
cd $RPM
rpm2cpio $CENTOS_PKG | cpio -id
mkdir -p $PLUGIN_PATH/repositories/centos/Packages
cd $PLUGIN_PATH/repositories/centos/
find Packages -type f -name "*.rpm" -delete
tar -xzvf $RPM/opt/contrail/contrail_packages/contrail_rpms.tgz -C $PLUGIN_PATH/repositories/centos/Packages/
createrepo .
fi
then
RPM=`mktemp -d`
cd $RPM
rpm2cpio $CENTOS_PKG | cpio -id
mkdir -p $PLUGIN_PATH/repositories/centos/Packages
cd $PLUGIN_PATH/repositories/centos/
find Packages -type f -name "*.rpm" -delete
tar -xzvf $RPM/opt/contrail/contrail_packages/contrail_rpms.tgz -C $PLUGIN_PATH/repositories/centos/Packages/
createrepo .
fi
echo "DONE"

View File

@ -49,3 +49,6 @@ dpdk:
- contrail-db
- contrail-config
- contrail-control
- ceph-osd
- cinder

View File

@ -6,11 +6,3 @@
puppet_manifest: puppet/manifests/common-repo.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
# Set proper apt pin for Contrail repo
- role: ['compute']
type: puppet
stage: pre_deployment
parameters:
puppet_manifest: puppet/manifests/contrail-compute-repo.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720