Fix the bug with neutron timeout and rework code
- Fixed the bug with neutron timeout - Removed unused code - Fix typos, etc Change-Id: I4159c8e132b445b2d00a5533597e74cc1d67255f Closes-bug: #1621778
This commit is contained in:
parent
5b7daa02e7
commit
0c8903f5b9
|
@ -1,6 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
. /root/openrc
|
||||
|
||||
glance image-update $(glance image-list | awk '/ TestVM / {print $2}') --property hypervisor_type=qemu
|
||||
glance image-update $(glance image-list | awk '/ TestVM-VMDK / {print $2}') --property hypervisor_type=vmware
|
|
@ -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
|
||||
|
@ -12,7 +12,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
notice('MODULAR: fuel-plugin-vmware-dvs/agent')
|
||||
notice('MODULAR: fuel-plugin-vmware-dvs/agents')
|
||||
|
||||
$vcenter = hiera_hash('vcenter', {})
|
||||
$vmware_dvs = hiera_hash('fuel-plugin-vmware-dvs', {})
|
||||
|
@ -22,8 +22,7 @@ $roles = hiera_array('roles', {})
|
|||
$agents = get_agents_data($vcenter, $neutron, $vmware_dvs, $n_fqdn, $roles)
|
||||
|
||||
$defaults = {
|
||||
'neutron_url_timeout' => '3600',
|
||||
'py_root' => '/usr/lib/python2.7/dist-packages',
|
||||
'py_root' => '/usr/lib/python2.7/dist-packages',
|
||||
}
|
||||
|
||||
create_resources(vmware_dvs::agent, $agents, $defaults)
|
||||
|
|
|
@ -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
|
||||
|
@ -14,22 +14,21 @@
|
|||
|
||||
notice('MODULAR: fuel-plugin-vmware-dvs/compute-vmware')
|
||||
|
||||
$neutron_config = hiera_hash('neutron_config')
|
||||
$nova_hash = hiera_hash('nova')
|
||||
|
||||
$management_vip = hiera('management_vip')
|
||||
$service_endpoint = hiera('service_endpoint', $management_vip)
|
||||
$neutron_endpoint = hiera('neutron_endpoint', $management_vip)
|
||||
$admin_password = try_get_value($neutron_config, 'keystone/admin_password')
|
||||
$admin_tenant_name = try_get_value($neutron_config,
|
||||
'keystone/admin_tenant', 'services')
|
||||
$admin_username = try_get_value($neutron_config,
|
||||
'keystone/admin_user', 'neutron')
|
||||
$region_name = hiera('region', 'RegionOne')
|
||||
$auth_api_version = 'v3'
|
||||
$admin_identity_uri = "http://${service_endpoint}:35357"
|
||||
$admin_auth_url = "${admin_identity_uri}/${auth_api_version}"
|
||||
$neutron_url = "http://${neutron_endpoint}:9696"
|
||||
$neutron_config = hiera_hash('neutron_config')
|
||||
$management_vip = hiera('management_vip')
|
||||
$service_endpoint = hiera('service_endpoint', $management_vip)
|
||||
$neutron_endpoint = hiera('neutron_endpoint', $management_vip)
|
||||
$admin_password = try_get_value($neutron_config, 'keystone/admin_password')
|
||||
$admin_tenant_name = try_get_value($neutron_config,
|
||||
'keystone/admin_tenant', 'services')
|
||||
$admin_username = try_get_value($neutron_config,
|
||||
'keystone/admin_user', 'neutron')
|
||||
$region_name = hiera('region', 'RegionOne')
|
||||
$auth_api_version = 'v3'
|
||||
$admin_identity_uri = "http://${service_endpoint}:35357"
|
||||
$admin_auth_url = "${admin_identity_uri}/${auth_api_version}"
|
||||
$neutron_url = "http://${neutron_endpoint}:9696"
|
||||
$neutron_url_timeout = '3600'
|
||||
|
||||
class {'::vmware_dvs::compute':
|
||||
admin_password => $admin_password,
|
||||
|
@ -38,5 +37,5 @@ class {'::vmware_dvs::compute':
|
|||
admin_username => $admin_username,
|
||||
admin_auth_url => $admin_auth_url,
|
||||
neutron_url => $neutron_url,
|
||||
neutron_url_timeout => '3600',
|
||||
neutron_url_timeout => $neutron_url_timeout,
|
||||
}
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
# 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: fuel-plugin-vmware-dvs/controllers')
|
||||
|
||||
$py_root = '/usr/lib/python2.7/dist-packages'
|
||||
$ml2_driver_path = 'neutron/plugins/ml2/drivers/mech_vmware_dvs'
|
||||
$path = "${py_root}/${ml2_driver_path}"
|
||||
|
||||
class {'::vmware_dvs::neutron_server':
|
||||
path => $path,
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
notice('MODULAR: fuel-plugin-vmware-dvs')
|
|
@ -1,4 +1,4 @@
|
|||
notice('MODULAR: fuel-plugin-vmware-dvs/overrride_hiera')
|
||||
notice('MODULAR: fuel-plugin-vmware-dvs/override_hiera')
|
||||
|
||||
$src = '/etc/hiera/override/plugins.yaml'
|
||||
$res = override_hiera($src)
|
||||
$src = '/etc/hiera/plugins/fuel-plugin-vmware-dvs.yaml'
|
||||
$res = override_hiera($src)
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
# 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: fuel-plugin-vmware-dvs/restart-nova-compute')
|
||||
|
||||
$vcenter = hiera_hash('vcenter')
|
||||
$vc_setting = parse_vcenter_settings($vcenter['computes'])
|
||||
|
||||
$defaults = {
|
||||
'current_node' => hiera('fqdn'),
|
||||
'role' => hiera('role'),
|
||||
}
|
||||
|
||||
create_resources(vmware_dvs::ha_nova_restart, $vc_setting, $defaults)
|
|
@ -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
|
||||
|
@ -11,23 +11,14 @@
|
|||
# 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: fuel-plugin-vmware-dvs')
|
||||
notice('MODULAR: fuel-plugin-vmware-dvs/site')
|
||||
|
||||
$vcenter = hiera_hash('vcenter', {})
|
||||
$computes = $vcenter['computes'][0]
|
||||
$vsphere_hostname = $computes['vc_host']
|
||||
$vsphere_login = $computes['vc_user']
|
||||
$vsphere_password = $computes['vc_password']
|
||||
|
||||
$neutron = hiera_hash('neutron_config', {})
|
||||
$py_root = '/usr/lib/python2.7/dist-packages'
|
||||
$ml2_plugin_path = 'neutron/cmd/eventlet/plugins/dvs_neutron_agent.py'
|
||||
$plugin_path = "${py_root}/${ml2_plugin_path}"
|
||||
|
||||
class {'::vmware_dvs':
|
||||
vsphere_hostname => $vsphere_hostname,
|
||||
vsphere_login => $vsphere_login,
|
||||
vsphere_password => $vsphere_password,
|
||||
plugin_path => $plugin_path,
|
||||
plugin_path => $plugin_path,
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
notice('MODULAR: fuel-plugin-vmware-dvs/plugins/ml2.pp')
|
||||
notice('MODULAR: fuel-plugin-vmware-dvs/vmware-dvs-network-plugins-l2')
|
||||
|
||||
class neutron {}
|
||||
class { 'neutron' :}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
# OCF instance parameters:
|
||||
# OCF_RESKEY_binary
|
||||
# OCF_RESKEY_config
|
||||
# OCF_RESKEY_plugin_config
|
||||
# OCF_RESKEY_user
|
||||
# OCF_RESKEY_pid
|
||||
# OCF_RESKEY_additional_parameters
|
||||
|
@ -35,7 +34,6 @@
|
|||
|
||||
OCF_RESKEY_binary_default="neutron-dvs-agent"
|
||||
OCF_RESKEY_config_default="/etc/neutron/neutron.conf"
|
||||
OCF_RESKEY_plugin_config_default="/etc/neutron/plugin.ini"
|
||||
OCF_RESKEY_user_default="neutron"
|
||||
OCF_RESKEY_pid_default="${HA_RSCTMP}/${__SCRIPT_NAME}/${__SCRIPT_NAME}.pid"
|
||||
OCF_RESKEY_log_file_default="/var/log/neutron/vmware-dvs-agent-vcenter-sn.log"
|
||||
|
@ -45,7 +43,6 @@ OCF_RESKEY_debug_default='false'
|
|||
: ${HA_LOGFACILITY="daemon"}
|
||||
: ${OCF_RESKEY_binary=${OCF_RESKEY_binary_default}}
|
||||
: ${OCF_RESKEY_config=${OCF_RESKEY_config_default}}
|
||||
: ${OCF_RESKEY_plugin_config=${OCF_RESKEY_plugin_config_default}}
|
||||
: ${OCF_RESKEY_user=${OCF_RESKEY_user_default}}
|
||||
: ${OCF_RESKEY_pid=${OCF_RESKEY_pid_default}}
|
||||
: ${OCF_RESKEY_log_file=${OCF_RESKEY_log_file_default}}
|
||||
|
@ -100,14 +97,6 @@ Location of the OpenStack Neutron Service (neutron-server) configuration file
|
|||
<content type="string" default="${OCF_RESKEY_config_default}" />
|
||||
</parameter>
|
||||
|
||||
<parameter name="plugin_config" unique="0" required="0">
|
||||
<longdesc lang="en">
|
||||
Location of the OpenStack VMware DVS agent (${OCF_RESKEY_binary}) configuration file
|
||||
</longdesc>
|
||||
<shortdesc lang="en">OpenStack VMware DVS agent (${OCF_RESKEY_binary}) config file</shortdesc>
|
||||
<content type="string" default="${OCF_RESKEY_plugin_config_default}" />
|
||||
</parameter>
|
||||
|
||||
<parameter name="user" unique="0" required="0">
|
||||
<longdesc lang="en">
|
||||
User running OpenStack VMware DVS Service (${OCF_RESKEY_binary})
|
||||
|
@ -250,7 +239,7 @@ neutron_dvs_agent_start() {
|
|||
# run and detach to background neutron-dvs-agent as daemon.
|
||||
# Don't use ocf_run as we're sending the tool's output
|
||||
su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} --config-file=$OCF_RESKEY_config \
|
||||
--config-file=$OCF_RESKEY_plugin_config --log-file=$OCF_RESKEY_log_file $OCF_RESKEY_additional_parameters \
|
||||
--log-file=$OCF_RESKEY_log_file $OCF_RESKEY_additional_parameters \
|
||||
>> /dev/null"' 2>&1 & echo $! > $OCF_RESKEY_pid'
|
||||
ocf_log debug "Create pid file: ${OCF_RESKEY_pid} with content $(cat ${OCF_RESKEY_pid})"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
@ -11,25 +11,29 @@
|
|||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*host*]
|
||||
# (required) String. The host parameter for nova-compute process
|
||||
# Defaults to 'vcenter-servicename'.
|
||||
#
|
||||
# [*vsphere_hostname*]
|
||||
# (required) String. This is a name or ip of VMware vSphere server.
|
||||
# Defaults to '192.168.0.1'.
|
||||
#
|
||||
# [*vsphere_login*]
|
||||
# (required) String. This is a name of VMware vSphere user.
|
||||
# Defaults to 'administrator@vsphere.local'.
|
||||
#
|
||||
# [*vsphere_password*]
|
||||
# (required) String. This is a password of VMware vSphere user.
|
||||
# Defaults to 'StrongPassword!'.
|
||||
#
|
||||
# [*vsphere_insecure*]
|
||||
# (optional) If true, the ESX/vCenter server certificate is not verified.
|
||||
# If false, then the default CA truststore is used for verification.
|
||||
# Defaults to 'True'.
|
||||
# Defaults to 'true'.
|
||||
#
|
||||
# [*vsphere_ca_file*]
|
||||
# (optional) The hash name of the CA bundle file and data in format of:
|
||||
|
@ -39,23 +43,24 @@
|
|||
#
|
||||
# [*network_maps*]
|
||||
# (required) String. This is a name of DVS.
|
||||
#
|
||||
# [*neutron_url_timeout*]
|
||||
# (required) String. This is the timeout for neutron.
|
||||
# Defaults to 'physnet1:dvSwitch1'.
|
||||
#
|
||||
# [*use_fw_driver*]
|
||||
# (optional) Boolean. Use firewall driver or mock.
|
||||
# Defaults to true.
|
||||
#
|
||||
# [*py_root*]
|
||||
# (optional) String. Path for python's dist-packages.
|
||||
# Defaults to '/usr/lib/python2.7/dist-packages'
|
||||
#
|
||||
# [*ha_enabled*]
|
||||
# (optional) Boolean. True for Corosync using.
|
||||
# Defaults to true.
|
||||
#
|
||||
# [*primary*]
|
||||
# (optional) Boolean. Parameter for using that cs_service.
|
||||
|
||||
|
||||
# Defaults to false.
|
||||
#
|
||||
define vmware_dvs::agent(
|
||||
$host = 'vcenter-servicename',
|
||||
$vsphere_hostname = '192.168.0.1',
|
||||
|
@ -65,29 +70,25 @@ define vmware_dvs::agent(
|
|||
$vsphere_ca_file = undef,
|
||||
$network_maps = 'physnet1:dvSwitch1',
|
||||
$use_fw_driver = true,
|
||||
$neutron_url_timeout = '3600',
|
||||
$py_root = '/usr/lib/python2.7/dist-packages',
|
||||
$ha_enabled = true,
|
||||
$primary = false,
|
||||
)
|
||||
{
|
||||
$neutron_conf = '/etc/neutron/neutron.conf'
|
||||
$ml2_conf = '/etc/neutron/plugin.ini'
|
||||
$ocf_dvs_name = 'ocf-neutron-dvs-agent'
|
||||
$ocf_dvs_res = "/usr/lib/ocf/resource.d/fuel/${ocf_dvs_name}"
|
||||
$agent_config = "/etc/neutron/plugins/ml2/vmware_dvs-${host}.ini"
|
||||
$agent_name = "neutron-plugin-vmware-dvs-agent-${host}"
|
||||
$agent_init = "/etc/init/${agent_name}.conf"
|
||||
$agent_initd = "/etc/init.d/${agent_name}"
|
||||
$agent_log = "/var/log/neutron/vmware-dvs-agent-${host}.log"
|
||||
$ocf_pid_dir = '/var/run/resource-agents/ocf-neutron-dvs-agent'
|
||||
$ocf_pid = "${ocf_pid_dir}/${agent_name}.pid"
|
||||
|
||||
$neutron_conf = '/etc/neutron/neutron.conf'
|
||||
$ocf_dvs_name = 'ocf-neutron-dvs-agent'
|
||||
$ocf_dvs_res = "/usr/lib/ocf/resource.d/fuel/${ocf_dvs_name}"
|
||||
$agent_config = "/etc/neutron/plugins/ml2/vmware_dvs-${host}.ini"
|
||||
$agent_name = "neutron-plugin-vmware-dvs-agent-${host}"
|
||||
$agent_init = "/etc/init/${agent_name}.conf"
|
||||
$agent_initd = "/etc/init.d/${agent_name}"
|
||||
$agent_log = "/var/log/neutron/vmware-dvs-agent-${host}.log"
|
||||
$ocf_pid_dir = '/var/run/resource-agents/ocf-neutron-dvs-agent'
|
||||
$ocf_pid = "${ocf_pid_dir}/${agent_name}.pid"
|
||||
$vcenter_ca_file = pick($vsphere_ca_file, {})
|
||||
$vcenter_ca_content = pick($vcenter_ca_file['content'], {})
|
||||
$vcenter_ca_filepath = "/etc/neutron/vmware-${host}-ca.pem"
|
||||
|
||||
|
||||
if $use_fw_driver {
|
||||
$fw_driver = 'networking_vsphere.agent.firewalls.vcenter_firewall.DVSFirewallDriver'
|
||||
}
|
||||
|
@ -95,11 +96,6 @@ define vmware_dvs::agent(
|
|||
$fw_driver = 'networking_vsphere.agent.firewalls.noop_firewall.NoopvCenterFirewallDriver'
|
||||
}
|
||||
|
||||
|
||||
if ! defined(Nova_config['neutron/url_timeout']) {
|
||||
nova_config {'neutron/url_timeout': value => $neutron_url_timeout}
|
||||
}
|
||||
|
||||
if ! defined(File["${py_root}/nova.patch"]) {
|
||||
file {"${py_root}/nova.patch":
|
||||
source => 'puppet:///modules/vmware_dvs/nova.patch',
|
||||
|
@ -169,7 +165,6 @@ define vmware_dvs::agent(
|
|||
'resource-stickiness' => '1'
|
||||
}
|
||||
$parameters = {
|
||||
'plugin_config' => $ml2_conf,
|
||||
'additional_parameters' => "--config-file=${agent_config}",
|
||||
'log_file' => $agent_log,
|
||||
'pid' => $ocf_pid,
|
||||
|
|
|
@ -34,8 +34,9 @@
|
|||
#
|
||||
# [*neutron_url_timeout*]
|
||||
# (optional) String.
|
||||
# Defaults to '3600'.
|
||||
#
|
||||
#
|
||||
|
||||
class vmware_dvs::compute(
|
||||
$admin_password,
|
||||
$admin_tenant_name,
|
||||
|
@ -77,10 +78,4 @@ class vmware_dvs::compute(
|
|||
}
|
||||
Nova_config<| |> ~> Service['nova-compute']
|
||||
|
||||
if($::operatingsystem == 'Ubuntu') {
|
||||
tweaks::ubuntu_service_override { 'nova-network':
|
||||
package_name => 'nova-network',
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
# 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.
|
||||
|
||||
define vmware_dvs::ha_nova_restart(
|
||||
$availability_zone_name,
|
||||
$vc_cluster,
|
||||
$vc_host,
|
||||
$vc_user,
|
||||
$vc_password,
|
||||
$service_name,
|
||||
$current_node,
|
||||
$target_node,
|
||||
$role,
|
||||
$datastore_regex = undef,
|
||||
$api_retry_count = 5,
|
||||
$maximum_objects = 100,
|
||||
$nova_compute_conf = '/etc/nova/nova-compute.conf',
|
||||
$task_poll_interval = 5.0,
|
||||
$use_linked_clone = true,
|
||||
$wsdl_location = undef,
|
||||
$service_enabled = false,
|
||||
)
|
||||
{
|
||||
if $target_node =~ /controller/ and $role =~ /controller/ {
|
||||
|
||||
$res = "p_nova_compute_vmware_${availability_zone_name}-${service_name}"
|
||||
exec {$res:
|
||||
path => '/usr/bin:/usr/sbin:/bin:/sbin',
|
||||
command => "crm resource restart ${res}",
|
||||
}
|
||||
}
|
||||
|
||||
if $target_node in $current_node {
|
||||
exec { 'nova-compute-restart':
|
||||
path => '/usr/bin:/usr/sbin:/bin:/sbin',
|
||||
command => 'service nova-compute restart',
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -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
|
||||
|
@ -11,36 +11,19 @@
|
|||
# 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: ::vmware_dvs
|
||||
#
|
||||
# install the vmware_dvs neutron ml2 driver and configure the neutron for it
|
||||
# Install the vmware_dvs neutron ml2 driver and configure the neutron for it.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*vsphere_hostname*]
|
||||
# (required) String. This is a name or ip of VMware vSphere server.
|
||||
#
|
||||
# [*vsphere_login*]
|
||||
# (required) String. This is a name of VMware vSphere user.
|
||||
#
|
||||
# [*vsphere_password*]
|
||||
# (required) String. This is a password of VMware vSphere user.
|
||||
#
|
||||
# [*network_maps*]
|
||||
# (required) String. This is a name of DVS.
|
||||
#
|
||||
# [*driver_path*]
|
||||
# (required) String. This is the ml2 driver's path.
|
||||
#
|
||||
# [*plugin_path*]
|
||||
# (required) String. This is the ml2 plugin's path.
|
||||
|
||||
# Defaults to 'neutron/cmd/eventlet/plugins/dvs_neutron_agent.py'.
|
||||
#
|
||||
class vmware_dvs(
|
||||
$vsphere_hostname = '192.168.0.1',
|
||||
$vsphere_login = 'administrator@vsphere.loc',
|
||||
$vsphere_password = 'StrongPassword!',
|
||||
$plugin_path = 'neutron/cmd/eventlet/plugins/dvs_neutron_agent.py',
|
||||
$plugin_path = 'neutron/cmd/eventlet/plugins/dvs_neutron_agent.py',
|
||||
)
|
||||
{
|
||||
package { ['python-suds','python-networking-vsphere']:
|
||||
|
@ -55,16 +38,9 @@ class vmware_dvs(
|
|||
path => $plugin_path,
|
||||
source => 'puppet:///modules/vmware_dvs/dvs_neutron_agent.py',
|
||||
}
|
||||
|
||||
neutron_config {
|
||||
'oslo_messaging_notifications/driver': value => 'messagingv2';
|
||||
}
|
||||
neutron_plugin_ml2 {
|
||||
'ml2_vmware/vsphere_hostname': value => $vsphere_hostname;
|
||||
'ml2_vmware/vsphere_login': value => $vsphere_login;
|
||||
'ml2_vmware/vsphere_password': value => $vsphere_password;
|
||||
}
|
||||
file {'/etc/neutron/plugin.ini':
|
||||
ensure => 'link',
|
||||
target => '/etc/neutron/plugins/ml2/ml2_conf.ini',
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,9 +19,9 @@ class vmware_dvs::l2 {
|
|||
$primary_controller = roles_include($neutron_primary_controller_roles)
|
||||
$compute = roles_include($neutron_compute_roles)
|
||||
|
||||
$neutron_config = hiera_hash('neutron_config')
|
||||
$neutron_config = hiera_hash('neutron_config')
|
||||
$neutron_server_enable = pick($neutron_config['neutron_server_enable'], true)
|
||||
$neutron_nodes = hiera_hash('neutron_nodes')
|
||||
$neutron_nodes = hiera_hash('neutron_nodes')
|
||||
|
||||
$dpdk_config = hiera_hash('dpdk', {})
|
||||
$enable_dpdk = pick($dpdk_config['enabled'], false)
|
||||
|
@ -45,10 +45,10 @@ class vmware_dvs::l2 {
|
|||
prepare_network_config($network_scheme)
|
||||
|
||||
$neutron_advanced_config = hiera_hash('neutron_advanced_configuration', { })
|
||||
$l2_population = try_get_value($neutron_advanced_config, 'neutron_l2_pop', false)
|
||||
$dvr = try_get_value($neutron_advanced_config, 'neutron_dvr', false)
|
||||
$enable_qos = pick($neutron_advanced_config['neutron_qos'], false)
|
||||
$segmentation_type = try_get_value($neutron_config, 'L2/segmentation_type')
|
||||
$l2_population = try_get_value($neutron_advanced_config, 'neutron_l2_pop', false)
|
||||
$dvr = try_get_value($neutron_advanced_config, 'neutron_dvr', false)
|
||||
$enable_qos = pick($neutron_advanced_config['neutron_qos'], false)
|
||||
$segmentation_type = try_get_value($neutron_config, 'L2/segmentation_type')
|
||||
|
||||
if $compute and ! $dvr {
|
||||
$do_floating = false
|
||||
|
@ -69,11 +69,11 @@ class vmware_dvs::l2 {
|
|||
})
|
||||
|
||||
if $segmentation_type == 'vlan' {
|
||||
$net_role_property = 'neutron/private'
|
||||
$iface = get_network_role_property($net_role_property, 'phys_dev')
|
||||
$enable_tunneling = false
|
||||
$network_type = 'vlan'
|
||||
$tunnel_types = []
|
||||
$net_role_property = 'neutron/private'
|
||||
$iface = get_network_role_property($net_role_property, 'phys_dev')
|
||||
$enable_tunneling = false
|
||||
$network_type = 'vlan'
|
||||
$tunnel_types = []
|
||||
} else {
|
||||
$net_role_property = 'neutron/mesh'
|
||||
$tunneling_ip = get_network_role_property($net_role_property, 'ipaddr')
|
||||
|
@ -81,11 +81,11 @@ class vmware_dvs::l2 {
|
|||
$physical_net_mtu = pick(get_transformation_property('mtu', $iface[0]), '1500')
|
||||
|
||||
if $segmentation_type == 'gre' {
|
||||
$mtu_offset = '42'
|
||||
$mtu_offset = '42'
|
||||
$network_type = 'gre'
|
||||
} else {
|
||||
# vxlan is the default segmentation type for non-vlan cases
|
||||
$mtu_offset = '50'
|
||||
$mtu_offset = '50'
|
||||
$network_type = 'vxlan'
|
||||
}
|
||||
$tunnel_types = [$network_type]
|
||||
|
@ -137,9 +137,9 @@ class vmware_dvs::l2 {
|
|||
}
|
||||
|
||||
service { 'neutron-server':
|
||||
ensure => $service_ensure,
|
||||
name => $::neutron::params::server_service,
|
||||
enable => $neutron_server_enable,
|
||||
ensure => $service_ensure,
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
tag => 'neutron-service',
|
||||
|
@ -174,8 +174,8 @@ class vmware_dvs::l2 {
|
|||
|
||||
# Stub for upstream neutron manifests
|
||||
package { 'neutron':
|
||||
name => 'binutils',
|
||||
ensure => 'installed',
|
||||
name => 'binutils',
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
# 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.
|
||||
|
||||
# === Parameters
|
||||
#
|
||||
# [*path*]
|
||||
# (required) String. The path to the mech_vmware_dvs ml2 driver.
|
||||
#
|
||||
|
||||
class vmware_dvs::neutron_server(
|
||||
$path = 'filepath',
|
||||
)
|
||||
{
|
||||
service { 'neutron-server':
|
||||
ensure => running,
|
||||
enable => true,
|
||||
subscribe => File[$path],
|
||||
}
|
||||
|
||||
file_line { 'neutron_timeout':
|
||||
path => '/etc/haproxy/conf.d/085-neutron.cfg',
|
||||
line => ' timeout server 1h',
|
||||
after => 'listen neutron',
|
||||
}
|
||||
|
||||
service {'haproxy':
|
||||
ensure => running,
|
||||
hasrestart => true,
|
||||
restart => '/sbin/ip netns exec haproxy service haproxy reload',
|
||||
subscribe => File_Line['neutron_timeout'],
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
host=<%= @host %>
|
||||
|
||||
[securitygroup]
|
||||
enable_security_group = <%= @use_fw_driver %>
|
||||
enable_security_group=<%= @use_fw_driver %>
|
||||
firewall_driver=<%= @fw_driver %>
|
||||
|
||||
[ml2_vmware]
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Neutron VMware DVS Agent
|
||||
# Description: Agent to use within neutron vmware dvs driver
|
||||
# Description: Agent to use within Neutron VMware DVS driver
|
||||
### END INIT INFO
|
||||
|
||||
# Authors: Igor Gajsin <igajsin@mirantis.com>
|
||||
|
||||
DESC="Openstack Neutron VMware DVS Plugin Agent"
|
||||
PROJECT_NAME=neutron
|
||||
NAME=${PROJECT_NAME}-vmware-dvs-agent
|
||||
NAME=<%= @agent_name %>
|
||||
CONFIG_FILE=<%= @agent_config %>
|
||||
|
||||
DAEMON=/usr/bin/neutron-dvs-agent
|
||||
DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/plugins/ml2/ml2_conf.ini"
|
||||
DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf"
|
||||
#!/bin/sh
|
||||
# The content after this line comes from openstack-pkg-tools
|
||||
# and has been automatically added to a .init.in script, which
|
||||
|
@ -41,7 +41,7 @@ fi
|
|||
if [ -z "${SYSTEM_USER}" ] ; then
|
||||
SYSTEM_USER=${PROJECT_NAME}
|
||||
fi
|
||||
if [ -z "${SYSTEM_USER}" ] ; then
|
||||
if [ -z "${SYSTEM_GROUP}" ] ; then
|
||||
SYSTEM_GROUP=${PROJECT_NAME}
|
||||
fi
|
||||
if [ "${SYSTEM_USER}" != "root" ] ; then
|
||||
|
@ -60,10 +60,10 @@ fi
|
|||
|
||||
# If ran as root, create /var/lock/X, /var/run/X, /var/lib/X and /var/log/X as needed
|
||||
if [ `whoami` = "root" ] ; then
|
||||
for i in lock run log lib ; do
|
||||
mkdir -p /var/$i/${PROJECT_NAME}
|
||||
chown ${SYSTEM_USER} /var/$i/${PROJECT_NAME}
|
||||
done
|
||||
for i in lock run log lib ; do
|
||||
mkdir -p /var/$i/${PROJECT_NAME}
|
||||
chown ${SYSTEM_USER} /var/$i/${PROJECT_NAME}
|
||||
done
|
||||
fi
|
||||
|
||||
# This defines init_is_upstart which we use later on (+ more...)
|
||||
|
@ -73,7 +73,9 @@ fi
|
|||
[ -r /etc/default/openstack ] && . /etc/default/openstack
|
||||
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
|
||||
[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
|
||||
[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=$LOGFILE"
|
||||
if [ -z "${NO_OPENSTACK_LOGFILE_DAEMON_ARG}" ] ; then
|
||||
[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=$LOGFILE"
|
||||
fi
|
||||
|
||||
do_start() {
|
||||
start-stop-daemon --start --quiet --background ${STARTDAEMON_CHUID} --make-pidfile --pidfile ${PIDFILE} --chdir /var/lib/${PROJECT_NAME} --startas $DAEMON \
|
||||
|
@ -95,48 +97,48 @@ do_systemd_start() {
|
|||
|
||||
case "$1" in
|
||||
start)
|
||||
init_is_upstart > /dev/null 2>&1 && exit 1
|
||||
log_daemon_msg "Starting $DESC" "$NAME"
|
||||
do_start
|
||||
case $? in
|
||||
0|1) log_end_msg 0 ;;
|
||||
2) log_end_msg 1 ;;
|
||||
esac
|
||||
init_is_upstart > /dev/null 2>&1 && exit 1
|
||||
log_daemon_msg "Starting $DESC" "$NAME"
|
||||
do_start
|
||||
case $? in
|
||||
0|1) log_end_msg 0 ;;
|
||||
2) log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
stop)
|
||||
init_is_upstart > /dev/null 2>&1 && exit 0
|
||||
log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
do_stop
|
||||
case $? in
|
||||
0|1) log_end_msg 0 ;;
|
||||
2) log_end_msg 1 ;;
|
||||
esac
|
||||
init_is_upstart > /dev/null 2>&1 && exit 0
|
||||
log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
do_stop
|
||||
case $? in
|
||||
0|1) log_end_msg 0 ;;
|
||||
2) log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
status)
|
||||
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||
;;
|
||||
systemd-start)
|
||||
do_systemd_start
|
||||
do_systemd_start
|
||||
;;
|
||||
restart|force-reload)
|
||||
init_is_upstart > /dev/null 2>&1 && exit 1
|
||||
log_daemon_msg "Restarting $DESC" "$NAME"
|
||||
do_stop
|
||||
case $? in
|
||||
0|1)
|
||||
do_start
|
||||
case $? in
|
||||
0) log_end_msg 0 ;;
|
||||
1) log_end_msg 1 ;; # Old process is still running
|
||||
*) log_end_msg 1 ;; # Failed to start
|
||||
esac
|
||||
;;
|
||||
*) log_end_msg 1 ;; # Failed to stop
|
||||
esac
|
||||
init_is_upstart > /dev/null 2>&1 && exit 1
|
||||
log_daemon_msg "Restarting $DESC" "$NAME"
|
||||
do_stop
|
||||
case $? in
|
||||
0|1)
|
||||
do_start
|
||||
case $? in
|
||||
0) log_end_msg 0 ;;
|
||||
1) log_end_msg 1 ;; # Old process is still running
|
||||
*) log_end_msg 1 ;; # Failed to start
|
||||
esac
|
||||
;;
|
||||
*) log_end_msg 1 ;; # Failed to stop
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload|systemd-start}" >&2
|
||||
exit 3
|
||||
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload|systemd-start}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
description "Neutron vmware dvs plugin agent"
|
||||
description "Neutron VMware DVS plugin agent"
|
||||
author "Igor Gajsin <igajsin@mirantis.com>"
|
||||
|
||||
start on runlevel [2345]
|
||||
stop on runlevel [016]
|
||||
stop on runlevel [!2345]
|
||||
|
||||
chdir /var/run
|
||||
|
||||
|
@ -11,32 +11,33 @@ respawn limit 20 5
|
|||
limit nofile 65535 65535
|
||||
|
||||
pre-start script
|
||||
mkdir -p /var/run/neutron
|
||||
chown neutron:root /var/run/neutron
|
||||
for i in lock run log lib ; do
|
||||
mkdir -p /var/$i/neutron
|
||||
chown neutron /var/$i/neutron
|
||||
done
|
||||
end script
|
||||
|
||||
script
|
||||
[ -r /usr/share/neutron-common/plugin_guess_func ] || exit 0
|
||||
. /usr/share/neutron-common/plugin_guess_func
|
||||
|
||||
if ! [ -r /etc/neutron/neutron.conf ] ; then
|
||||
echo "Cloud not read /etc/neutron/neutron.conf: exiting"
|
||||
exit 0
|
||||
fi
|
||||
CURRENT_PLUGIN=`grep "^[ \t]*core_plugin[ \t]*=[ \t]*[._a-zA-Z0-9]*\$" /etc/neutron/neutron.conf | sed -e 's/^[ \t]*core_plugin[ \t]*=[ \t]*//'`
|
||||
if [ -z "${CURRENT_PLUGIN}" ] ; then
|
||||
echo "No core_plugin= value found: please set it and try again"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
neutron_core_plugin_to_plugin_name ${CURRENT_PLUGIN}
|
||||
neutron_plugin_ini_path ${NEUTRON_PLUGIN_NAME}
|
||||
[ -r "$NEUTRON_PLUGIN_CONFIG" ] && CONF_ARG="--config-file $NEUTRON_PLUGIN_CONFIG --config-file <%= @agent_config %>"
|
||||
[ -x "/usr/bin/neutron-dvs-agent" ] || {
|
||||
echo "$UPSTART_JOB" "ERROR: /usr/bin/neutron-dvs-agent not exists : exiting";
|
||||
exit 0;
|
||||
}
|
||||
[ -r /etc/neutron/neutron.conf ] || {
|
||||
echo "$UPSTART_JOB" "ERROR: Cloud not read /etc/neutron/neutron.conf: exiting";
|
||||
exit 0;
|
||||
}
|
||||
DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf"
|
||||
CONFIG_FILE="<%= @agent_config %>"
|
||||
USE_SYSLOG=""
|
||||
USE_LOGFILE=""
|
||||
NO_OPENSTACK_CONFIG_FILE_DAEMON_ARG=""
|
||||
[ -r /etc/default/openstack ] && . /etc/default/openstack
|
||||
[ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
|
||||
|
||||
[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
|
||||
[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=<%= @agent_log %>"
|
||||
exec start-stop-daemon --start --chuid neutron:neutron --exec /usr/bin/neutron-dvs-agent -- \
|
||||
--config-file=/etc/neutron/neutron.conf $CONF_ARG $DAEMON_ARGS
|
||||
[ -z "$NO_OPENSTACK_CONFIG_FILE_DAEMON_ARG" ] && DAEMON_ARGS="$DAEMON_ARGS --config-file=$CONFIG_FILE"
|
||||
|
||||
exec start-stop-daemon --start --chdir /var/lib/neutron \
|
||||
--chuid neutron:neutron --make-pidfile --pidfile /var/run/neutron/$UPSTART_JOB.pid \
|
||||
--exec /usr/bin/neutron-dvs-agent -- ${DAEMON_ARGS}
|
||||
end script
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
- id: vmware-dvs-set-neutron-timeout
|
||||
version: 2.1.0
|
||||
groups: ['primary-controller','controller']
|
||||
required_for: [deploy_end]
|
||||
required_for: [vmware-vcenter]
|
||||
requires: [openstack-network-server-nova]
|
||||
type: puppet
|
||||
parameters:
|
||||
|
|
Loading…
Reference in New Issue