0

I installed Openstack using Devstack on a VirtualBox VM running Ubuntu 18.04. I am trying to create a provider network with the following command:

neutron net-create mgmt --provider:network_type=vlan --provider:physical_network=physnet_em1 --provider:segmentation_id=500 --shared

This command returns the following error:

neutronclient.common.exceptions.BadRequest: Invalid input for operation:
physical_network 'physnet_em1' unknown for VLAN provider network.
Neutron server returns request_ids: ['req-7a0bfe13-b4c3-4408-bc60-8d36e8bc3f9a']

I would like to know how to proceed.

Dalton Cézane
  • 3,672
  • 2
  • 35
  • 60

1 Answers1

1
  1. You should use the openstack-client commands like openstack network create ..., because the client-commands of the single libraries, like your neutron net-create, are deprecated. There are some really special cases, which are only possible with the client-library of the single components, but the most is covered by the openstack-client. Unfortunately there are often used the old commands in documentations, because many documents are not up-to-date.

  2. To avoid the error you had, you only need to remove the --provider:physical_network=physnet_em1 and --provider:segmentation_id=500 from your command. The physical network and vlan-range should be defined within the ml2_conf.ini of the neutron-server, like this for example:

    [ml2]
    type_drivers = flat,vlan,vxlan
    ...
    
    [ml2_type_vlan]
    network_vlan_ranges = physnet_em1:171:280
    ...
    

    So with neutron net-create mgmt --provider:network_type=vlan --shared it works in my test-deployment (at least there in no error in the terminal, not tested the network-connectioin now). The openstack-command for this task would be openstack network create --provider-network-type vlan mgmt --share --external.

  3. Normally, as far as I know, for the provider network a flat network-type is used instead of vlan, because the provider-network should normally not directly connected to any VM. The other non-provider networks can be vlan or vxlan and then connected with a neutron-router to the provider-network. An openstack-command for this could be: openstack network create --provider-network-type flat --provider-physical-network physnet_em1 mgmt --share --external. For flat-networks you have the possibility to define a provider-physical-network via command-line. In some documentations like this: https://docs.openstack.org/newton/install-guide-ubuntu/launch-instance-networks-provider.html they also use a flat-network as provider-network-type.

Tobias
  • 543
  • 1
  • 3
  • 15
  • Thank you, @Tobias . Can you tell what do these numbers (171:280) represent after the `physnet_em1`? – Dalton Cézane May 16 '20 at 16:36
  • @DaltonCézane Yeah, sorry. I should had written this in the below the example. These numbers are the vlan range you give openstack as available range. In this example-case it would use the vlan-tags from 171 until 280 for the tagging of all created vlan-networks in your openstack-deployment. So it also defines a limitation. You can only create an amount of networks, like this range size allows. – Tobias May 16 '20 at 16:54
  • 1
    So you can free decide in this config-file, which range do you want, as long as the values are in the allowed vlan-range of 0-4095. – Tobias May 16 '20 at 17:04
  • Thank you, @Tobias . I had configured without this range and it did not work. As I rebooted the machine, when I tested again, it worked. This indicates that the vlan range is not mandatory. – Dalton Cézane May 21 '20 at 03:15
  • @DaltonCézane Thanks for the feedback. I only used the vlan-type one or two times, before I switched to vxlan networks, so I never tested it without the range. ;) – Tobias May 21 '20 at 16:12