虚拟机软件:VMware Workstaion12
操作系统:Ubuntu14.04
1、修改Ubuntu14.04的apt源为国内的阿里源:
cp /etc/apt/sources.list /etc/apt/sources.list.back vi /etc/apt/sources.list deb http://mirrors.aliyun.com/ubuntu/ raring main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ raring-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ raring-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ raring-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ raring-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ raring main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ raring-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ raring-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ raring-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ raring-backports main restricted universe multiverse
注:若出现:W: Unknown Multi-Arch type 'no' for package 'compiz-core'则说明ubuntu版本与apt版本不匹配,所以升级一下apt版本就行
apt-get install -f apt
配置DNS服务器:
vi /etc/resolv.conf nameserver 8.8.8.8 nameserver 8.8.4.4
更新软件源和软件:
apt-get update apt-get upgrade
2、配置网络接口:
vim /etc/network/interfaces auto ens33 iface ens33 inet static address 192.168.213.131 netmask 255.255.255.0 gateway 192.168.213.2 dns-nameserver 192.168.213.2
3、安装pip并修改pip源:
apt-get install python-pip mkdir ~/.pip vi ~/.pip/pip.conf
添加
[global] index-url = http://pypi.douban.com/simple/ trusted-host = pypi.douban.com
4、安装git:
apt-get install git
5、下载Devstack:
git clone http://git.trystack.cn/openstack-dev/devstack.git -b stable/ocata
6、创建stack用户:
devstack/tools/create-stack-user.sh mv devstack /opt/stack chown -R stack:stack /opt/stack/devstack
7、切换到stack用户并修改pip源:
su stack mkdir ~/.pip vi ~/.pip/pip.conf
添加
[global] index-url = http://pypi.douban.com/simple/ trusted-host = pypi.douban.com
8、设置Devstack配置文件:
cd /opt/stack/devstack vi local.conf [[local|localrc]] # Credentials ADMIN_PASSWORD=admin MYSQL_PASSWORD=secret RABBIT_PASSWORD=secret SERVICE_PASSWORD=secret SERVICE_TOKEN=abcdefghijklmnopqrstuvwxyz # 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 HOST_IP=192.168.213.131 # Define images to be automatically downloaded during the DevStack built process. DOWNLOAD_DEFAULT_IMAGES=False IMAGE_URLS=http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img # only support IP v4 SERVICE_IP_VERSION=4 # only support keystone v2 ENABLE_IDENTITY_V2=True #not create default network NEUTRON_CREATE_INITIAL_NETWORKS=False # instead of default network FLOATING_RANGE="192.168.213.0/24" FIXED_RANGE="10.0.0.0/24" Q_FLOATING_ALLOCATION_POOL=start=192.168.213.132,end=192.168.213.150 PUBLIC_NETWORK_GATEWAY="192.168.213.2" # Branches KEYSTONE_BRANCH=stable/ocata NOVA_BRANCH=stable/ocata NEUTRON_BRANCH=stable/ocata SWIFT_BRANCH=stable/ocata GLANCE_BRANCH=stable/ocata CINDER_BRANCH=stable/ocata # 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 # VLAN configuration. Q_PLUGIN=ml2 ENABLE_TENANT_VLANS=True TENANT_VLAN_RANGE=1100:2999 #Logging LOGFILE=/opt/stack/logs/stack.sh.log VERBOSE=True LOG_COLOR=True SCREEN_LOGDIR=/opt/stack/logs # Work offline #OFFLINE=True # Reclone each time RECLONE=no
9、开始部署:
./stack.sh
若安装失败,则执行./unstack.sh脚本和./clean.sh脚本,并重复上一步骤。