The plugins's prototype ready to qa

That's only prototype not ready to use plugin. It devoid a lot of
things and has only mock instead puppet's manifest. But it enough for
installation and deployment. QA can start checking.

Change-Id: I93cf2025cc5a9477443bdc97e3dc0da6166db972
This commit is contained in:
Igor Gajsin 2015-06-22 17:06:40 +03:00
parent c1f6b09c87
commit c06f79f3a1
6 changed files with 201 additions and 11 deletions

View File

@ -6,7 +6,62 @@ plugin_name=fuel-plugin-vmware-dvs
plugin_version=1.0
ip=`hiera master_ip`
port=8080
repo=simple
url=http://$ip:$port/plugins/$plugin_name-$plugin_version/vmware-dvs
function _nova_patch {
wget -O /usr/lib/python2.7/dist-packages/nova.patch "http://$ip:$port/plugins/$plugin_name-$plugin_version/nova.patch" && cd /usr/lib/python2.7/dist-packages/ ; patch -p1 < nova.patch
for resource in $(crm_mon -1|awk '/nova_compute_vmware/ {print $1}'); do
execute_node=$(crm resource status $resource | cut -f 6 -d\ )
if [ "$execute_node"="$(hostname)" ];
then
crm resource restart $resource
fi
done
}
pip install $url
function _dirty_hack {
cd /usr/lib/python2.7/dist-packages/oslo
mv messaging messaging.old
cd /usr/lib/python2.7/dist-packages/
mv suds suds.old
}
function _neutron_restart {
service neutron-server restart
}
function _core_install {
easy_install pip
apt-get -y install git-core python-dev
}
function _driver_install {
cd /usr/local/lib/python2.7/dist-packages/
pip install -e git+git://github.com/yunesj/suds#egg=suds
pip install oslo.messaging==1.8.3
pip install git+git://github.com/Mirantis/vmware-dvs.git@mos-6.1
}
function _ln {
cd /usr/local/lib/python2.7/dist-packages/oslo
ln -s /usr/lib/python2.7/dist-packages/oslo/db
ln -s /usr/lib/python2.7/dist-packages/oslo/rootwrap
}
function _config {
cd /etc/neutron
cp neutron.conf neutron.conf.old
sed -i s/"#notification_driver.*"/notification_driver=messagingv2/ neutron.conf
sed -i s/"#notification_topics.*"/notification_topics=vmware_dvs/ neutron.conf
cd /etc/neutron/plugins/ml2
mv ml2_conf.ini ml2_conf.ini.old
wget "http://$ip:$port/plugins/$plugin_name-$plugin_version/ml2_conf.ini"
}
_nova_patch
_core_install
_dirty_hack
_driver_install
_ln
_config
_neutron_restart

View File

@ -12,4 +12,4 @@
# License for the specific language governing permissions and limitations
# under the License.
include vmware-dvs
#include vmware-dvs

110
ml2_conf.ini Normal file
View File

