- 准备虚拟机安装ubuntu16.04,配置最好保持4核8G以上。
- 保证虚拟机与internet的连通性。
- 安装git, apt install git -y.
- 下载devstack:
git clone https://git.openstack.org/openstack-dev/devstack -b stable/pike
- 进入devstack目录,准备local.conf:
注:为了节省时间,可用trystack的git源来替换官方源。如果虚拟机有多于一张网卡,需指定HOST_IP。其中RECLONE参数需注意,如果设置该参数值为yes,则每次运行./stack.sh都会从头开始执行一遍,即哪怕之前已经clone好的源码也会再次clone,安装过的包也会再次安装,很浪费时间。[[local|localrc]] # use TryStack git mirror GIT_BASE=http://git.trystack.cn NOVNC_REPO=http://git.trystack.cn/kanaka/noVNC.git SPICE_REPO=http://git.trystack.cn/git/spice/spice-html5.git # Define images to be automatically downloaded during the DevStack built process. DOWNLOAD_DEFAULT_IMAGES=False IMAGE_URLS="http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img" # Credentials DATABASE_PASSWORD=pass ADMIN_PASSWORD=pass SERVICE_PASSWORD=pass SERVICE_TOKEN=pass RABBIT_PASSWORD=pass #FLAT_INTERFACE=eth0 HOST_IP=192.168.224.55 #SERVICE_HOST=192.168.224.55 #MYSQL_HOST=192.168.224.55 #RABBIT_HOST=192.168.224.55 #GLANCE_HOSTPORT=192.168.224.55:9292 # 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_plugin monasca http://git.trystack.cn/openstack/monasca-api stable/pike # 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 Ceilometer Service #enable_service ceilometer-acompute ceilometer-acentral ceilometer-collector ceilometer-api ceilometer-anotification #enable_service ceilometer-alarm-notifier ceilometer-alarm-evaluator #Enable Swifit Service enable_service s-proxy s-object s-container s-account enable_plugin trove http://git.trystack.cn/openstack/trove stable/pike # Enable Trove (database) Service enable_service trove tr-api tr-tmgr tr-cond # Enable Tempest - The OpenStack Integration Test Suite enable_service tempest # Enable NoVNC enable_service n-novnc # 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 enable_service q-vpn #enable_plugin neutron-vpnaas http://git.trystack.cn/openstack/neutron-vpnaas stable/pike enable_service q-lbaasv2 enable_service q-fwaas #enable_plugin neutron-vpnaas http://git.trystack.cn//openstack/neutron-vpnaas #IPSEC_PACKAGE="openswan" enable_plugin ceilometer http://git.trystack.cn/openstack/ceilometer.git stable/pike #enable_plugin cloudkitty http://git.trystack.cn/openstack/cloudkitty.git stable/pike #enable_service ck-api ck-proc #Enable senlin #enable_plugin senlin http://git.trystack.cn/openstack/senlin stable/pike #Enable senlin-dashboard #enable_plugin senlin-dashboard http://git.trystack.cn/openstack/senlin-dashboard stable/pike ## Neutron options #Q_USE_SECGROUP=True #FLOATING_RANGE="172.16.33.0/24" #FIXED_RANGE="10.0.1.0/24" #NETWORK_GATEWAY="172.16.33.1" #Q_FLOATING_ALLOCATION_POOL=start=172.16.33.200,end=172.16.33.240 #PUBLIC_NETWORK_GATEWAY="172.16.33.1" #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 #PUBLIC_NETWORK_NAME=ext-net # VLAN configuration. #Q_PLUGIN=ml2 #ENABLE_TENANT_VLANS=True # Branches KEYSTONE_BRANCH=stable/pike NOVA_BRANCH=stable/pike NEUTRON_BRANCH=stable/pike GLANCE_BRANCH=stable/pike CINDER_BRANCH=stable/pike HEAT_BRANCH=stable/pike HORIZON_BRANCH=stable/pike # 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:]') # Work offline #OFFLINE=True # Reclone each time #RECLONE=yes # Logging DEST=/opt/stack LOGFILE=/opt/stack/logs/stack.sh.log VERBOSE=True #LOG_COLOR=True LOGDIR=/opt/stack/logs
- 创建stack用户,执行devstack中的脚本: bash tools/create-stack-user.sh.
- 执行./stack.sh。 注意,一般情况下不会一次执行就成功,中途会不停的失败报错,尤其以pip 安装某些python包时超时居多,因此看具体报错问题,如果是提示某些文件找不到,即有XXX,no such file or directory,此种问题一般是某个openstack模块源码没有clone所致,如果是pip install XXX timeout,则只需再次运行./stack.sh即可。
- 经过几小时到几天不等,取决于你的网络,安装成功后会出现:
- 此时openstack单机环境即有了,可根据虚拟机IP地址,然后通过localconf中设定的用户名密码登录了。
来源:CSDN
作者:小成童鞋
链接:https://blog.csdn.net/scucscheng/article/details/78852909