Merge "Fix the bug with neutron timeout and rework code"
This commit is contained in:
commit
18211e467b
|
@ -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
|
# 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
|
# 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
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
notice('MODULAR: fuel-plugin-vmware-dvs/agent')
|
notice('MODULAR: fuel-plugin-vmware-dvs/agents')
|
||||||
|
|
||||||
$vcenter = hiera_hash('vcenter', {})
|
$vcenter = hiera_hash('vcenter', {})
|
||||||
$vmware_dvs = hiera_hash('fuel-plugin-vmware-dvs', {})
|
$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)
|
$agents = get_agents_data($vcenter, $neutron, $vmware_dvs, $n_fqdn, $roles)
|
||||||
|
|
||||||
$defaults = {
|
$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)
|
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
|
# 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
|
# 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')
|
notice('MODULAR: fuel-plugin-vmware-dvs/compute-vmware')
|
||||||
|
|
||||||
$neutron_config = hiera_hash('neutron_config')
|
$neutron_config = hiera_hash('neutron_config')
|
||||||
$nova_hash = hiera_hash('nova')
|
$management_vip = hiera('management_vip')
|
||||||
|
$service_endpoint = hiera('service_endpoint', $management_vip)
|
||||||
$management_vip = hiera('management_vip')
|
$neutron_endpoint = hiera('neutron_endpoint', $management_vip)
|
||||||
$service_endpoint = hiera('service_endpoint', $management_vip)
|
$admin_password = try_get_value($neutron_config, 'keystone/admin_password')
|
||||||
$neutron_endpoint = hiera('neutron_endpoint', $management_vip)
|
$admin_tenant_name = try_get_value($neutron_config,
|
||||||
$admin_password = try_get_value($neutron_config, 'keystone/admin_password')
|
'keystone/admin_tenant', 'services')
|
||||||
$admin_tenant_name = try_get_value($neutron_config,
|
$admin_username = try_get_value($neutron_config,
|
||||||
'keystone/admin_tenant', 'services')
|
'keystone/admin_user', 'neutron')
|
||||||
$admin_username = try_get_value($neutron_config,
|
$region_name = hiera('region', 'RegionOne')
|
||||||
'keystone/admin_user', 'neutron')
|
$auth_api_version = 'v3'
|
||||||
$region_name = hiera('region', 'RegionOne')
|
$admin_identity_uri = "http://${service_endpoint}:35357"
|
||||||
$auth_api_version = 'v3'
|
$admin_auth_url = "${admin_identity_uri}/${auth_api_version}"
|
||||||
$admin_identity_uri = "http://${service_endpoint}:35357"
|
$neutron_url = "http://${neutron_endpoint}:9696"
|
||||||
$admin_auth_url = "${admin_identity_uri}/${auth_api_version}"
|
$neutron_url_timeout = '3600'
|
||||||
$neutron_url = "http://${neutron_endpoint}:9696"
|
|
||||||
|
|
||||||
class {'::vmware_dvs::compute':
|
class {'::vmware_dvs::compute':
|
||||||
admin_password => $admin_password,
|
admin_password => $admin_password,
|
||||||
|
@ -38,5 +37,5 @@ class {'::vmware_dvs::compute':
|
||||||
admin_username => $admin_username,
|
admin_username => $admin_username,
|
||||||
admin_auth_url => $admin_auth_url,
|
admin_auth_url => $admin_auth_url,
|
||||||
neutron_url => $neutron_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'
|
$src = '/etc/hiera/plugins/fuel-plugin-vmware-dvs.yaml'
|
||||||
$res = override_hiera($src)
|
$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
|
# 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
|
# 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
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# 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'
|
$py_root = '/usr/lib/python2.7/dist-packages'
|
||||||
$ml2_plugin_path = 'neutron/cmd/eventlet/plugins/dvs_neutron_agent.py'
|
$ml2_plugin_path = 'neutron/cmd/eventlet/plugins/dvs_neutron_agent.py'
|
||||||
$plugin_path = "${py_root}/${ml2_plugin_path}"
|
$plugin_path = "${py_root}/${ml2_plugin_path}"
|
||||||
|
|
||||||
class {'::vmware_dvs':
|
class {'::vmware_dvs':
|
||||||
vsphere_hostname => $vsphere_hostname,
|
plugin_path => $plugin_path,
|
||||||
vsphere_login => $vsphere_login,
|
|
||||||
vsphere_password => $vsphere_password,
|
|
||||||
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 {}
|
||||||
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
|
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
|
not use this file except in compliance with the License. You may obtain
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
# OCF instance parameters:
|
# OCF instance parameters:
|
||||||
# OCF_RESKEY_binary
|
# OCF_RESKEY_binary
|
||||||
# OCF_RESKEY_config
|
# OCF_RESKEY_config
|
||||||
# OCF_RESKEY_plugin_config
|
|
||||||
# OCF_RESKEY_user
|
# OCF_RESKEY_user
|
||||||
# OCF_RESKEY_pid
|
# OCF_RESKEY_pid
|
||||||
# OCF_RESKEY_additional_parameters
|
# OCF_RESKEY_additional_parameters
|
||||||
|
@ -35,7 +34,6 @@
|
||||||
|
|
||||||
OCF_RESKEY_binary_default="neutron-dvs-agent"
|
OCF_RESKEY_binary_default="neutron-dvs-agent"
|
||||||
OCF_RESKEY_config_default="/etc/neutron/neutron.conf"
|
OCF_RESKEY_config_default="/etc/neutron/neutron.conf"
|
||||||
OCF_RESKEY_plugin_config_default="/etc/neutron/plugin.ini"
|
|
||||||
OCF_RESKEY_user_default="neutron"
|
OCF_RESKEY_user_default="neutron"
|
||||||
OCF_RESKEY_pid_default="${HA_RSCTMP}/${__SCRIPT_NAME}/${__SCRIPT_NAME}.pid"
|
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"
|
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"}
|
: ${HA_LOGFACILITY="daemon"}
|
||||||
: ${OCF_RESKEY_binary=${OCF_RESKEY_binary_default}}
|
: ${OCF_RESKEY_binary=${OCF_RESKEY_binary_default}}
|
||||||
: ${OCF_RESKEY_config=${OCF_RESKEY_config_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_user=${OCF_RESKEY_user_default}}
|
||||||
: ${OCF_RESKEY_pid=${OCF_RESKEY_pid_default}}
|
: ${OCF_RESKEY_pid=${OCF_RESKEY_pid_default}}
|
||||||
: ${OCF_RESKEY_log_file=${OCF_RESKEY_log_file_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}" />
|
<content type="string" default="${OCF_RESKEY_config_default}" />
|
||||||
</parameter>
|
</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">
|
<parameter name="user" unique="0" required="0">
|
||||||
<longdesc lang="en">
|
<longdesc lang="en">
|
||||||
User running OpenStack VMware DVS Service (${OCF_RESKEY_binary})
|
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.
|
# run and detach to background neutron-dvs-agent as daemon.
|
||||||
# Don't use ocf_run as we're sending the tool's output
|
# 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 \
|
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'
|
>> /dev/null"' 2>&1 & echo $! > $OCF_RESKEY_pid'
|
||||||
ocf_log debug "Create pid file: ${OCF_RESKEY_pid} with content $(cat ${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
|
# 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
|
# 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
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
#
|
||||||
# === Parameters
|
# === Parameters
|
||||||
#
|
#
|
||||||
# [*host*]
|
# [*host*]
|
||||||
# (required) String. The host parameter for nova-compute process
|
# (required) String. The host parameter for nova-compute process
|
||||||
|
# Defaults to 'vcenter-servicename'.
|
||||||
#
|
#
|
||||||
# [*vsphere_hostname*]
|
# [*vsphere_hostname*]
|
||||||
# (required) String. This is a name or ip of VMware vSphere server.
|
# (required) String. This is a name or ip of VMware vSphere server.
|
||||||
|
# Defaults to '192.168.0.1'.
|
||||||
#
|
#
|
||||||
# [*vsphere_login*]
|
# [*vsphere_login*]
|
||||||
# (required) String. This is a name of VMware vSphere user.
|
# (required) String. This is a name of VMware vSphere user.
|
||||||
|
# Defaults to 'administrator@vsphere.local'.
|
||||||
#
|
#
|
||||||
# [*vsphere_password*]
|
# [*vsphere_password*]
|
||||||
# (required) String. This is a password of VMware vSphere user.
|
# (required) String. This is a password of VMware vSphere user.
|
||||||
|
# Defaults to 'StrongPassword!'.
|
||||||
#
|
#
|
||||||
# [*vsphere_insecure*]
|
# [*vsphere_insecure*]
|
||||||
# (optional) If true, the ESX/vCenter server certificate is not verified.
|
# (optional) If true, the ESX/vCenter server certificate is not verified.
|
||||||
# If false, then the default CA truststore is used for verification.
|
# If false, then the default CA truststore is used for verification.
|
||||||
# Defaults to 'True'.
|
# Defaults to 'true'.
|
||||||
#
|
#
|
||||||
# [*vsphere_ca_file*]
|
# [*vsphere_ca_file*]
|
||||||
# (optional) The hash name of the CA bundle file and data in format of:
|
# (optional) The hash name of the CA bundle file and data in format of:
|
||||||
|
@ -39,23 +43,24 @@
|
||||||
#
|
#
|
||||||
# [*network_maps*]
|
# [*network_maps*]
|
||||||
# (required) String. This is a name of DVS.
|
# (required) String. This is a name of DVS.
|
||||||
#
|
# Defaults to 'physnet1:dvSwitch1'.
|
||||||
# [*neutron_url_timeout*]
|
|
||||||
# (required) String. This is the timeout for neutron.
|
|
||||||
#
|
#
|
||||||
# [*use_fw_driver*]
|
# [*use_fw_driver*]
|
||||||
# (optional) Boolean. Use firewall driver or mock.
|
# (optional) Boolean. Use firewall driver or mock.
|
||||||
|
# Defaults to true.
|
||||||
#
|
#
|
||||||
# [*py_root*]
|
# [*py_root*]
|
||||||
# (optional) String. Path for python's dist-packages.
|
# (optional) String. Path for python's dist-packages.
|
||||||
|
# Defaults to '/usr/lib/python2.7/dist-packages'
|
||||||
#
|
#
|
||||||
# [*ha_enabled*]
|
# [*ha_enabled*]
|
||||||
# (optional) Boolean. True for Corosync using.
|
# (optional) Boolean. True for Corosync using.
|
||||||
|
# Defaults to true.
|
||||||
#
|
#
|
||||||
# [*primary*]
|
# [*primary*]
|
||||||
# (optional) Boolean. Parameter for using that cs_service.
|
# (optional) Boolean. Parameter for using that cs_service.
|
||||||
|
# Defaults to false.
|
||||||
|
#
|
||||||
define vmware_dvs::agent(
|
define vmware_dvs::agent(
|
||||||
$host = 'vcenter-servicename',
|
$host = 'vcenter-servicename',
|
||||||
$vsphere_hostname = '192.168.0.1',
|
$vsphere_hostname = '192.168.0.1',
|
||||||
|
@ -65,29 +70,25 @@ define vmware_dvs::agent(
|
||||||
$vsphere_ca_file = undef,
|
$vsphere_ca_file = undef,
|
||||||
$network_maps = 'physnet1:dvSwitch1',
|
$network_maps = 'physnet1:dvSwitch1',
|
||||||
$use_fw_driver = true,
|
$use_fw_driver = true,
|
||||||
$neutron_url_timeout = '3600',
|
|
||||||
$py_root = '/usr/lib/python2.7/dist-packages',
|
$py_root = '/usr/lib/python2.7/dist-packages',
|
||||||
$ha_enabled = true,
|
$ha_enabled = true,
|
||||||
$primary = false,
|
$primary = false,
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$neutron_conf = '/etc/neutron/neutron.conf'
|
$neutron_conf = '/etc/neutron/neutron.conf'
|
||||||
$ml2_conf = '/etc/neutron/plugin.ini'
|
$ocf_dvs_name = 'ocf-neutron-dvs-agent'
|
||||||
$ocf_dvs_name = 'ocf-neutron-dvs-agent'
|
$ocf_dvs_res = "/usr/lib/ocf/resource.d/fuel/${ocf_dvs_name}"
|
||||||
$ocf_dvs_res = "/usr/lib/ocf/resource.d/fuel/${ocf_dvs_name}"
|
$agent_config = "/etc/neutron/plugins/ml2/vmware_dvs-${host}.ini"
|
||||||
$agent_config = "/etc/neutron/plugins/ml2/vmware_dvs-${host}.ini"
|
$agent_name = "neutron-plugin-vmware-dvs-agent-${host}"
|
||||||
$agent_name = "neutron-plugin-vmware-dvs-agent-${host}"
|
$agent_init = "/etc/init/${agent_name}.conf"
|
||||||
$agent_init = "/etc/init/${agent_name}.conf"
|
$agent_initd = "/etc/init.d/${agent_name}"
|
||||||
$agent_initd = "/etc/init.d/${agent_name}"
|
$agent_log = "/var/log/neutron/vmware-dvs-agent-${host}.log"
|
||||||
$agent_log = "/var/log/neutron/vmware-dvs-agent-${host}.log"
|
$ocf_pid_dir = '/var/run/resource-agents/ocf-neutron-dvs-agent'
|
||||||
$ocf_pid_dir = '/var/run/resource-agents/ocf-neutron-dvs-agent'
|
$ocf_pid = "${ocf_pid_dir}/${agent_name}.pid"
|
||||||
$ocf_pid = "${ocf_pid_dir}/${agent_name}.pid"
|
|
||||||
|
|
||||||
$vcenter_ca_file = pick($vsphere_ca_file, {})
|
$vcenter_ca_file = pick($vsphere_ca_file, {})
|
||||||
$vcenter_ca_content = pick($vcenter_ca_file['content'], {})
|
$vcenter_ca_content = pick($vcenter_ca_file['content'], {})
|
||||||
$vcenter_ca_filepath = "/etc/neutron/vmware-${host}-ca.pem"
|
$vcenter_ca_filepath = "/etc/neutron/vmware-${host}-ca.pem"
|
||||||
|
|
||||||
|
|
||||||
if $use_fw_driver {
|
if $use_fw_driver {
|
||||||
$fw_driver = 'networking_vsphere.agent.firewalls.vcenter_firewall.DVSFirewallDriver'
|
$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'
|
$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"]) {
|
if ! defined(File["${py_root}/nova.patch"]) {
|
||||||
file {"${py_root}/nova.patch":
|
file {"${py_root}/nova.patch":
|
||||||
source => 'puppet:///modules/vmware_dvs/nova.patch',
|
source => 'puppet:///modules/vmware_dvs/nova.patch',
|
||||||
|
@ -169,7 +165,6 @@ define vmware_dvs::agent(
|
||||||
'resource-stickiness' => '1'
|
'resource-stickiness' => '1'
|
||||||
}
|
}
|
||||||
$parameters = {
|
$parameters = {
|
||||||
'plugin_config' => $ml2_conf,
|
|
||||||
'additional_parameters' => "--config-file=${agent_config}",
|
'additional_parameters' => "--config-file=${agent_config}",
|
||||||
'log_file' => $agent_log,
|
'log_file' => $agent_log,
|
||||||
'pid' => $ocf_pid,
|
'pid' => $ocf_pid,
|
||||||
|
|
|
@ -34,8 +34,9 @@
|
||||||
#
|
#
|
||||||
# [*neutron_url_timeout*]
|
# [*neutron_url_timeout*]
|
||||||
# (optional) String.
|
# (optional) String.
|
||||||
|
# Defaults to '3600'.
|
||||||
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
class vmware_dvs::compute(
|
class vmware_dvs::compute(
|
||||||
$admin_password,
|
$admin_password,
|
||||||
$admin_tenant_name,
|
$admin_tenant_name,
|
||||||
|
@ -77,10 +78,4 @@ class vmware_dvs::compute(
|
||||||
}
|
}
|
||||||
Nova_config<| |> ~> Service['nova-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
|
# 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
|
# 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
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
#
|
||||||
# == Class: ::vmware_dvs
|
# == 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
|
# === 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*]
|
# [*plugin_path*]
|
||||||
# (required) String. This is the ml2 plugin's path.
|
# (required) String. This is the ml2 plugin's path.
|
||||||
|
# Defaults to 'neutron/cmd/eventlet/plugins/dvs_neutron_agent.py'.
|
||||||
|
#
|
||||||
class vmware_dvs(
|
class vmware_dvs(
|
||||||
$vsphere_hostname = '192.168.0.1',
|
$plugin_path = 'neutron/cmd/eventlet/plugins/dvs_neutron_agent.py',
|
||||||
$vsphere_login = 'administrator@vsphere.loc',
|
|
||||||
$vsphere_password = 'StrongPassword!',
|
|
||||||
$plugin_path = 'neutron/cmd/eventlet/plugins/dvs_neutron_agent.py',
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
package { ['python-suds','python-networking-vsphere']:
|
package { ['python-suds','python-networking-vsphere']:
|
||||||
|
@ -55,16 +38,9 @@ class vmware_dvs(
|
||||||
path => $plugin_path,
|
path => $plugin_path,
|
||||||
source => 'puppet:///modules/vmware_dvs/dvs_neutron_agent.py',
|
source => 'puppet:///modules/vmware_dvs/dvs_neutron_agent.py',
|
||||||
}
|
}
|
||||||
|
|
||||||
neutron_config {
|
neutron_config {
|
||||||
'oslo_messaging_notifications/driver': value => 'messagingv2';
|
'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)
|
$primary_controller = roles_include($neutron_primary_controller_roles)
|
||||||
$compute = roles_include($neutron_compute_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_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', {})
|
$dpdk_config = hiera_hash('dpdk', {})
|
||||||
$enable_dpdk = pick($dpdk_config['enabled'], false)
|
$enable_dpdk = pick($dpdk_config['enabled'], false)
|
||||||
|
@ -45,10 +45,10 @@ class vmware_dvs::l2 {
|
||||||
prepare_network_config($network_scheme)
|
prepare_network_config($network_scheme)
|
||||||
|
|
||||||
$neutron_advanced_config = hiera_hash('neutron_advanced_configuration', { })
|
$neutron_advanced_config = hiera_hash('neutron_advanced_configuration', { })
|
||||||
$l2_population = try_get_value($neutron_advanced_config, 'neutron_l2_pop', false)
|
$l2_population = try_get_value($neutron_advanced_config, 'neutron_l2_pop', false)
|
||||||
$dvr = try_get_value($neutron_advanced_config, 'neutron_dvr', false)
|
$dvr = try_get_value($neutron_advanced_config, 'neutron_dvr', false)
|
||||||
$enable_qos = pick($neutron_advanced_config['neutron_qos'], false)
|
$enable_qos = pick($neutron_advanced_config['neutron_qos'], false)
|
||||||
$segmentation_type = try_get_value($neutron_config, 'L2/segmentation_type')
|
$segmentation_type = try_get_value($neutron_config, 'L2/segmentation_type')
|
||||||
|
|
||||||
if $compute and ! $dvr {
|
if $compute and ! $dvr {
|
||||||
$do_floating = false
|
$do_floating = false
|
||||||
|
@ -69,11 +69,11 @@ class vmware_dvs::l2 {
|
||||||
})
|
})
|
||||||
|
|
||||||
if $segmentation_type == 'vlan' {
|
if $segmentation_type == 'vlan' {
|
||||||
$net_role_property = 'neutron/private'
|
$net_role_property = 'neutron/private'
|
||||||
$iface = get_network_role_property($net_role_property, 'phys_dev')
|
$iface = get_network_role_property($net_role_property, 'phys_dev')
|
||||||
$enable_tunneling = false
|
$enable_tunneling = false
|
||||||
$network_type = 'vlan'
|
$network_type = 'vlan'
|
||||||
$tunnel_types = []
|
$tunnel_types = []
|
||||||
} else {
|
} else {
|
||||||
$net_role_property = 'neutron/mesh'
|
$net_role_property = 'neutron/mesh'
|
||||||
$tunneling_ip = get_network_role_property($net_role_property, 'ipaddr')
|
$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')
|
$physical_net_mtu = pick(get_transformation_property('mtu', $iface[0]), '1500')
|
||||||
|
|
||||||
if $segmentation_type == 'gre' {
|
if $segmentation_type == 'gre' {
|
||||||
$mtu_offset = '42'
|
$mtu_offset = '42'
|
||||||
$network_type = 'gre'
|
$network_type = 'gre'
|
||||||
} else {
|
} else {
|
||||||
# vxlan is the default segmentation type for non-vlan cases
|
# vxlan is the default segmentation type for non-vlan cases
|
||||||
$mtu_offset = '50'
|
$mtu_offset = '50'
|
||||||
$network_type = 'vxlan'
|
$network_type = 'vxlan'
|
||||||
}
|
}
|
||||||
$tunnel_types = [$network_type]
|
$tunnel_types = [$network_type]
|
||||||
|
@ -137,9 +137,9 @@ class vmware_dvs::l2 {
|
||||||
}
|
}
|
||||||
|
|
||||||
service { 'neutron-server':
|
service { 'neutron-server':
|
||||||
|
ensure => $service_ensure,
|
||||||
name => $::neutron::params::server_service,
|
name => $::neutron::params::server_service,
|
||||||
enable => $neutron_server_enable,
|
enable => $neutron_server_enable,
|
||||||
ensure => $service_ensure,
|
|
||||||
hasstatus => true,
|
hasstatus => true,
|
||||||
hasrestart => true,
|
hasrestart => true,
|
||||||
tag => 'neutron-service',
|
tag => 'neutron-service',
|
||||||
|
@ -174,8 +174,8 @@ class vmware_dvs::l2 {
|
||||||
|
|
||||||
# Stub for upstream neutron manifests
|
# Stub for upstream neutron manifests
|
||||||
package { 'neutron':
|
package { 'neutron':
|
||||||
name => 'binutils',
|
|
||||||
ensure => 'installed',
|
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 %>
|
host=<%= @host %>
|
||||||
|
|
||||||
[securitygroup]
|
[securitygroup]
|
||||||
enable_security_group = <%= @use_fw_driver %>
|
enable_security_group=<%= @use_fw_driver %>
|
||||||
firewall_driver=<%= @fw_driver %>
|
firewall_driver=<%= @fw_driver %>
|
||||||
|
|
||||||
[ml2_vmware]
|
[ml2_vmware]
|
||||||
|
|
|
@ -8,18 +8,18 @@
|
||||||
# Default-Start: 2 3 4 5
|
# Default-Start: 2 3 4 5
|
||||||
# Default-Stop: 0 1 6
|
# Default-Stop: 0 1 6
|
||||||
# Short-Description: Neutron VMware DVS Agent
|
# 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
|
### END INIT INFO
|
||||||
|
|
||||||
# Authors: Igor Gajsin <igajsin@mirantis.com>
|
# Authors: Igor Gajsin <igajsin@mirantis.com>
|
||||||
|
|
||||||
DESC="Openstack Neutron VMware DVS Plugin Agent"
|
DESC="Openstack Neutron VMware DVS Plugin Agent"
|
||||||
PROJECT_NAME=neutron
|
PROJECT_NAME=neutron
|
||||||
NAME=${PROJECT_NAME}-vmware-dvs-agent
|
NAME=<%= @agent_name %>
|
||||||
CONFIG_FILE=<%= @agent_config %>
|
CONFIG_FILE=<%= @agent_config %>
|
||||||
|
|
||||||
DAEMON=/usr/bin/neutron-dvs-agent
|
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
|
#!/bin/sh
|
||||||
# The content after this line comes from openstack-pkg-tools
|
# The content after this line comes from openstack-pkg-tools
|
||||||
# and has been automatically added to a .init.in script, which
|
# and has been automatically added to a .init.in script, which
|
||||||
|
@ -41,7 +41,7 @@ fi
|
||||||
if [ -z "${SYSTEM_USER}" ] ; then
|
if [ -z "${SYSTEM_USER}" ] ; then
|
||||||
SYSTEM_USER=${PROJECT_NAME}
|
SYSTEM_USER=${PROJECT_NAME}
|
||||||
fi
|
fi
|
||||||
if [ -z "${SYSTEM_USER}" ] ; then
|
if [ -z "${SYSTEM_GROUP}" ] ; then
|
||||||
SYSTEM_GROUP=${PROJECT_NAME}
|
SYSTEM_GROUP=${PROJECT_NAME}
|
||||||
fi
|
fi
|
||||||
if [ "${SYSTEM_USER}" != "root" ] ; then
|
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 ran as root, create /var/lock/X, /var/run/X, /var/lib/X and /var/log/X as needed
|
||||||
if [ `whoami` = "root" ] ; then
|
if [ `whoami` = "root" ] ; then
|
||||||
for i in lock run log lib ; do
|
for i in lock run log lib ; do
|
||||||
mkdir -p /var/$i/${PROJECT_NAME}
|
mkdir -p /var/$i/${PROJECT_NAME}
|
||||||
chown ${SYSTEM_USER} /var/$i/${PROJECT_NAME}
|
chown ${SYSTEM_USER} /var/$i/${PROJECT_NAME}
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# This defines init_is_upstart which we use later on (+ more...)
|
# 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/openstack ] && . /etc/default/openstack
|
||||||
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
|
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
|
||||||
[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
|
[ "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() {
|
do_start() {
|
||||||
start-stop-daemon --start --quiet --background ${STARTDAEMON_CHUID} --make-pidfile --pidfile ${PIDFILE} --chdir /var/lib/${PROJECT_NAME} --startas $DAEMON \
|
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
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
init_is_upstart > /dev/null 2>&1 && exit 1
|
init_is_upstart > /dev/null 2>&1 && exit 1
|
||||||
log_daemon_msg "Starting $DESC" "$NAME"
|
log_daemon_msg "Starting $DESC" "$NAME"
|
||||||
do_start
|
do_start
|
||||||
case $? in
|
case $? in
|
||||||
0|1) log_end_msg 0 ;;
|
0|1) log_end_msg 0 ;;
|
||||||
2) log_end_msg 1 ;;
|
2) log_end_msg 1 ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
init_is_upstart > /dev/null 2>&1 && exit 0
|
init_is_upstart > /dev/null 2>&1 && exit 0
|
||||||
log_daemon_msg "Stopping $DESC" "$NAME"
|
log_daemon_msg "Stopping $DESC" "$NAME"
|
||||||
do_stop
|
do_stop
|
||||||
case $? in
|
case $? in
|
||||||
0|1) log_end_msg 0 ;;
|
0|1) log_end_msg 0 ;;
|
||||||
2) log_end_msg 1 ;;
|
2) log_end_msg 1 ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
|
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||||
;;
|
;;
|
||||||
systemd-start)
|
systemd-start)
|
||||||
do_systemd_start
|
do_systemd_start
|
||||||
;;
|
;;
|
||||||
restart|force-reload)
|
restart|force-reload)
|
||||||
init_is_upstart > /dev/null 2>&1 && exit 1
|
init_is_upstart > /dev/null 2>&1 && exit 1
|
||||||
log_daemon_msg "Restarting $DESC" "$NAME"
|
log_daemon_msg "Restarting $DESC" "$NAME"
|
||||||
do_stop
|
do_stop
|
||||||
case $? in
|
case $? in
|
||||||
0|1)
|
0|1)
|
||||||
do_start
|
do_start
|
||||||
case $? in
|
case $? in
|
||||||
0) log_end_msg 0 ;;
|
0) log_end_msg 0 ;;
|
||||||
1) log_end_msg 1 ;; # Old process is still running
|
1) log_end_msg 1 ;; # Old process is still running
|
||||||
*) log_end_msg 1 ;; # Failed to start
|
*) log_end_msg 1 ;; # Failed to start
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
*) log_end_msg 1 ;; # Failed to stop
|
*) log_end_msg 1 ;; # Failed to stop
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload|systemd-start}" >&2
|
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload|systemd-start}" >&2
|
||||||
exit 3
|
exit 3
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
description "Neutron vmware dvs plugin agent"
|
description "Neutron VMware DVS plugin agent"
|
||||||
author "Igor Gajsin <igajsin@mirantis.com>"
|
author "Igor Gajsin <igajsin@mirantis.com>"
|
||||||
|
|
||||||
start on runlevel [2345]
|
start on runlevel [2345]
|
||||||
stop on runlevel [016]
|
stop on runlevel [!2345]
|
||||||
|
|
||||||
chdir /var/run
|
chdir /var/run
|
||||||
|
|
||||||
|
@ -11,32 +11,33 @@ respawn limit 20 5
|
||||||
limit nofile 65535 65535
|
limit nofile 65535 65535
|
||||||
|
|
||||||
pre-start script
|
pre-start script
|
||||||
mkdir -p /var/run/neutron
|
for i in lock run log lib ; do
|
||||||
chown neutron:root /var/run/neutron
|
mkdir -p /var/$i/neutron
|
||||||
|
chown neutron /var/$i/neutron
|
||||||
|
done
|
||||||
end script
|
end script
|
||||||
|
|
||||||
script
|
script
|
||||||
[ -r /usr/share/neutron-common/plugin_guess_func ] || exit 0
|
[ -x "/usr/bin/neutron-dvs-agent" ] || {
|
||||||
. /usr/share/neutron-common/plugin_guess_func
|
echo "$UPSTART_JOB" "ERROR: /usr/bin/neutron-dvs-agent not exists : exiting";
|
||||||
|
exit 0;
|
||||||
if ! [ -r /etc/neutron/neutron.conf ] ; then
|
}
|
||||||
echo "Cloud not read /etc/neutron/neutron.conf: exiting"
|
[ -r /etc/neutron/neutron.conf ] || {
|
||||||
exit 0
|
echo "$UPSTART_JOB" "ERROR: Cloud not read /etc/neutron/neutron.conf: exiting";
|
||||||
fi
|
exit 0;
|
||||||
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
|
DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf"
|
||||||
echo "No core_plugin= value found: please set it and try again"
|
CONFIG_FILE="<%= @agent_config %>"
|
||||||
exit 0
|
USE_SYSLOG=""
|
||||||
fi
|
USE_LOGFILE=""
|
||||||
|
NO_OPENSTACK_CONFIG_FILE_DAEMON_ARG=""
|
||||||
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 %>"
|
|
||||||
[ -r /etc/default/openstack ] && . /etc/default/openstack
|
[ -r /etc/default/openstack ] && . /etc/default/openstack
|
||||||
[ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
|
[ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
|
||||||
|
|
||||||
[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
|
[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
|
||||||
[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=<%= @agent_log %>"
|
[ "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 -- \
|
[ -z "$NO_OPENSTACK_CONFIG_FILE_DAEMON_ARG" ] && DAEMON_ARGS="$DAEMON_ARGS --config-file=$CONFIG_FILE"
|
||||||
--config-file=/etc/neutron/neutron.conf $CONF_ARG $DAEMON_ARGS
|
|
||||||
|
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
|
end script
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
- id: vmware-dvs-set-neutron-timeout
|
- id: vmware-dvs-set-neutron-timeout
|
||||||
version: 2.1.0
|
version: 2.1.0
|
||||||
groups: ['primary-controller','controller']
|
groups: ['primary-controller','controller']
|
||||||
required_for: [deploy_end]
|
required_for: [vmware-vcenter]
|
||||||
requires: [openstack-network-server-nova]
|
requires: [openstack-network-server-nova]
|
||||||
type: puppet
|
type: puppet
|
||||||
parameters:
|
parameters:
|
||||||
|
|
Loading…
Reference in New Issue