Configuring the VMware DVS mechanism driver

You can configure the VMware distributed virtual switch (DVS) mechanism driver to manage VMware networks, when the VMware hypervisor is used.

Before you begin

About this task

Network management in Neutron has two parts:
  1. The common ML2 driver, which is used for network database operations. For example, insert, delete, update.
  2. The mechanism driver, which is used to create, update, and delete real networks.
There are different mechanism drivers for different network devices and adapters. For example, Open vSwitch, Linux bridge, BigSwitch.

The VMware DVS mechanism driver is used to manage (create, update, or delete) VMware networks, when the VMware hypervisor is used. With the VMware DVS mechanism driver enabled, you can create DVS networks (DVS port groups) directly with Neutron interfaces (such as the command line or dashboard). This is a significant enhancement for Neutron, and a convenient feature for VMware users.

To use the DVS mechanism, ensure that you meet the following prerequisites:
  1. The Neutron server is installed.
  2. The managed-to VCenter has a DVS that is connected with managed clusters or hosts.
  3. The neutron-vmware-driver package is installed.

There are two ways to enable the DVS mechanism. Complete one of the following options.

Procedure

  1. Configure the following scripts manually.
    VCENTER_HOST_IP=<$vcenter_host_ip>
    VCENTER_HOST_USERNAME=<$vcenter_host_username>
    VCENTER_HOST_PASSWORD=<$vcenter_host_password>
    NEUTRON_EGGS=/usr/lib/python2.7/site-packages/neutron-*egg*/entry_points.txt
    NET_MAPS=<$physical_network_mappings>
    DVS_MECH_DRIVER="neutron.plugins.ml2.drivers.mech_dvs.driver:VMwareDVSMechanismDriver"
    NEUTRON_ML2_CONF_FILE=/etc/neutron/plugins/ml2/ml2_conf.ini
    openstack-config --set $NEUTRON_ML2_CONF_FILE ml2 type_drivers flat,vlan
    openstack-config --set $NEUTRON_ML2_CONF_FILE ml2 tenant_network_types flat,vlan
    openstack-config --set $NEUTRON_ML2_CONF_FILE ml2 mechanism_drivers dvs
    openstack-config --set $NEUTRON_ML2_CONF_FILE ml2_type_flat flat_networks physnet1
    openstack-config --set $NEUTRON_ML2_CONF_FILE ml2_type_vlan network_vlan_ranges physnet1:1000:2999
    openstack-config --set $NEUTRON_ML2_CONF_FILE ml2_vmware host_ip $VCENTER_HOST_IP
    openstack-config --set $NEUTRON_ML2_CONF_FILE ml2_vmware host_username $VCENTER_HOST_USERNAME
    openstack-config --set $NEUTRON_ML2_CONF_FILE ml2_vmware host_password $VCENTER_HOST_PASSWORD
    openstack-config --set $NEUTRON_ML2_CONF_FILE ml2_vmware task_poll_interval 5.0
    openstack-config --set $NEUTRON_ML2_CONF_FILE ml2_vmware api_retry_count 10
    openstack-config --set $NEUTRON_ML2_CONF_FILE ml2_vmware network_maps $NET_MAPS
    openstack-config --set $NEUTRON_EGGS neutron.ml2.mechanism_drivers dvs $DVS_MECH_DRIVER
    
    service neutron-server restart
    Note: Replace <$vcenter_host_ip>, <$vcenter_host_username>, <$vcenter_host_password>, <$physical_network_mappings> with real values. The physical_network_mappings represents a map of Neutron physical network name, and the DVS in VCenter. For example: physnet1:dvSwitch.
  2. Alternatively, configure with the VMware cookbooks.
    For instructions, see step 4d in the Deploying an all-in-one node with n VMware compute services topic.