devstack安裝all in one openstack(kilo)

環境說明:
這邊利用virtualbox開啟一台vm,網卡第一張設定Bridge Adapter模式,第二張設定Host-only Network模式




OS
14.04
kernel
3.19.0-30-generic


HostPrivate IP (Management IP)/Interface(eth1)Public IP/Interface(eth0)
controller192.168.100.4172.20.3.53

首先建立一個user為stack
$ adduser stack $ echo 'stack ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/stack $ chmod 0440 /etc/sudoers.d/stack

更新軟體清單以及套件
$ apt-get update && apt-get -y upgrade

安裝ntp並設定
$ apt-get install -y git ntp

# 編輯ntp.conf 加入以下server $ vim /etc/ntp.conf server time.stdtime.gov.tw

切換stack並clone devstack
$ su stack
$ cd
$ git clone https://github.com/openstack-dev/devstack.git
$ cd devstack
$ git checkout stable/kilo

(Optional) 如果想使用murano,必須另外下載source code,如果沒有要用murano可跳過這步
$ git clone https://github.com/openstack/murano.git -b stable/kilo $ cd murano/contrib/devstack # 複製murano source code $ export DEVSTACK_DIR=~/devstack $ cp lib/murano ${DEVSTACK_DIR}/lib $ cp lib/murano-dashboard ${DEVSTACK_DIR}/lib $ cp extras.d/70-murano.sh ${DEVSTACK_DIR}/extras.d $ cd ${DEVSTACK_DIR}

編輯localrc
$ vim localrc # 加入以下設定 HOST_IP=主機ip HORIZON_BRANCH=stable/kilo KEYSTONE_BRANCH=stable/kilo NOVA_BRANCH=stable/kilo NEUTRON_BRANCH=stable/kilo GLANCE_BRANCH=stable/kilo CINDER_BRANCH=stable/kilo # 設定相關網路 PUBLIC_INTERFACE=eth0 FIXED_RANGE=192.168.1.0/24 NETWORK_GATEWAY=192.168.1.1 FLOATING_RANGE=172.24.1.0/24 PUBLIC_NETWORK_GATEWAY=172.24.1.1 FLAT_INTERFACE=eth1 # 設定相關服務的密碼 DATABASE_PASSWORD=password RABBIT_PASSWORD=password SERVICE_TOKEN=password SERVICE_PASSWORD=password ADMIN_PASSWORD=password # 停用nova-network,啟用neutron 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-lbaas enable_service q-vpn # 啟用nova-consoleauth enable_service n-cauth # 基本設定 VERBOSE=True LOG_COLOR=True GIT_BASE="http://github.com" Q_PLUGIN=ml2 ENABLE_TENANT_VLANS=True # 如果要啟用murano,需先enable heat service # Enable Heat enable_service heat h-api h-api-cfn h-api-cw h-eng # Enable Murano enable_service murano murano-api murano-engine

執行stack.sh,就可以根據你上面所輸入的host_ip登入到horizon,密碼為ADMIN_PASSWORD設定值
$ ./stack.sh

==Troubleshooting==
issue1: 如果是run在virtualbox上,然後floating_range跟host_ip設在不同網段 請在host上輸入 $ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE issue2: 登入horizon出現no such table: django_session 請到/opt/stack/horizon底下輸入 $ python manage.py syncdb

參考連結:





留言

這個網誌中的熱門文章

devstack安裝all in one openstack(pike)

Python - 計算特定目錄底下的檔案以及目錄數量

利用ATOM 編輯器在Windows開發PHP