Ask Your Question
0

openstack network create: bad request (HTTP 400)

asked 2017-06-21 04:54:38 -0500

Wintermute gravatar image

updated 2017-06-21 06:15:48 -0500

Hello,

I am new to OpenStack (sorry) and I am trying to configure it to be used with Open Source MANO (https://osm.etsi.org/wikipub/index.php/Openstack_configuration_(Release_TWO)). I have installed the DevStack distribution on a Ubuntu 16.02.4 VM (VirtualBox). There is a step for creating a management network, so I entered the following command using openstack CLI (neutron seems to be deprecated):

openstack network create mgmt --provider-network-type vlan --provider-physical-network physnet_em1 --provider-segment 500 --share

But I have this error message:

Error while executing command: Bad Request (HTTP 400) (Request-ID: ...)

Before ending up with this, I made source openrc in the devstack folder because there was an issue with auth_url.

Is there a problem with environment variables OS_* or something else?

EDIT:

Here is the openrc file:

#!/usr/bin/env bash
#
# source openrc [username] [projectname]
#
# Configure a set of credentials for $PROJECT/$USERNAME:
#   Set OS_PROJECT_NAME to override the default project 'demo'
#   Set OS_USERNAME to override the default user name 'demo'
#   Set ADMIN_PASSWORD to set the password for 'admin' and 'demo'

# NOTE: support for the old NOVA_* novaclient environment variables has
# been removed.

if [[ -n "$1" ]]; then
    OS_USERNAME=$1
fi
if [[ -n "$2" ]]; then
    OS_PROJECT_NAME=$2
fi

# Find the other rc files
RC_DIR=$(cd $(dirname "${BASH_SOURCE:-$0}") && pwd)

# Import common functions
source $RC_DIR/functions

# Load local configuration
source $RC_DIR/stackrc

# Load the last env variables if available
if [[ -r $RC_DIR/.stackenv ]]; then
    source $RC_DIR/.stackenv
fi

# Get some necessary configuration
source $RC_DIR/lib/tls

# The OpenStack ecosystem has standardized the term **project** as the
# entity that owns resources.  In some places **tenant** remains
# referenced, but in all cases this just means **project**.  We will
# warn if we need to turn on legacy **tenant** support to have a
# working environment.
export OS_PROJECT_NAME=${OS_PROJECT_NAME:-demo}

echo "WARNING: setting legacy OS_TENANT_NAME to support cli tools."
export OS_TENANT_NAME=$OS_PROJECT_NAME

# In addition to the owning entity (project), nova stores the entity performing
# the action as the **user**.
export OS_USERNAME=${OS_USERNAME:-demo}

# With Keystone you pass the keystone password instead of an api key.
# Recent versions of novaclient use OS_PASSWORD instead of NOVA_API_KEYs
# or NOVA_PASSWORD.
export OS_PASSWORD=${ADMIN_PASSWORD:-secret}

# Region
export OS_REGION_NAME=${REGION_NAME:-RegionOne}

# Set the host API endpoint. This will default to HOST_IP if SERVICE_IP_VERSION
# is 4, else HOST_IPV6 if it's 6. SERVICE_HOST may also be used to specify the
# endpoint, which is convenient for some localrc configurations. Additionally,
# some exercises call Glance directly. On a single-node installation, Glance
# should be listening on a local IP address, depending on the setting of
# SERVICE_IP_VERSION. If its running elsewhere, it can be set here.
if [[ $SERVICE_IP_VERSION == 6 ]]; then
    HOST_IPV6=${HOST_IPV6:-::1}
    SERVICE_HOST=${SERVICE_HOST:-[$HOST_IPV6]}
    GLANCE_HOST=${GLANCE_HOST:-[$HOST_IPV6]}
else
    HOST_IP=${HOST_IP:-127.0.0.1}
    SERVICE_HOST=${SERVICE_HOST:-$HOST_IP}
    GLANCE_HOST=${GLANCE_HOST:-$HOST_IP}
fi

# Identity API version
export OS_IDENTITY_API_VERSION=${IDENTITY_API_VERSION:-3}

# Ask keystoneauth1 to use keystone
export OS_AUTH_TYPE=password

# Authenticating against an OpenStack cloud using Keystone returns a **Token**
# and **Service Catalog**.  The catalog contains the endpoints for all services
# the user/project has access to - including ...
(more)
edit retag flag offensive close merge delete

Comments

Can you give your openrc.sh file? By the way as per my experiance either the problem is in openrc file or the configuration file whether authentication url is defined properly or not.

avinash_k_singh gravatar imageavinash_k_singh ( 2017-06-21 06:09:14 -0500 )edit

400 means user error, and I wonder if your provider parameters are correct?

You could run the command with the --debug option to see more clearly.

Otherwise, use the request ID to find relevant messages in the log files.

Bernd Bausch gravatar imageBernd Bausch ( 2017-06-21 06:22:25 -0500 )edit

I ran the command with --debug and got this message:

RESP BODY: {"NeutronError": {"message": "Invalid input for operation: physical_network 'physnet_em1' unknown for VLAN provider network.", "type": "InvalidInput", "detail": ""}}

Should I record the provider parameters in a configuration file?

Wintermute gravatar imageWintermute ( 2017-06-21 07:37:08 -0500 )edit

Yes, exactly! See point 4 in https://docs.openstack.org/ocata/netw..., in case you use Openvswitch. The bridge_mappings parameter defines how the provider network is accessed. You need physnet_em1 before the colon.

Bernd Bausch gravatar imageBernd Bausch ( 2017-06-21 07:47:28 -0500 )edit

2 answers

Sort by » oldest newest most voted
0

answered 2017-06-21 09:23:18 -0500

Wintermute gravatar image

Thank you Bernd Bausch, I followed the steps in the OpenStack documentation and this site: https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/8/html/networking_guide/bridge-mappings (https://access.redhat.com/documentati...)

  • modified /opt/stack/neutron/etc/oslo-config-generator/openvswitch_agent.ini:

    [ovs]

    bridge_mappings = physnet:br-ex

  • modified /etc/neutron/plugins/ml2/ml2_conf.ini:

    [ml2_type_vlan]

    network_vlan_ranges = physnet

Then I rebooted the VM, ran source admin_openrc.sh (file downloaded from the Horizon UI where I logged in as admin) and the command for creating the network worked.

edit flag offensive delete link more
0

answered 2019-01-19 16:38:26 -0500

amer.hwitat gravatar image

I have an Openstack installation allinone .. but I have configuered the br-ex before the installation is that a reason for this Error , I'm on OSP 13, Red Hat flavor, which is not like the regular RDO OSP, I have tried all the solutions including your solution, but I have payed attention to the fact that br-ex state in ip a command is Unknown , is that a reason ... I can ping in and out the machine ...

have done the plugin.ini and openvswitch_agent.ini and still the same error (400) from openstack CLI , and the same unknow for flat proveder from neutron ...

can you please help me ..

edit flag offensive delete link more

Comments

Don’t create an answer when you ask a question. Create a new question instead.

I don’t know much about OSP, but I don’t think it can be installed on a single server.

Did you follow the suggestions I made in June 2017, and what are the results?

Bernd Bausch gravatar imageBernd Bausch ( 2019-01-19 17:02:07 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

Stats

Asked: 2017-06-21 04:54:38 -0500

Seen: 3,734 times

Last updated: Jun 21 '17