Tuesday, April 26, 2016
黑筆
Sunday, April 24, 2016
Using DevStack to Deploy OpenStack Kilo
I OpenStack Kilo Installation By Using DevStack
用原生的Devstack是無法安裝Kilo版本的主要是pbr版本的問題。
為了解決這樣的問題,必須換source git。
我們把source git換到trystack。
在local.conf加入下面這行。
GIT_BASE=${GIT_BASE:-http://git.trystack.cn}
透過著個方法可以很順利的安裝kilo版。
完整的安裝流程在之前的Blog已經寫過了。
http://gogosatellite.blogspot.tw/2016/04/using-devstack-to-install-openstack.html
只需要將Devstack換成kilo版。
git clone https://github.com/openstack-dev/devstack.git -b stable/kilo
完整的local.conf如下。
[[local|localrc]]
DEST=/opt/stack
#change github to trystack
HOST_IP=172.16.235.128
GIT_BASE=${GIT_BASE:-http://git.trystack.cn}
#NOVNC_REPO=${NOVNC_REPO:-http://git.trystack.cn/kanaka/noVNC.git}
ADMIN_PASSWORD=password
MYSQL_PASSWORD=password
RABBIT_PASSWORD=password
SERVICE_PASSWORD=password
SERVICE_TOKEN=tokentoken
ENABLED_SERVICES=key,rabbit,mysql,horizon
ENABLED_SERVICES+=,n-api,n-crt,n-cpu,n-net,n-cond,n-sch,n-novnc,n-cauth
ENABLED_SERVICES+=,g-api,g-reg
# 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 neutron
enable_service q-vpn
## Neutron options
FIXED_RANGE=10.0.0.0/24
FIXED_NETWORK_SIZE=256
NETWORK_GATEWAY=10.0.0.1
PRIVATE_SUBNET_NAME=privateA
PUBLIC_SUBNET_NAME=public-subnet
FLOATING_RANGE=172.16.235.0/24
PUBLIC_NETWORK_GATEWAY=172.16.235.2
#Q_FLOATING_ALLOCATION_POOL="start=172.24.4.11,end=172.24.4.29"
PUBLIC_INTERFACE=eth0
Q_USE_PROVIDERNET_FOR_PUBLIC=True
OVS_PHYSICAL_BRIDGE=br-ex
PUBLIC_BRIDGE=br-ex
OVS_BRIDGE_MAPPINGS=public:br-ex
LIBVIRT_TYPE=qemu
IMAGE_URLS="http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-uec.tar.gz"
SCREEN_LOGDIR=/opt/stack/screen-logs
SYSLOG=True
LOGFILE=~/devstack/stack.sh.log
Q_USE_DEBUG_COMMAND=True
# RECLONE=No
RECLONE=yes
OFFLINE=False
Result
This is your host ip: 172.16.235.128
Horizon is now available at http://172.16.235.128/
Keystone is serving at http://172.16.235.128:5000/
The default users are: admin and demo
The password: password
stack@kilo:~/devstack$
After Reboot
After reboot the Openstack is stoped, we need to add the following command to make OpenStack alive.
su stack
cd /devstack
sudo ./rejoin-stack
The networking is still not right, and we can add the following command to make the network correctly.
ifconfig eth0 0 ## MANAGEMENT IP ADDRESS
ifconfig br-ex 172.16.235.128 netmask 255.255.255.0 up
route add default gw 172.16.235.2 dev br-ex metric 100
172.16.235.128 is hostip that we want to connect throuth a client.
We can detect gw before install the OpenStack by using route command to get the default gateway.
Now the system go back to a normal state, enjoy OpenStack.
Monday, April 18, 2016
午後的上海潽東機場
Sunday, April 17, 2016
Saturday, April 16, 2016
Using Devstack to install OpenStack Mitaka
Using Devstack to install OpenStack Mitaka
不會忘記精中求細這句話,因此又回到OpenStack。
一開始,我們用Kilo的local.conf安裝Mitaka,我們發現Neutron的部分安裝失敗,因此沿用Kilo的Nuetron的設定有些問題。
會變成nova-network的安裝,因此很久不見的br100又出現了。
後來發現local.conf的
[[local|localrc]] 寫成 [local|localrc]]
大家別犯這錯誤,devstack有檢查header的。
經過一段時間努力,終於裝起來了,因此跟大家分享。
VM Information:
hostname: jonah2
ip: 192.168.121.180
账号/密码 : root / xxxxx
里面有两张网卡 :
eth0 : 192.168.120.0/22 , GW : 192.168.120.254
eth1 : 10.0.0.0/24
install pacakge and download mitaka from git source
apt-get install git
git clone https://github.com/openstack-dev/devstack.git -b stable/mitaka
測試一下repository是不是指向mitaka。
stack@jonah1:~/devstack$ grep -R mitaka *
stackrc:CINDER_BRANCH=${CINDER_BRANCH:-stable/mitaka}
stackrc:GLANCE_BRANCH=${GLANCE_BRANCH:-stable/mitaka}
stackrc:HEAT_BRANCH=${HEAT_BRANCH:-stable/mitaka}
stackrc:HORIZON_BRANCH=${HORIZON_BRANCH:-stable/mitaka}
stackrc:KEYSTONE_BRANCH=${KEYSTONE_BRANCH:-stable/mitaka}
stackrc:NEUTRON_BRANCH=${NEUTRON_BRANCH:-stable/mitaka}
stackrc:NEUTRON_FWAAS_BRANCH=${NEUTRON_FWAAS_BRANCH:-stable/mitaka}
stackrc:NEUTRON_LBAAS_BRANCH=${NEUTRON_LBAAS_BRANCH:-stable/mitaka}
stackrc:NEUTRON_VPNAAS_BRANCH=${NEUTRON_VPNAAS_BRANCH:-stable/mitaka}
stackrc:NOVA_BRANCH=${NOVA_BRANCH:-stable/mitaka}
stackrc:SWIFT_BRANCH=${SWIFT_BRANCH:-stable/mitaka}
stackrc:REQUIREMENTS_BRANCH=${REQUIREMENTS_BRANCH:-stable/mitaka}
tests/test_refs.sh:REFS=`grep BRANCH stackrc | grep -v -- '-master' | grep -v -- '-stable/mitaka'`
start to install mitaka
cd devstack/tools
產生stack user,devstack需要用stack user。經過第二次測試,以下安裝方法是成立的,包含產生stack user到執行./stack.sh。
root@jonah1:~/devstack/tools# ./create-stack-user.sh
Creating a group called stack
Creating a user called stack
Giving stack user passwordless sudo privileges
root user
cd ../..
cp devstack /opt/stack/. -rf
chown -R stack:stack /opt/stack/
stack user
su stack
cd
cd devstack
edit local.conf
[[local|localrc]]
DEST=/opt/stack
ADMIN_PASSWORD=password
MYSQL_PASSWORD=password
RABBIT_PASSWORD=password
SERVICE_PASSWORD=password
SERVICE_TOKEN=tokentoken
ENABLED_SERVICES=key,rabbit,mysql,horizon
ENABLED_SERVICES+=,n-api,n-crt,n-cpu,n-net,n-cond,n-sch,n-novnc,n-cauth
ENABLED_SERVICES+=,g-api,g-reg
# 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
Q_PLUGIN=ml2
#Q_USE_DEBUG_COMMAND=True
if [ "$Q_PLUGIN" = "ml2" ]; then
#Q_ML2_TENANT_NETWORK_TYPE=gre
Q_ML2_TENANT_NETWORK_TYPE=vxlan
:
fi
## Neutron options
FIXED_RANGE=10.0.0.0/24
FIXED_NETWORK_SIZE=256
NETWORK_GATEWAY=10.0.0.1
PRIVATE_SUBNET_NAME=privateA
PUBLIC_SUBNET_NAME=public-subnet
FLOATING_RANGE=192.168.120.0/24
PUBLIC_NETWORK_GATEWAY=192.168.120.254
##Q_FLOATING_ALLOCATION_POOL=start=192.168.27.102,end=192.168.27.110
PUBLIC_INTERFACE=eth0
Q_USE_PROVIDERNET_FOR_PUBLIC=True
OVS_PHYSICAL_BRIDGE=br-ex
PUBLIC_BRIDGE=br-ex
OVS_BRIDGE_MAPPINGS=public:br-ex
LIBVIRT_TYPE=qemu
IMAGE_URLS="http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-uec.tar.gz"
SCREEN_LOGDIR=/opt/stack/screen-logs
SYSLOG=True
LOGFILE=~/devstack/stack.sh.log
Q_USE_DEBUG_COMMAND=True
# RECLONE=No
RECLONE=yes
OFFLINE=False
why the local.conf like that ?
where PUBLICNETWORKGATEWAY=192.168.120.254 obtained by
stack@jonah2:~/devstack$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.120.254 0.0.0.0 UG 0 0 0 br-ex
10.0.0.0 192.168.120.1 255.255.255.0 UG 0 0 0 br-ex
192.168.120.0 * 255.255.252.0 U 0 0 0 br-ex
to check ip and netmask 192.168.121.180/22 obtained by
stack@jonah2:~/devstack$ ip a
.
.
.
6: br-ex: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
link/ether 00:50:56:85:05:dd brd ff:ff:ff:ff:ff:ff
inet 192.168.121.180/22 brd 192.168.123.255 scope global br-ex
valid_lft forever preferred_lft forever
inet6 2001:db8::2/64 scope global tentative dadfailed
valid_lft forever preferred_lft forever
inet6 fe80::e04f:28ff:fe31:c282/64 scope link
valid_lft forever preferred_lft forever
7: br-tun: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
link/ether 2e:08:1a:43:bd:4c brd ff:ff:ff:ff:ff:ff
inet6 fe80::7063:6eff:fe42:5fe8/64 scope link
valid_lft forever preferred_lft forever
run devstack
./stack.sh
result
經過22分鐘左右,我們得到了結果。 透過devstack返回的資訊,現在可以連到dashbaoard了。
This is your host IP address: 192.168.121.180
This is your host IPv6 address: ::1
Horizon is now available at http://192.168.121.180/dashboard
Keystone is serving at http://192.168.121.180:5000/
The default users are: admin and demo
The password: password
看一下網路狀況
stack@jonah2:~/devstack$ ifconfig
br-ex Link encap:Ethernet HWaddr 00:50:56:85:05:dd
inet addr:192.168.121.180 Bcast:192.168.123.255 Mask:255.255.252.0
inet6 addr: fe80::e04f:28ff:fe31:c282/64 Scope:Link
inet6 addr: 2001:db8::2/64 Scope:Global
UP BROADCAST RUNNING MTU:1500 Metric:1
RX packets:7491 errors:0 dropped:0 overruns:0 frame:0
TX packets:5702 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1064105 (1.0 MB) TX bytes:6426734 (6.4 MB)
br-int Link encap:Ethernet HWaddr 1e:e9:1f:ec:8c:4c
inet6 addr: fe80::2cbb:c7ff:feab:f0b0/64 Scope:Link
UP BROADCAST RUNNING MTU:1500 Metric:1
RX packets:833 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:375685 (375.6 KB) TX bytes:828 (828.0 B)
br-tun Link encap:Ethernet HWaddr 2e:08:1a:43:bd:4c
inet6 addr: fe80::7063:6eff:fe42:5fe8/64 Scope:Link
UP BROADCAST RUNNING MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:828 (828.0 B)
eth0 Link encap:Ethernet HWaddr 00:50:56:85:05:dd
inet6 addr: fe80::250:56ff:fe85:5dd/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:104433 errors:0 dropped:0 overruns:0 frame:0
TX packets:20999 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:28740156 (28.7 MB) TX bytes:9126144 (9.1 MB)
eth1 Link encap:Ethernet HWaddr 00:50:56:85:49:9d
inet addr:10.0.0.2 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fe85:499d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:22 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2847 (2.8 KB) TX bytes:908 (908.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:151886 errors:0 dropped:0 overruns:0 frame:0
TX packets:151886 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:107699755 (107.6 MB) TX bytes:107699755 (107.6 MB)
看一下process是否正常運作
20014 stack 20 0 245564 98828 10088 S 2.3 1.2 0:36.31 neutron-server
20614 stack 20 0 204460 64040 10056 S 2.3 0.8 0:43.61 neutron-openvsw
17583 stack 20 0 186944 92504 5052 S 2.0 1.1 0:30.38 glance-api
20185 stack 20 0 250260 98636 4932 S 2.0 1.2 0:37.13 neutron-server
20187 stack 20 0 248812 97020 4868 S 2.0 1.2 0:37.87 neutron-server
20188 stack 20 0 232748 80804 4700 S 2.0 1.0 0:31.44 neutron-server
21080 stack 20 0 197632 57120 10044 S 2.0 0.7 0:32.41 neutron-dhcp-ag
21960 stack 20 0 195112 54332 10032 S 2.0 0.7 0:32.20 neutron-metadat
22466 stack 20 0 194940 54508 9968 S 2.0 0.7 0:32.17 neutron-meterin
26969 stack 20 0 255324 105492 6808 S 2.0 1.3 0:32.21 nova-conductor
20186 stack 20 0 250252 98400 4932 S 1.7 1.2 0:36.92 neutron-server
21607 stack 20 0 198104 57624 10068 S 1.7 0.7 0:33.05 neutron-l3-agen
26968 stack 20 0 256844 106692 6744 S 1.7 1.3 0:32.45 nova-conductor
29282 stack 20 0 1885800 125076 16692 S 1.7 1.5 0:38.43 nova-compute
17584 stack 20 0 187712 93168 5052 S 1.3 1.1 0:30.90 glance-api
19317 stack 20 0 294084 136332 10268 S 0.7 1.7 0:15.06 nova-api
26397 stack 20 0 240860 96428 10104 S 0.7 1.2 0:13.23 nova-conductor
14349 rabbitmq 20 0 2304244 58072 4188 S 0.3 0.7 0:14.72 beam.smp
17458 stack 20 0 180976 90196 8808 S 0.3 1.1 0:12.34 glance-api
18881 root 10 -10 243364 32180 6412 S 0.3 0.4 0:03.65 ovs-vswitchd
27549 stack 20 0 251648 105052 10216 S 0.3 1.3 0:05.42 nova-scheduler
1 root 20 0 33636 4124 2656 S 0.0 0.1 0:01.72 init
基本上neutron有起來。