@ -0,0 +1,110 @@
[ml2]
# (ListOpt) List of network type driver entrypoints to be loaded from
# the neutron.ml2.type_drivers namespace.
#
# type_drivers = local,flat,vlan,gre,vxlan
type_drivers = local,flat,vlan,gre,vxlan
# Example: type_drivers = flat,vlan,gre,vxlan
# (ListOpt) Ordered list of network_types to allocate as tenant
# networks. The default value 'local' is useful for single-box testing
# but provides no connectivity between hosts.
#
# tenant_network_types = local
tenant_network_types = flat,vlan,gre
# Example: tenant_network_types = vlan,gre,vxlan
# (ListOpt) Ordered list of networking mechanism driver entrypoints
# to be loaded from the neutron.ml2.mechanism_drivers namespace.
# mechanism_drivers =
mechanism_drivers =openvswitch,vmware_dvs
# Example: mechanism_drivers = openvswitch,mlnx
# Example: mechanism_drivers = arista
# Example: mechanism_drivers = cisco,logger
# Example: mechanism_drivers = openvswitch,brocade
# Example: mechanism_drivers = linuxbridge,brocade
# (ListOpt) Ordered list of extension driver entrypoints
# to be loaded from the neutron.ml2.extension_drivers namespace.
# extension_drivers =
# Example: extension_drivers = anewextensiondriver
[ml2_type_flat]
# (ListOpt) List of physical_network names with which flat networks
# can be created. Use * to allow flat networks with arbitrary
# physical_network names.
#
# flat_networks =
flat_networks =*
# Example:flat_networks = physnet1,physnet2
# Example:flat_networks = *
[ml2_type_vlan]
# (ListOpt) List of <physical_network>[:<vlan_min>:<vlan_max>] tuples
# specifying physical_network names usable for VLAN provider and
# tenant networks, as well as ranges of VLAN tags on each
# physical_network available for allocation as tenant networks.
#
# network_vlan_ranges =
network_vlan_ranges =physnet2:1000:1030
# Example: network_vlan_ranges = physnet1:1000:2999,physnet2
[ml2_type_gre]
# (ListOpt) Comma-separated list of <tun_min>:<tun_max> tuples enumerating ranges of GRE tunnel IDs that are available for tenant network allocation
# tunnel_id_ranges =
tunnel_id_ranges =
[ml2_type_vxlan]
# (ListOpt) Comma-separated list of <vni_min>:<vni_max> tuples enumerating
# ranges of VXLAN VNI IDs that are available for tenant network allocation.
#
# vni_ranges =
vni_ranges =10:10000
# (StrOpt) Multicast group for the VXLAN interface. When configured, will
# enable sending all broadcast traffic to this multicast group. When left
# unconfigured, will disable multicast VXLAN mode.
#
# vxlan_group =
vxlan_group =224.0.0.1
# Example: vxlan_group = 239.1.1.1
[securitygroup]
# Controls if neutron security group is enabled or not.
# It should be false when you use nova security group.
# enable_security_group = True
enable_security_group = True
# Use ipset to speed-up the iptables security groups. Enabling ipset support
# requires that ipset is installed on L2 agent node.
# enable_ipset = True
firewall_driver=neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
[agent]
l2_population=False
polling_interval=2
arp_responder=False
[ovs]
enable_tunneling=False
integration_bridge=br-int
bridge_mappings=physnet2:br-prv
[ml2_vmware]
# Hostname or IP address of vmware vcenter server
vsphere_hostname=172.16.0.254
# Login and password of vcenter server
vsphere_login=administrator@vsphere.local
vsphere_password=Qwer!1234
# The mappings between physical networks and dvs
network_maps = physnet2:dvSwitch
# sleep time in seconds for polling an on-going async task as part of the
# API cal
# task_poll_interval=5.0
# number of times an API must be retried upon session/connection related errors
# api_retry_count=10

30
nova.patch Normal file
View File

@ -0,0 +1,30 @@
diff --git a/nova/virt/vmwareapi/vif.py b/nova/virt/vmwareapi/vif.py
index 3d228d7..d513a74 100644
--- a/nova/virt/vmwareapi/vif.py
+++ b/nova/virt/vmwareapi/vif.py
@@ -155,6 +155,10 @@ def get_network_ref(session, cluster, vif, is_neutron):
network_name = (vif['network']['bridge'] or
CONF.vmware.integration_bridge)
network_ref = get_neutron_network(session, network_name, cluster, vif)
+ try:
+ network_ref['dvs_port_key']=vif['details']['dvs_port_key']
+ except KeyError:
+ pass
else:
create_vlan = vif['network'].get_meta('should_create_vlan', False)
network_ref = ensure_vlan_bridge(session, vif, cluster=cluster,
diff --git a/nova/virt/vmwareapi/vm_util.py b/nova/virt/vmwareapi/vm_util.py
index bbf2835..be68010 100644
--- a/nova/virt/vmwareapi/vm_util.py
+++ b/nova/virt/vmwareapi/vm_util.py
@@ -339,6 +339,10 @@ def _create_vif_spec(client_factory, vif_info):
'ns0:DistributedVirtualSwitchPortConnection')
portgroup.switchUuid = network_ref['dvsw']
portgroup.portgroupKey = network_ref['dvpg']
+ try:
+ portgroup.portKey = network_ref['dvs_port_key']
+ except KeyError:
+ pass
backing.port = portgroup
else:
backing = client_factory.create(

View File

@ -1,5 +0,0 @@
#!/bin/bash
set -e
git clone https://github.com/Mirantis/vmware-dvs.git && cd vmware-dvs && git checkout -b origin/mos-6.1

View File

@ -1,11 +1,11 @@
- role: ['primary-controller','controller']
stage: post_deployment
stage: post_deployment/7000
type: shell
parameters:
cmd: ./install_the_driver.sh
timeout: 42
timeout: 720
- role: ['primary-controller','controller']
stage: post_deployment
stage: post_deployment/7001
type: puppet
parameters:
puppet_manifest: puppet/manifests/site.pp