docs/doc/source/system_configuration/openstack/assigning-a-dedicated-vlan-id-to-a-target-project-network.rst
Rafael Jardim d6fb867888 Upstreaming WRO
Removed duplicate abbrev definitions

Signed-off-by: Rafael Jardim <rafaeljordao.jardim@windriver.com>
Change-Id: I7910d9f54e158250004abd7e17a4e119f8064252
Signed-off-by: Ron Stone <ronald.stone@windriver.com>
2021-03-31 08:57:23 -04:00

9.9 KiB

Assign a Dedicated VLAN ID to a Target Project Network

To assign a dedicated segment ID you must first enable the Neutron segments plugin.

  1. Create a Helm overrides file to customize your Neutron configuration.

    The file must load the segments plugin. For example:

    ...
    conf:
    neutron:
       DEFAULT:
         service_plugins:
         - router
         - network_segment_range
         - segments
    ...
  2. If you have not done so already, upload the -openstack application charts.

    For example:

    ~(keystone_admin)]$ system application-upload -openstack-20.10-0.tgz

  3. Update the -openstack application using the overrides file created above.

    Assuming you named the file neutron-overrides.yaml, run:

    ~(keystone_admin)]$ system helm-override-update -openstack neutron openstack --values neutron-overrides.yaml

    You can check on the status of the update using the system helm-override-show command. For example:

    ~(keystone_admin)]$ system helm-override-show -openstack neutron openstack +--------------------+---------------------------------------------------------------------------------------------------------------------+ | Property | Value | +--------------------+---------------------------------------------------------------------------------------------------------------------+ | attributes | enabled: true | | | | | combined_overrides | conf: | | | dhcp_agent: | | | DEFAULT: | | | interface_driver: networking_avs.neutron.agent.avs_manager.interface.VSwitchInterfaceDriver | | | neutron: | | | | | ... | ... | | | | | user_overrides | conf: | | | neutron: | | | DEFAULT: | | | service_plugins: | | | - router | | | - network_segment_range | | | - segments | | | | +--------------------+---------------------------------------------------------------------------------------------------------------------+

Note

The value for DEFAULT is folded onto two lines in the example above for display purposes.

  1. Apply the -openstack application.

    ~(keystone_admin)]$ system application-apply -openstack

  2. You can now assign the network type to a datanetwork.

    1. Identify the name of the data network to assign.

      List the available data networks and identify one to use in the heat template as:

      physical_network: <datanetworkname>

      In this example, we use datanet-1.

    2. Create a heat template.

      For example:

      ~(keystone_admin)]$ cat <<EOF > my_heat_template.yml
      heat_template_version: 2017-09-01
      
      resources:
      
        external01:
          type: OS::Neutron::Net
          properties:
            name: external001
            shared: "true"
      
        # Network segement
        segement01:
          type: OS::Neutron::Segment
          properties:
            network: { get_resource: external01 }
            network_type: "vlan"
            physical_network: "datanet-1"
            segmentation_id: 2111
      
        external01-subnet:
          type: OS::Neutron::Subnet
          properties:
            network: { get_resource: external01 }
            name: external02-subnet
            cidr: 10.10.10.0/24
            segment: { get_resource: segement01 }
      EOF
    3. Apply the template.

      ~(keystone_admin)]$ OS_AUTH_URL=http://keystone.openstack.svc.cluster.local/v3
      ~(keystone_admin)]$ openstack stack create -t my_heat_template.yml --wait test1-st
      2020-10-16 21:20:34Z [test1-st]: CREATE_IN_PROGRESS Stack CREATE started
      2020-10-16 21:20:34Z [test1-st.external01]: CREATE_IN_PROGRESS state changed
      2020-10-16 21:20:35Z [test1-st.external01]: CREATE_COMPLETE state changed
      2020-10-16 21:20:35Z [test1-st.segement01]: CREATE_IN_PROGRESS state changed
      2020-10-16 21:20:37Z [test1-st.segement01]: CREATE_COMPLETE state changed
      2020-10-16 21:20:37Z [test1-st.external01-subnet]: CREATE_IN_PROGRESS state changed
      2020-10-16 21:20:38Z [test1-st.external01-subnet]: CREATE_COMPLETE state changed
      2020-10-16 21:20:38Z [test1-st]: CREATE_COMPLETE Stack CREATE completed successfully
  3. Confirm the configuration.

    1. List network segments.

      ~(keystone_admin)]$ openstack network segment list
      +--------------------------------------+--------------------------------------------+--------------------------------------+--------------+---------+
      | ID                                   | Name                                       | Network                              | Network Type | Segment |
      +--------------------------------------+--------------------------------------------+--------------------------------------+--------------+---------+
      | 502e3f4f-6187-4737-b1f5-1be7fd3fc45e | test1-st-segement01-mx6fa5eonzrr           | 6bbd3e4e-9419-49c6-a68a-ed51fbc1cab7 | vlan         |    2111 |
      | faf63edf-63f0-4e9b-b930-5fa8f43b5484 | None                                       | 865b9576-1815-4734-a7e4-c2d0dd31d19c | vlan         |    2001 |
      +--------------------------------------+--------------------------------------------+--------------------------------------+--------------+---------+

      Note

      Thr name test1-st-segement01-mx6fa5eonzrr has been folded onto two lines in the sample output above for display pruposes.

    2. List subnets.

      ~(keystone_admin)]$ openstack subnet list
      +--------------------------------------+---------------------+--------------------------------------+------------------+
      | ID                                   | Name                | Network                              | Subnet           |
      +--------------------------------------+---------------------+--------------------------------------+------------------+
      | 0f64c277-82d7-4161-aa47-fc4cfadacf2f | external01-subnet   | 6bbd3e4e-9419-49c6-a68a-ed51fbc1cab7 | 10.10.10.0/24    |
      | bb9848b6-63f0-4e9b-b930-5fa8f43b5ddc | subnet-temp         | 865b9576-1815-4734-a7e4-c2d0dd31d19c | 192.168.17.0/24  |
      +--------------------------------------+---------------------+--------------------------------------+------------------+

      In this example, the subnet external01-subnet uses a dedicated segment ID.

    3. Listing details for the subnet shows that it uses the segment ID created earlier.

      ~(keystone_admin)]$ openstack subnet show
      0f64c277-82d7-4161-aa47-fc4cfadacf2f | grep segment | segment_id |
      502e3f4f-6187-4737-b1f5-1be7fd3fc45e |

    Note

    Dedicated segment IDs should not be in the range created using the openstack network segment range create commands. This can cause conflict errors.