1. VMWare安装
NAT模式
设置root密码:#sudo passwd
2. 设置代理(如果需要)
a. #vi /etc/apt/apt.conf 添加:
Acquire::http::Proxy "http://web-proxy.atlanta.hp.com:8080";
b. #vi /etc/environment添加:
http_proxy=http://web-proxy.atlanta.hp.com:8080/
https_proxy=http://web-proxy.atlanta.hp.com:8080/
ftp_proxy=http://web-proxy.atlanta.hp.com:8080/
no_proxy=localhost,127.0.0.1,localaddress,.localdomain.com,192.168.88.146
c. Allow the http_proxy and https_proxy environment variables to be passed into a sudo shell
#sudo visudo 添加
Defaults env_keep += "no_proxy http_proxy https_proxy HTTP_PROXY HTTPS_PROXY"
3.update系统
#sudo apt-get update
#sudo apt-get dist-upgrade
4. 安装git
#sudo apt-get install git
如果git协议通不过防火墙,修改体会为http协议
#git config --global url."https://".insteadOf git://
5. 拉取代码
#git clone https://github.com/openstack-dev/devstack.git
6. 非root用户创建, 及devstack目录权限设置
a option
可运行devstack/create-stack-user
.sh 一个stack用户。
修改devstack目录权限
# chown -R stack:stack devstack/
b option
非root用户hp sudo权限设置 (如果用此用户安装devstack)
#echo "hp ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoer
7. 创建./devstack/loacal.conf文件
注意修改IP地址,
#################################################
[[local|localrc]]
HOST_IP=192.168.88.146
SERVICE_HOST=$HOST_IP
ADMIN_PASSWORD=111111
DATABASE_PASSWORD=$ADMIN_PASSWORD
SERVICE_TOKEN=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
LOGFILE=stack.sh.log
SCREEN_LOGDIR=$DEST/logs/screen
VERBOSE=True
LOG_COLOR=True
RECLONE=yes
# keystone
ENABLED_SERVICES=key
# additional services
ENABLED_SERVICES+=,rabbit
ENABLED_SERVICES+=,mysql
# glance
ENABLED_SERVICES+=,g-api,g-reg
# nova
ENABLED_SERVICES+=,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch,n-novnc,n-xvnc,n-cauth
# cinder
ENABLED_SERVICES+=,cinder,c-api,c-vol,c-sch,c-bak
# heat
ENABLED_SERVICES+=,h-eng,h-api,h-api-cfn,h-api-cw
# dashboard
ENABLED_SERVICES+=,horizon
# Neutron
disable_service n-net
ENABLED_SERVICES+=,q-svc,q-agt,q-dhcp,q-l3,q-meta,q-metering,neutron
# Swift
ENABLED_SERVICES+=,s-proxy,s-object,s-container,s-account
SWIFT_REPLICAS=1
SWIFT_HASH=011688b4413657e209e
SWIFT_DATA_DIR=$DEST/data
# Ceilometer
# Enable the ceilometer metering services
enable_service ceilometer-acompute ceilometer-acentral ceilometer-anotification ceilometer-collector
# Enable the ceilometer alarming services
enable_service ceilometer-alarm-evaluator,ceilometer-alarm-notifier
# Enable the ceilometer api services
enable_service ceilometer-api
# Images
# Use this image when creating test instances
IMAGE_URLS+=",http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img"
# Use this image when working with Orchestration (Heat)
#IMAGE_URLS+=",http://fedorapeople.org/groups/heat/prebuilt-jeos-images/F19-x86_64-cfntools.qcow2"
ENABLED_SERVICES+=,tempest
API_RATE_LIMIT=False
# Whether to use 'dev mode' for screen windows. Dev mode works by
# stuffing text into the screen windows so that a developer can use
# ctrl-c, up-arrow, enter to restart the service. Starting services
# this way is slightly unreliable, and a bit slower, so this can
# be disabled for automated testing by setting this value to False.
USE_SCREEN=True
[[post-config|$NOVA_CONF]]
[DEFAULT]
notification_driver=nova.openstack.common.notifier.rabbit_notifier,ceilometer.compute.nova_notifier
##################################################
如果IMAGE_URLS不存在会有以下错误:
##################################################
2016-03-24 02:23:21.958 | + ./stack.sh:main:L1207: " http://cdn.download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img
2016-03-24 02:23:21.958 | + /workspace/devstack/functions:upload_image:L41: local image_url=http://cdn.download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img
2016-03-24 02:23:21.958 | + /workspace/devstack/functions:upload_image:L43: local image image_fname image_name
2016-03-24 02:23:21.958 | + /workspace/devstack/functions:upload_image:L46: mkdir -p /workspace/devstack/files/images
2016-03-24 02:23:21.959 | ++ /workspace/devstack/functions:upload_image:L47: basename http://cdn.download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img
2016-03-24 02:23:21.964 | + /workspace/devstack/functions:upload_image:L47: image_fname=cirros-0.3.2-x86_64-disk.img
2016-03-24 02:23:21.964 | + /workspace/devstack/functions:upload_image:L48: [[ http://cdn.download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img != file* ]]
2016-03-24 02:23:21.964 | + /workspace/devstack/functions:upload_image:L50: [[ ! -f /workspace/devstack/files/cirros-0.3.2-x86_64-disk.img ]]
2016-03-24 02:23:22.005 | ++ /workspace/devstack/functions:upload_image:L50: stat -c %s /workspace/devstack/files/cirros-0.3.2-x86_64-disk.img
2016-03-24 02:23:22.007 | + /workspace/devstack/functions:upload_image:L50: [[ 0 = \0 ]]
2016-03-24 02:23:22.007 | + /workspace/devstack/functions:upload_image:L51: wget --progress=dot:giga -c http://cdn.download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img -O /workspace/devstack/files/cirros-0.3.2-x86_64-disk.img
2016-03-24 02:23:22.051 | --2016-03-23 19:23:22-- http://cdn.download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img
2016-03-24 02:23:22.242 | Resolving web-proxy.atlanta.hp.com (web-proxy.atlanta.hp.com)... 16.85.88.10
2016-03-24 02:23:22.432 | Connecting to web-proxy.atlanta.hp.com (web-proxy.atlanta.hp.com)|16.85.88.10|:8080... connected.
2016-03-24 02:23:23.568 | Proxy request sent, awaiting response... 404 Not Found
2016-03-24 02:23:23.570 | 2016-03-23 19:23:23 ERROR 404: Not Found.
2016-03-24 02:23:23.571 |
2016-03-24 02:23:23.571 | + /workspace/devstack/functions:upload_image:L1: exit_trap
2016-03-24 02:23:23.571 | + ./stack.sh:exit_trap:L474: local r=8
2016-03-24 02:23:23.573 | ++ ./stack.sh:exit_trap:L475: jobs -p
2016-03-24 02:23:23.575 | + ./stack.sh:exit_trap:L475: jobs=
2016-03-24 02:23:23.575 | + ./stack.sh:exit_trap:L478: [[ -n '' ]]
2016-03-24 02:23:23.577 | + ./stack.sh:exit_trap:L484: kill_spinner
2016-03-24 02:23:23.577 | + ./stack.sh:kill_spinner:L370: '[' '!' -z '' ']'
2016-03-24 02:23:23.577 | + ./stack.sh:exit_trap:L486: [[ 8 -ne 0 ]]
2016-03-24 02:23:23.577 | + ./stack.sh:exit_trap:L487: echo 'Error on exit'
2016-03-24 02:23:23.578 | Error on exit
2016-03-24 02:23:23.578 | + ./stack.sh:exit_trap:L488: generate-subunit 1458785501 702 fail
2016-03-24 02:23:23.983 | + ./stack.sh:exit_trap:L489: [[ -z /opt/stack/logs ]]
2016-03-24 02:23:23.983 | + ./stack.sh:exit_trap:L492: /workspace/devstack/tools/worlddump.py -d /opt/stack/logs
2016-03-24 02:23:24.028 | df: '/mnt/hgfs': Protocol error
2016-03-24 02:23:24.124 | ovs-ofctl: br-tun is not a bridge or a socket
2016-03-24 02:23:24.147 | ovs-ofctl: br-tun is not a bridge or a socket
2016-03-24 02:23:24.332 | + ./stack.sh:exit_trap:L498: exit 8
##################################################
8. 注释devstack/stack.sh以下两定义
1020 export OS_IDENTITY_API_VERSION=3
1021 export OS_AUTH_URL=$KEYSTONE_AUTH_URI
1022 export OS_USERNAME=admin
1023 #export OS_USER_DOMAIN_ID=default
1024 export OS_PASSWORD=$ADMIN_PASSWORD
1025 export OS_PROJECT_NAME=admin
1026 #export OS_PROJECT_DOMAIN_ID=default
1027 export OS_REGION_NAME=$REGION_NAME
否则可能产生error:
##################################################
2016-03-24 04:55:34.192 | ++ /workspace/devstack/inc/meta-config:get_meta_section_files:L70: awk -v ma
2016-03-24 04:55:34.193 | /^\[\[.+\|.*\]\]/ {
2016-03-24 04:55:34.193 | gsub("[][]", "", $1);
2016-03-24 04:55:34.193 | split($1, a, "|");
2016-03-24 04:55:34.193 | if (a[1] == matchgroup)
2016-03-24 04:55:34.193 | print a[2]
2016-03-24 04:55:34.193 | }
2016-03-24 04:55:34.193 | ' /workspace/devstack/local.conf
2016-03-24 04:55:34.449 | + ./stack.sh:main:L1337: [[ -x /workspace/devstack/local.sh ]]
2016-03-24 04:55:34.449 | + ./stack.sh:main:L1338: echo 'Running user script /workspace/devstack/local
2016-03-24 04:55:34.449 | Running user script /workspace/devstack/local.sh
2016-03-24 04:55:34.449 | + ./stack.sh:main:L1339: /workspace/devstack/local.sh
2016-03-24 04:55:37.176 | WARNING: setting legacy OS_TENANT_NAME to support cli tools.
2016-03-24 04:55:37.185 | WARNING: setting legacy OS_TENANT_NAME to support cli tools.
2016-03-24 04:55:43.696 | ERROR (DiscoveryFailure): Cannot use v2 authentication with domain scope
2016-03-24 04:55:48.088 | ERROR (DiscoveryFailure): Cannot use v2 authentication with domain scope
2016-03-24 04:55:49.237 | ERROR (DiscoveryFailure): Cannot use v2 authentication with domain scope
2016-03-24 04:55:50.308 | ERROR (DiscoveryFailure): Cannot use v2 authentication with domain scope
2016-03-24 04:55:50.342 | ++ ./stack.sh:main:L1339: err_trap
2016-03-24 04:55:50.342 | ++ ./stack.sh:err_trap:L504: local r=1
2016-03-24 04:55:50.342 | stack.sh failed: full log in stack.sh.log.2016-03-23-213618
2016-03-24 04:55:50.367 | Error on exit
2016-03-24 04:55:52.266 | df: '/mnt/hgfs': Protocol error
##################################################
9. 执行 devstack/stack.sh
成功执行,有如下提示:This is your host IP address: 192.168.88.146
This is your host IPv6 address: ::1
Horizon is now available at http://192.168.88.146/dashboard
Keystone is serving at http://192.168.88.146:5000/
The default users are: admin and demo
The password: 111111
hp@ubuntu:/workspace/devstack$
10. Excise
hp@ubuntu:/workspace/devstack$ . openrc admin admin
WARNING: setting legacy OS_TENANT_NAME to support cli tools.
hp@ubuntu:/workspace/devstack$ nova list
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+
hp@ubuntu:/workspace/devstack$ glance image-list
+--------------------------------------+---------------------------------+
| ID | Name |
+--------------------------------------+---------------------------------+
| 3ab2f1a9-9613-4dcf-8d5c-3a562a924721 | cirros-0.3.4-x86_64-disk |
| 2a063ac3-a218-4f74-ab54-dd12265f5079 | cirros-0.3.4-x86_64-uec |
| 22a9da8e-e2f6-4a7a-9d0d-baaa3fb8630b | cirros-0.3.4-x86_64-uec-kernel |
| f36d4473-0c8f-4aaa-bfa6-a61c1203642f | cirros-0.3.4-x86_64-uec-ramdisk |
+--------------------------------------+---------------------------------+
hp@ubuntu:/workspace/devstack$ neutron net-list
+--------------------------------------+---------+----------------------------------------------------------+
| id | name | subnets |
+--------------------------------------+---------+----------------------------------------------------------+
| 52228e17-d698-4e1d-8dd7-3136087b5261 | private | 6589e1c7-f959-4c7f-b9d4-eaecc19bd916 10.0.0.0/24 |
| | | fc03349f-b7c8-4a16-908b-780a02f0b577 fd20:4a8a:d716::/64 |
| 3bc42aec-c3bc-4a7b-b663-7e066869306e | public | 068b5f31-8ce6-4d1f-b8ca-a6f143084d3d 172.24.4.0/24 |
| | | b2d2fc1c-86a7-4fe5-b411-c3f70a1f4511 2001:db8::/64 |
+--------------------------------------+---------+----------------------------------------------------------+
hp@ubuntu:/workspace/devstack$ cinder list
+----+--------+------+------+-------------+----------+-------------+
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+----+--------+------+------+-------------+----------+-------------+
+----+--------+------+------+-------------+----------+-------------+
hp@ubuntu:/workspace/devstack$ swift list
hp@ubuntu:/workspace/devstack$ keystone catalog
/usr/local/lib/python2.7/dist-packages/keystoneclient/shell.py:64: DeprecationWarning: The keystone CLI is deprecated in favor of python-openstackclient. For a Python library, continue using python-keystoneclient.
'python-keystoneclient.', DeprecationWarning)
/usr/local/lib/python2.7/dist-packages/keystoneclient/v2_0/client.py:145: DeprecationWarning: Constructing an instance of the keystoneclient.v2_0.client.Client class without a session is deprecated as of the 1.7.0 release and may be removed in the 2.0.0 release.
'the 2.0.0 release.', DeprecationWarning)
/usr/local/lib/python2.7/dist-packages/keystoneclient/v2_0/client.py:147: DeprecationWarning: Using the 'tenant_name' argument is deprecated in version '1.7.0' and will be removed in version '2.0.0', please use the 'project_name' argument instead
super(Client, self).__init__(**kwargs)
/usr/local/lib/python2.7/dist-packages/debtcollector/renames.py:45: DeprecationWarning: Using the 'tenant_id' argument is deprecated in version '1.7.0' and will be removed in version '2.0.0', please use the 'project_id' argument instead
return f(*args, **kwargs)
/usr/local/lib/python2.7/dist-packages/keystoneclient/httpclient.py:371: DeprecationWarning: Constructing an HTTPClient instance without using a session is deprecated as of the 1.7.0 release and may be removed in the 2.0.0 release.
'the 2.0.0 release.', DeprecationWarning)
/usr/local/lib/python2.7/dist-packages/keystoneclient/session.py:140: DeprecationWarning: keystoneclient.session.Session is deprecated as of the 2.1.0 release in favor of keystoneauth1.session.Session. It will be removed in future releases.
DeprecationWarning)
/usr/local/lib/python2.7/dist-packages/keystoneclient/auth/identity/base.py:56: DeprecationWarning: keystoneclient auth plugins are deprecated as of the 2.1.0 release in favor of keystoneauth1 plugins. They will be removed in future releases.
'in future releases.', DeprecationWarning)
Service: compute
+-------------+------------------------------------------------------------------+
| Property | Value |
+-------------+------------------------------------------------------------------+
| adminURL | http://192.168.88.146:8774/v2.1/7ed21aaa4b944edab9eb3e1993b87f11 |
| id | 4e9f6ea79ddf4bc39005a24b5fbb9bb4 |
| internalURL | http://192.168.88.146:8774/v2.1/7ed21aaa4b944edab9eb3e1993b87f11 |
| publicURL | http://192.168.88.146:8774/v2.1/7ed21aaa4b944edab9eb3e1993b87f11 |
| region | RegionOne |
+-------------+------------------------------------------------------------------+
Service: network
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| adminURL | http://192.168.88.146:9696/ |
| id | 42c459f49b1c4153801a3e7266363d31 |
| internalURL | http://192.168.88.146:9696/ |
| publicURL | http://192.168.88.146:9696/ |
| region | RegionOne |
+-------------+----------------------------------+
Service: volumev2
+-------------+----------------------------------------------------------------+
| Property | Value |
+-------------+----------------------------------------------------------------+
| adminURL | http://192.168.88.146:8776/v2/7ed21aaa4b944edab9eb3e1993b87f11 |
| id | 694204dd8a90498fb24f580a177aed15 |
| internalURL | http://192.168.88.146:8776/v2/7ed21aaa4b944edab9eb3e1993b87f11 |
| publicURL | http://192.168.88.146:8776/v2/7ed21aaa4b944edab9eb3e1993b87f11 |
| region | RegionOne |
+-------------+----------------------------------------------------------------+
Service: image
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| adminURL | http://192.168.88.146:9292 |
| id | 1d40d6aec6474055bb2f81e87e2606fe |
| internalURL | http://192.168.88.146:9292 |
| publicURL | http://192.168.88.146:9292 |
| region | RegionOne |
+-------------+----------------------------------+
Service: compute_legacy
+-------------+----------------------------------------------------------------+
| Property | Value |
+-------------+----------------------------------------------------------------+
| adminURL | http://192.168.88.146:8774/v2/7ed21aaa4b944edab9eb3e1993b87f11 |
| id | 55439796c2fd4501bb560fd8c5b7977d |
| internalURL | http://192.168.88.146:8774/v2/7ed21aaa4b944edab9eb3e1993b87f11 |
| publicURL | http://192.168.88.146:8774/v2/7ed21aaa4b944edab9eb3e1993b87f11 |
| region | RegionOne |
+-------------+----------------------------------------------------------------+
Service: cloudformation
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| adminURL | http://192.168.88.146:8000/v1 |
| id | 891ccf7da2924108a3ef8eae8b2761d8 |
| internalURL | http://192.168.88.146:8000/v1 |
| publicURL | http://192.168.88.146:8000/v1 |
| region | RegionOne |
+-------------+----------------------------------+
Service: volume
+-------------+----------------------------------------------------------------+
| Property | Value |
+-------------+----------------------------------------------------------------+
| adminURL | http://192.168.88.146:8776/v1/7ed21aaa4b944edab9eb3e1993b87f11 |
| id | 2dd651226c88406aaca5a03414828c8f |
| internalURL | http://192.168.88.146:8776/v1/7ed21aaa4b944edab9eb3e1993b87f11 |
| publicURL | http://192.168.88.146:8776/v1/7ed21aaa4b944edab9eb3e1993b87f11 |
| region | RegionOne |
+-------------+----------------------------------------------------------------+
Service: orchestration
+-------------+----------------------------------------------------------------+
| Property | Value |
+-------------+----------------------------------------------------------------+
| adminURL | http://192.168.88.146:8004/v1/7ed21aaa4b944edab9eb3e1993b87f11 |
| id | 61cd235dc7214852b646a55e35dd75e8 |
| internalURL | http://192.168.88.146:8004/v1/7ed21aaa4b944edab9eb3e1993b87f11 |
| publicURL | http://192.168.88.146:8004/v1/7ed21aaa4b944edab9eb3e1993b87f11 |
| region | RegionOne |
+-------------+----------------------------------------------------------------+
Service: object-store
+-------------+---------------------------------------------------------------------+
| Property | Value |
+-------------+---------------------------------------------------------------------+
| adminURL | http://192.168.88.146:8080 |
| id | 9091986eb1be4c74a23c96223fef942d |
| internalURL | http://192.168.88.146:8080/v1/AUTH_7ed21aaa4b944edab9eb3e1993b87f11 |
| publicURL | http://192.168.88.146:8080/v1/AUTH_7ed21aaa4b944edab9eb3e1993b87f11 |
| region | RegionOne |
+-------------+---------------------------------------------------------------------+
Service: identity
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| adminURL | http://192.168.88.146:35357/v2.0 |
| id | 84a1d304baeb4260886de33189c1c450 |
| internalURL | http://192.168.88.146:5000/v2.0 |
| publicURL | http://192.168.88.146:5000/v2.0 |
| region | RegionOne |
+-------------+----------------------------------+
hp@ubuntu:/workspace/devstack$