DevStack

DevStack XENA

sudo apt -y install git jq vim
sudo apt purge -y python3-distro-info
 
git clone --branch "stable/xena" https://opendev.org/openstack/devstack
 
HOST_IP=$(ip -o -4 -j a | jq -r '.[].addr_info[] | select(.dev == "ens3") .local')
echo ${HOST_IP}

DevStack XENA
https://openstack.goffinet.org/03-02-openstack-lab-devstack.html
http://lia.deis.unibo.it/Courses/CompNetworksM/1718/slides/NetworksM_Cloud180518_v1.pdf
https://opnfvblog.wordpress.com/2016/10/27/devstack-localconf/
https://01.org/sites/default/files/page/accelerating_openstack_networking_with_intel_architecture_rev008.pdf

cat <<EOF> ~/devstack/local.conf
[[local|localrc]]
DEST=/opt/stack/
 
#ENABLED_SERVICES=key,swift,mysql
#ENABLED_SERVICES+=,heat,key,swift,mysql
#ENABLED_SERVICES+=,heat
#ENABLED_SERVICES+=,q-dhcp,q-meta,q-l3
#,q-agt,q-svc
#DISABLE_SERVICES tempest n-obj n-net n-vol
 
ADMIN_PASSWORD=stack1234
DATABASE_PASSWORD=\$ADMIN_PASSWORD
RABBIT_PASSWORD=\$ADMIN_PASSWORD
SERVICE_PASSWORD=\$ADMIN_PASSWORD
 
# Enable Neutron (Networking)
# to use nova net rather than neutron, comment out the following group
#disable_service n-net
#enable_plugin neutron https://git.openstack.org/openstack/neutron
#enable_service q-metering
#enable_service q-qos
 
# Networking
# https://docs.openstack.org/devstack/latest/networking.html
disable_service n-net
disable_service n-cpu
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
enable_service neutron
Q_AGENT=openvswitch
Q_ML2_PLUGIN_MECHANISM_DRIVERS=openvswitch
Q_ML2_PLUGIN_TYPE_DRIVERS=vlan,flat,local
Q_ML2_TENANT_NETWORK_TYPE=vlan
 
 
# Logging
ENABLE_DEBUG_LOG_LEVEL=false
ENABLE_VERBOSE_LOG_LEVEL=false
LOGFILE=\$DEST/logs/stack.sh.log
SCREEN_LOGDIR=$DEST/logs/screen
VERBOSE=false
 
#IPV4_ADDRS_SAFE_TO_USE=172.31.1.0/24
HOST_IP=${HOST_IP}
 
#PUBLIC_INTERFACE=ens7
#FLOATING_RANGE=192.168.1.0/24
#PUBLIC_NETWORK_GATEWAY=10.0.10.1
 
enable_plugin heat https://github.com/openstack/heat master
EOF
 
 
# Neutron options
Q_USE_SECGROUP=True
FLOATING_RANGE="172.18.161.0/24"
IPV4_ADDRS_SAFE_TO_USE=10.0.0.0/24
Q_FLOATING_ALLOCATION_POOL=start=172.18.1
61.250,end=172.18.161.254
PUBLIC_NETWORK_GATEWAY="172.18.161.1"
PUBLIC_INTERFACE=eth1
 
 
# Neutron options
Q_USE_SECGROUP=True
FLOATING_RANGE="172.18.161.0/24"
IPV4_ADDRS_SAFE_TO_USE=10.0.0.0/24
Q_FLOATING_ALLOCATION_POOL=start=172.18.1
61.250,end=172.18.161.254
PUBLIC_NETWORK_GATEWAY="172.18.161.1"
PUBLIC_INTERFACE=eth1
 
## Neutron options
PUBLIC_INTERFACE=eth0
ENABLED_SERVICES=n-cpu,rabbit,q-agt
 
 
cat <<EOF>> ~/devstack/local.conf
# keystone
OS_IDENTITY_API_VERSION=3
OS_AUTH_URL="http://$KEYSTONE_IP/identity/v3"
OS_USERNAME=$ADMIN_USER
OS_USER_DOMAIN_ID=default
OS_PASSWORD=$ADMIN_PASSWORD
OS_PROJECT_NAME=$ADMIN_USER
OS_PROJECT_DOMAIN_ID=default
OS_REGION_NAME=RegionOne
 
# swift
SERVICE_HOST=$SWIFT_IP
SWIFT_SERVICE_PROTOCOL=${SWIFT_SERVICE_PROTOCOL:-http}
SWIFT_DEFAULT_BIND_PORT=${SWIFT_DEFAULT_BIND_PORT:-8080}
# service local host is used for ring building
SWIFT_SERVICE_LOCAL_HOST=$HOST_IP
# service listen address for prox
SWIFT_SERVICE_LISTEN_ADDRESS=$HOST_IP
SWIFT_LOOPBACK_DISK_SIZE=20G
SWIFT_MAX_FILE_SIZE=5368709122
SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
IDENTITY_API_VERSION=3
SWIFT_DATA_DIR=$DEST/data
SWIFT_REPLICAS=1
EOF

Deploy DevStack

cd devstack
./stack.sh

Create admin-openrc

ADMIN_PROJECT_ID=$(sudo grep admin_project=  /opt/stack/logs/stack.sh.log | cut -d"=" -f2)
 
cat <<EOF> ~/admin-openrc
export OS_AUTH_URL=http://${HOST_IP}/identity
export OS_PROJECT_ID=${ADMIN_PROJECT_ID}
export OS_PROJECT_NAME="admin"
export OS_USER_DOMAIN_NAME="Default"
export OS_PROJECT_DOMAIN_ID="default"
export OS_USERNAME="admin"
export OS_PASSWORD="stack1234"
export OS_REGION_NAME="RegionOne"
export OS_INTERFACE=public
export OS_IDENTITY_API_VERSION=3
EOF
 
echo "source ~/admin-openrc.sh" >> ~/.profile
 
source admin-openrc 
openstack endpoint list

Create OpenStack bash completion

openstack complete | sudo tee /etc/bash_completion.d/osc.bash_completion > /dev/null
. /etc/bash_completion

old

cat <<EOF> local.conf 
[[local|localrc]]
ADMIN_PASSWORD=devstack
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
EOF
 
sudo devstack/tools/create-stack-user.sh
su stack
 
cd devstack
./stack.sh
 
ssh -N -L 8080:localhost:80 root@192.168.254.46
 
 
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=stack
export OS_AUTH_URL=http://localhost:35357/v2.0
 
nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0
nova secgroup-add-rule default tcp 22 22 0.0.0.0/0
 
nova list
nova floating-ip-create public

Ironic DevStack Configuration
https://docs.openstack.org/ironic/latest/contributor/ironic-boot-from-volume.html

Links
https://docs.openstack.org/devstack/latest/
https://opendev.org/openstack/devstack
https://docs.openstack.org/devstack/latest/configuration.html