-
Notifications
You must be signed in to change notification settings - Fork 71
/
addClient.sh
executable file
·44 lines (35 loc) · 1.4 KB
/
addClient.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
# **addClient.sh** is a tool to deploy an environment to manage OpenStack cloud computing service.
# [email protected] (Kayven)
# Learn more and get the most recent version at http://code.google.com/p/onestack/
set -o xtrace
## 请使用root执行本脚本!
## Ubuntu 12.04 ("Precise") 部署 OpenStack Essex,在client管理OpenStack安装nova管理工具
## 参考:
## http://docs.openstack.org/essex/openstack-compute/starter/content/
## 1、设置root权限
## 为了简单,全部都是用root来运行。
##########################################################################
## 2、自行检查下面network/interfaces的两个网卡设置
ServerControlIP="192.168.139.50"
## token, 登录dashboard密码
ADMIN_TOKEN="admin"
##########################################################################
## 3、安装ntp
apt-get install -y ntp
echo "server $ServerControlIP" > /etc/ntp.conf
service ntp restart
## 4、安装nova
apt-get install -y python-novaclient glance-client swift qemu-kvm
cat <<ENV_AUTH >> /etc/profile
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=ADMIN
export OS_AUTH_URL="http://192.168.139.50:5000/v2.0/"
ENV_AUTH
sed -i -e "s/ADMIN/$ADMIN_TOKEN/g" /etc/profile
sed -i -e "s/192.168.139.50/$ServerControlIP/g" /etc/profile
## manage via web: http://192.168.139.50 ($ServerControlIP)
## command line:
## nova list
## glance index