首先 安装最小版本 centos 7 ,openstack 版本rocky
cd /opt
git clone https://git.openstack.org/openstack-dev/devstack -b stable/rocky
cd /opt/devstack/tools/
./create-stack-user.sh
chown -R stack:stack /opt/devstack
防止出错,提前执行
yum -y install libibverbs
修改pip 版本限制要求
vi /home/devstack/tools/cap-pip.txt
pip!=8,<10
改为以下内容即可:
pip!=8
编辑配置文件
# vim /opt/devstack/local.conf
[[local|localrc]]
# Define images to be automatically downloaded during the DevStack built process.
IMAGE_URLS="http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img"
# Credentials
DATABASE_PASSWORD=admin
ADMIN_PASSWORD=admin
SERVICE_PASSWORD=admin
SERVICE_TOKEN=pass
RABBIT_PASSWORD=admin
#FLAT_INTERFACE=eth0
HOST_IP=192.168.100.233
SERVICE_HOST=192.168.100.233
MYSQL_HOST=192.168.100.233
RABBIT_HOST=192.168.100.233
GLANCE_HOSTPORT=192.168.100.233:9292
## Neutron options
Q_USE_SECGROUP=True
FLOATING_RANGE=192.168.100.0/24
FIXED_RANGE=192.0.0.0/24
Q_FLOATING_ALLOCATION_POOL=start=192.168.100.200,end=192.168.100.210
PUBLIC_NETWORK_GATEWAY=192.168.100.2
Q_L3_ENABLED=True
PUBLIC_INTERFACE=eth0
Q_USE_PROVIDERNET_FOR_PUBLIC=True
OVS_PHYSICAL_BRIDGE=br-ex
PUBLIC_BRIDGE=br-ex
OVS_BRIDGE_MAPPINGS=public:br-ex
# Work offline
#OFFLINE=True
# Reclone each time
RECLONE=False
# Logging
# -------
# By default ``stack.sh`` output only goes to the terminal where it runs. It can
# be configured to additionally log to a file by setting ``LOGFILE`` to the full
# path of the destination log file. A timestamp will be appended to the given name.
LOGFILE=/opt/stack/logs/stack.sh.log
VERBOSE=True
LOG_COLOR=True
SCREEN_LOGDIR=/opt/stack/logs
# the number of days by setting ``LOGDAYS``.
LOGDAYS=1
# Database Backend MySQL
enable_service mysql
# RPC Backend RabbitMQ
enable_service rabbit
# Enable Keystone - OpenStack Identity Service
enable_service key
# Horizon - OpenStack Dashboard Service
enable_service horizon
# Enable Swift - Object Storage Service without replication.
enable_service s-proxy s-object s-container s-account
SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
SWIFT_REPLICAS=1
# Enable Glance - OpenStack Image service
enable_service g-api g-reg
# Enable Cinder - Block Storage service for OpenStack
VOLUME_GROUP="cinder-volumes"
enable_service cinder c-api c-vol c-sch c-bak
# Enable Heat (orchestration) Service
enable_service heat h-api h-api-cfn h-api-cw h-eng
# Enable Trove (database) Service
enable_service trove tr-api tr-tmgr tr-cond
# Enable Sahara (data_processing) Service
enable_service sahara
# Enable Tempest - The OpenStack Integration Test Suite
enable_service tempest
# Enabling Neutron (network) Service
disable_service n-net
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
enable_service q-metering
enable_service neutron
## Neutron - Load Balancing
enable_service q-lbaas
## Neutron - Firewall as a Service
enable_service q-fwaas
## Neutron - V** as a Service
enable_service q-V**
# VLAN configuration.
#Q_PLUGIN=ml2
#ENABLE_TENANT_VLANS=True
# GRE tunnel configuration
#Q_PLUGIN=ml2
#ENABLE_TENANT_TUNNELS=True
# VXLAN tunnel configuration
Q_PLUGIN=ml2
Q_ML2_TENANT_NETWORK_TYPE=vxlan
# Enable Ceilometer - Metering Service (metering + alarming)
enable_service ceilometer-acompute ceilometer-acentral ceilometer-collector ceilometer-api
enable_service ceilometer-alarm-notify ceilometer-alarm-eval
enable_service ceilometer-anotification
## Enable NoVNC
enable_service n-novnc n-cauth
# Enable the Ceilometer devstack plugin
enable_plugin ceilometer https://git.openstack.org/openstack/ceilometer.git
# Branches
KEYSTONE_BRANCH=stable/rocky
NOVA_BRANCH=stable/rocky
NEUTRON_BRANCH=stable/rocky
SWIFT_BRANCH=stable/rocky
GLANCE_BRANCH=stable/rocky
CINDER_BRANCH=stable/rocky
HEAT_BRANCH=stable/rocky
TROVE_BRANCH=stable/rocky
HORIZON_BRANCH=stable/rocky
SAHARA_BRANCH=stable/rocky
CEILOMETER_BRANCH=stable/rocky
TROVE_BRANCH=stable/rocky
# Select Keystone's token format
# Choose from 'UUID', 'PKI', or 'PKIZ'
# INSERT THIS LINE...
KEYSTONE_TOKEN_FORMAT=${KEYSTONE_TOKEN_FORMAT:-UUID}
KEYSTONE_TOKEN_FORMAT=$(echo ${KEYSTONE_TOKEN_FORMAT} | tr '[:upper:]' '[:lower:]')
[[post-config|$NOVA_CONF]]
[DEFAULT]
# Ceilometer notification driver
instance_usage_audit=True
instance_usage_audit_period=hour
notify_on_state_change=vm_and_task_state
notification_driver=nova.openstack.common.notifier.rpc_notifier
notification_driver=ceilometer.compute.nova_notifier
其中要注意和安装的版本一定要对应上
Branches
KEYSTONE_BRANCH=stable/rocky
NOVA_BRANCH=stable/rocky
NEUTRON_BRANCH=stable/rocky
SWIFT_BRANCH=stable/rocky
GLANCE_BRANCH=stable/rocky
CINDER_BRANCH=stable/rocky
HEAT_BRANCH=stable/rocky
TROVE_BRANCH=stable/rocky
HORIZON_BRANCH=stable/rocky
SAHARA_BRANCH=stable/rocky
CEILOMETER_BRANCH=stable/rocky
TROVE_BRANCH=stable/rocky
# cd /opt/devstack
# su stack
# ./stack.sh
经验
通过virtual box 在安装之前,将准备好的干净环境建立快照,这样如果安装出现问题,可以通过恢复实现快速回退;