openstack network create: bad request (HTTP 400)
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 ...
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.
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.
I ran the command with --debug and got this message:
Should I record the provider parameters in a configuration file?
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.