Ubuntu 12.04 Server OpenStack Havana多節點(OVS+GRE)安裝

 

1.需求

節點角色   NICs
控制節點   eth0(10.10.10.51)eth1(192.168.100.51)
網絡節點       eth0(10.10.10.52)eth1(10.20.20.52)eth2(192.168.100.52)
計算結點 eth0(10.10.10.53)eth1(10.20.20.53)

 

 

 

 

注意1:你老是可使用dpkg -s <packagename>確認你是用的是Havana版本html

注意2:這個是當前網絡架構node

2.控制節點

2.1.準備Ubuntu
  • 安裝好Ubuntu12.04 server 64bits後,進入root模式進行安裝。python

sudo su - 
  • 添加Havana倉庫:
#apt-get install python-software-properties
#add-apt-repository cloud-archive:havana
  • 升級系統:
#apt-get update
#apt-get upgrade
#apt-get dist-upgrade
 
2.2設置網絡
  • 配置網卡編輯/etc/network/interfaces:mysql

複製代碼
#For Exposing OpenStack API over the internet
auto eth1
iface eth1 inet static
address 192.168.100.51
netmask 255.255.255.0
gateway 192.168.100.1
dns-nameservers 8.8.8.8

#Not internet connected(used for OpenStack management)
auto eth0
iface eth0 inet static
address 10.10.10.52
netmask 255.255.255.0
複製代碼
  • 重啓網絡服務
#/etc/init.d/networking restart
  • 開啓路由轉發:linux

 
sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/' /etc/sysctl.conf
sysctl -p
 
2.3安裝MySQL
  • 安裝MySQL併爲root用戶設置密碼:
#apt-get install mysql-server python-mysqldb
  • 配置mysql監聽全部網絡請求
#sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf
#service mysql restart

2.4安裝RabbitMQ和NTPgit

  • 安裝RabbitMQ:
#apt-get install rabbitmq-server
  • 安裝NTP服務
#apt-get install ntp
2.5建立數據庫
  •  建立數據庫
複製代碼
#mysql -u root -p

#Keystone
CREATE DATABASE keystone;
GRANT ALL ON keystone.* TO 'keystoneUser'@'%' IDENTIFIED BY 'keystonePass';
#Glance
CREATE DATABASE glance;
GRANT ALL ON glance.* TO 'glanceUser'@'%' IDENTIFIED BY 'glancePass';
#Neutron
CREATE DATABASE neutron;
GRANT ALL ON neutron.* TO 'neutronUser'@'%' IDENTIFIED BY 'neutronPass';
#Nova
CREATE DATABASE nova;
GRANT ALL ON nova.* TO 'novaUser'@'%' IDENTIFIED BY 'novaPass';
#Cinder
CREATE DATABASE cinder;
GRANT ALL ON cinder.* TO 'cinderUser'@'%' IDENTIFIED BY 'cinderPass';
#Swift
CREATE DATABASE swift;
GRANT ALL ON swift.* TO 'swiftUser'@'%' IDENTIFIED BY 'swiftPass';

quit;
複製代碼

2.6.配置Keystonegithub

  • 安裝keystone軟件包:ajax

apt-get install keystone
  • 在/etc/keystone/keystone.conf中設置鏈接到新建立的數據庫:sql

connection=mysql://keystone:keystonePass@10.10.10.51/keystone
  • 重啓身份認證服務並同步數據庫:mongodb

service keystone restart
keystone-manage db_dync

 

複製代碼
#!/bin/sh
#
# Keystone Datas
#
# Description: Fill Keystone with datas.
#


# Please set 13, 30 lines of variables
ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin_pass}
SERVICE_PASSWORD=${SERVICE_PASSWORD:-service_pass}
export SERVICE_TOKEN="ADMIN"
export SERVICE_ENDPOINT="http://10.10.10.51:35357/v2.0"
SERVICE_TENANT_NAME=${SERVICE_TENANT_NAME:-service}
KEYSTONE_REGION=RegionOne
# If you need to provide the service, please to open keystone_wlan_ip and swift_wlan_ip
# of course you are a multi-node architecture, and swift service
# corresponding ip address set the following variables
KEYSTONE_IP="10.10.10.51"
EXT_HOST_IP="192.168.100.51"
SWIFT_IP="10.10.10.51"
COMPUTE_IP=$KEYSTONE_IP
EC2_IP=$KEYSTONE_IP
GLANCE_IP=$KEYSTONE_IP
VOLUME_IP=$KEYSTONE_IP
NEUTRON_IP=$KEYSTONE_IP
CEILOMETER=$KEYSTONE_IP

get_id () {
    echo `$@ | awk '/ id / { print $4 }'`
}

# Create Tenants
ADMIN_TENANT=$(get_id keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT tenant-create --name=admin)
SERVICE_TENANT=$(get_id keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT tenant-create --name=$SERVICE_TENANT_NAME)
DEMO_TENANT=$(get_id keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT tenant-create --name=demo)
INVIS_TENANT=$(get_id keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT tenant-create --name=invisible_to_admin)

# Create Users
ADMIN_USER=$(get_id keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-create --name=admin --pass="$ADMIN_PASSWORD" --email=admin@domain.com)
DEMO_USER=$(get_id keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-create --name=demo --pass="$ADMIN_PASSWORD" --email=demo@domain.com)

# Create Roles
ADMIN_ROLE=$(get_id keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT role-create --name=admin)
KEYSTONEADMIN_ROLE=$(get_id keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT role-create --name=KeystoneAdmin)
KEYSTONESERVICE_ROLE=$(get_id keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT role-create --name=KeystoneServiceAdmin)

# Add Roles to Users in Tenants
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-role-add --user-id $ADMIN_USER --role-id $ADMIN_ROLE --tenant-id $ADMIN_TENANT
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-role-add --user-id $ADMIN_USER --role-id $ADMIN_ROLE --tenant-id $DEMO_TENANT
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-role-add --user-id $ADMIN_USER --role-id $KEYSTONEADMIN_ROLE --tenant-id $ADMIN_TENANT
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-role-add --user-id $ADMIN_USER --role-id $KEYSTONESERVICE_ROLE --tenant-id $ADMIN_TENANT

# The Member role is used by Horizon and Swift
MEMBER_ROLE=$(get_id keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT role-create --name=Member)
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-role-add --user-id $DEMO_USER --role-id $MEMBER_ROLE --tenant-id $DEMO_TENANT
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-role-add --user-id $DEMO_USER --role-id $MEMBER_ROLE --tenant-id $INVIS_TENANT

# Configure service users/roles
NOVA_USER=$(get_id keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-create --name=nova --pass="$SERVICE_PASSWORD" --tenant-id $SERVICE_TENANT --email=nova@domain.com)
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-role-add --tenant-id $SERVICE_TENANT --user-id $NOVA_USER --role-id $ADMIN_ROLE

GLANCE_USER=$(get_id keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-create --name=glance --pass="$SERVICE_PASSWORD" --tenant-id $SERVICE_TENANT --email=glance@domain.com)
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-role-add --tenant-id $SERVICE_TENANT --user-id $GLANCE_USER --role-id $ADMIN_ROLE

SWIFT_USER=$(get_id keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-create --name=swift --pass="$SERVICE_PASSWORD" --tenant-id $SERVICE_TENANT --email=swift@domain.com)
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-role-add --tenant-id $SERVICE_TENANT --user-id $SWIFT_USER --role-id $ADMIN_ROLE

RESELLER_ROLE=$(get_id keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT role-create --name=ResellerAdmin)
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-role-add --tenant-id $SERVICE_TENANT --user-id $NOVA_USER --role-id $RESELLER_ROLE

NEUTRON_USER=$(get_id keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-create --name=neutron --pass="$SERVICE_PASSWORD" --tenant-id $SERVICE_TENANT --email=neutron@domain.com)
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-role-add --tenant-id $SERVICE_TENANT --user-id $NEUTRON_USER --role-id $ADMIN_ROLE

CINDER_USER=$(get_id keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-create --name=cinder --pass="$SERVICE_PASSWORD" --tenant-id $SERVICE_TENANT --email=cinder@domain.com)
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-role-add --tenant-id $SERVICE_TENANT --user-id $CINDER_USER --role-id $ADMIN_ROLE

CEILOMETER_USER=$(get_id keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-create --name=ceilometer --pass="$SERVICE_PASSWORD" --tenant-id $SERVICE_TENANT --email=ceilometer@domain.com)
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT user-role-add --tenant-id $SERVICE_TENANT --user-id $CEILOMETER_USER --role-id $ADMIN_ROLE


## Create Service
KEYSTONE_ID=$(keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT service-create --name keystone --type identity --description 'OpenStack Identity'| awk '/ id / { print $4 }' )
COMPUTE_ID=$(keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT service-create --name=nova --type=compute --description='OpenStack Compute Service'| awk '/ id / { print $4 }' )
CINDER_ID=$(keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT service-create --name=cinder --type=volume --description='OpenStack Volume Service'| awk '/ id / { print $4 }' )
GLANCE_ID=$(keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT service-create --name=glance --type=image --description='OpenStack Image Service'| awk '/ id / { print $4 }' )
SWIFT_ID=$(keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT service-create --name=swift --type=object-store --description='OpenStack Storage Service' | awk '/ id / { print $4 }'  )
EC2_ID=$(keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT service-create --name=ec2 --type=ec2 --description='OpenStack EC2 service'| awk '/ id / { print $4 }' )
NEUTRON_ID=$(keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT service-create --name=neutron --type=network --description='OpenStack Networking service'| awk '/ id / { print $4 }'  )
CEILOMETER_ID=$(keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT service-create --name=ceilometer --type=metering --description='Ceilometer Metering Service'| awk '/ id / { print $4 }' )

## Create Endpoint
#identity
if [ "$KEYSTONE_WLAN_IP" != '' ];then
    keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT endpoint-create --region $KEYSTONE_REGION --service-id=$KEYSTONE_ID --publicurl http://"$EXT_HOST_IP":5000/v2.0 --adminurl http://"$KEYSTONE_WLAN_IP":35357/v2.0 --internalurl http://"$KEYSTONE_WLAN_IP":5000/v2.0
fi
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT endpoint-create --region $KEYSTONE_REGION --service-id=$KEYSTONE_ID --publicurl http://"$EXT_HOST_IP":5000/v2.0 --adminurl http://"$KEYSTONE_IP":35357/v2.0 --internalurl http://"$KEYSTONE_IP":5000/v2.0

#compute
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT endpoint-create --region $KEYSTONE_REGION --service-id=$COMPUTE_ID --publicurl http://"$EXT_HOST_IP":8774/v2/\$\(tenant_id\)s --adminurl http://"$COMPUTE_IP":8774/v2/\$\(tenant_id\)s --internalurl http://"$COMPUTE_IP":8774/v2/\$\(tenant_id\)s

#volume
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT endpoint-create --region $KEYSTONE_REGION --service-id=$CINDER_ID --publicurl http://"$EXT_HOST_IP":8776/v1/\$\(tenant_id\)s --adminurl http://"$VOLUME_IP":8776/v1/\$\(tenant_id\)s --internalurl http://"$VOLUME_IP":8776/v1/\$\(tenant_id\)s

#image
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT endpoint-create --region $KEYSTONE_REGION --service-id=$GLANCE_ID --publicurl http://"$EXT_HOST_IP":9292/v2 --adminurl http://"$GLANCE_IP":9292/v2 --internalurl http://"$GLANCE_IP":9292/v2

#object-store
if [ "$SWIFT_WLAN_IP" != '' ];then
    keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT endpoint-create --region $KEYSTONE_REGION --service-id=$SWIFT_ID --publicurl http://"$EXT_HOST_IP":8080/v1/AUTH_\$\(tenant_id\)s --adminurl http://"$SWIFT_WLAN_IP":8080/v1 --internalurl http://"$SWIFT_WLAN_IP":8080/v1/AUTH_\$\(tenant_id\)s
fi
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT endpoint-create --region $KEYSTONE_REGION --service-id=$SWIFT_ID --publicurl http://"$EXT_HOST_IP":8080/v1/AUTH_\$\(tenant_id\)s --adminurl http://"$SWIFT_IP":8080/v1 --internalurl http://"$SWIFT_IP":8080/v1/AUTH_\$\(tenant_id\)s

#ec2
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT endpoint-create --region $KEYSTONE_REGION --service-id=$EC2_ID --publicurl http://"$EXT_HOST_IP":8773/services/Cloud --adminurl http://"$EC2_IP":8773/services/Admin --internalurl http://"$EC2_IP":8773/services/Cloud

#network
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT endpoint-create --region $KEYSTONE_REGION --service-id=$NEUTRON_ID --publicurl http://"$EXT_HOST_IP":9696/ --adminurl http://"$NUETRON_IP":9696/ --internalurl http://"$NEUTRON_IP":9696/

#ceilometer
keystone --token $SERVICE_TOKEN --endpoint $SERVICE_ENDPOINT endpoint-create --region $KEYSTONE_REGION --service-id=$CEILOMETER_ID --publicurl http://"$EXT_HOST_IP":8777/ --adminurl http://"$CEILOMETER_IP":8777/ --internalurl http://"$CEILOMETER_IP":8777/
複製代碼

 

  •  上述腳本文件爲了填充keystone數據庫,其中還有些內容根據自身狀況修改。

  •  建立一個簡單的憑據文件,這樣稍後不會由於輸入過多的環境變量而感到厭煩。

 

複製代碼
vi creds-admin


export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=admin_pass
export OS_AUTH_URL="http://192.168.100.51:5000/v2.0/"


source creds-admin
複製代碼

 

  • 經過命令列出keystone中添加的用戶以及獲得token:

 
keystone user-list
keystone token-get

 

2.7.設置Glance

  • 安裝Glance

apt-get install glance
  • 更新/etc/glance/glance-api-paste.ini
複製代碼
[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
delay_auth_decision = true
auth_host = 10.10.10.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = service_pass
複製代碼
  • 更新/etc/glance/glance-registry-paste.ini
複製代碼
[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host = 10.10.10.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = service_pass
複製代碼
  • 更新/etc/glance/glance-api.conf
sql_connection = mysql://glanceUser:glancePass@10.10.10.51/glance
和
[paste_deploy]
flavor = keystone
  • 更新/etc/glance/glance-registry.conf
sql_connection = mysql://glanceUser:glancePass@10.10.10.51/glance
和
[paste_deploy]
flavor = keystone
  • 從新啓動glance服務:
cd /etc/init.d/;for i in $( ls glance-* );do service $i restart;done
  • 同步glance數據庫
glance-manage db_sync
  • 測試Glance
mkdir images
cd images
wget http://cdn.download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-disk.img
glance image-create --name="Cirros 0.3.1" --disk-format=qcow2 --container-format=bare --is-public=true <cirros-0.3.1-x86_64-disk.img
  • 列出鏡像檢查是否上傳成功:
glance image-list
2.8.設置Neutron
  • 安裝Neutron組件:

apt-get install neutron-server
  • 編輯/etc/neutron/api-paste.ini

複製代碼
[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host = 10.10.10.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = neutron
admin_password = service_pass
複製代碼
  • 編輯OVS配置文件/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini:

複製代碼
[OVS]
tenant_network_type = gre
tunnel_id_ranges = 1:1000
enable_tunneling = True

#Firewall driver for realizing neutron security group function
[SECURITYGROUP]
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
複製代碼
  • 編輯/etc/neutron/neutron.conf

 
複製代碼
[database]
connection = mysql://neutronUser:NEUTRON_DAPASS@10.10.10.51/neutron

[keystone_authtoken]
auth_host = 10.10.10.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = neutron
admin_password = service_pass
signing_dir = /var/lib/neutron/keystone-signing
複製代碼
  • 重啓Neutron全部服務:
cd /etc/init.d/; for i in $( ls neutron-* ); do sudo service $i restart; done
2.9.設置Nova
  • 安裝nova組件:
apt-get install  nova-api nova-cert novnc nova-consoleauth nova-scheduler nova-novncproxy nova-doc nova-conductor nova-ajax-console-proxy 
  • 編輯/etc/nova/api-paste.ini修改認證信息:
複製代碼
[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host = 10.10.10.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = nova
admin_password = service_pass
signing_dir = /var/lib/nova/keystone-signing
# Workaround for https://bugs.launchpad.net/nova/+bug/1154809
auth_version = v2.0
複製代碼
  • 編輯修改/etc/nova/nova.conf
複製代碼
[DEFAULT]
logdir=/var/log/nova
state_path=/var/lib/nova
lock_path=/run/lock/nova
verbose=True
api_paste_config=/etc/nova/api-paste.ini
compute_scheduler_driver=nova.scheduler.simple.SimpleScheduler
rabbit_host=10.10.10.51
nova_url=http://10.10.10.51:8774/v1.1/
sql_connection=mysql://novaUser:novaPass@10.10.10.51/nova
root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf

# Auth
use_deprecated_auth=false
auth_strategy=keystone

# Imaging service
glance_api_servers=10.10.10.51:9292
image_service=nova.image.glance.GlanceImageService

# Vnc configuration
novnc_enabled=true
novncproxy_base_url=http://192.168.100.51:6080/vnc_auto.html
novncproxy_port=6080
vncserver_proxyclient_address=10.10.10.51
vncserver_listen=0.0.0.0

# Network settings
network_api_class=nova.network.neutronv2.api.API
neutron_url=http://10.10.10.51:9696
neutron_auth_strategy=keystone
neutron_admin_tenant_name=service
neutron_admin_username=neutron
neutron_admin_password=service_pass
neutron_admin_auth_url=http://10.10.10.51:35357/v2.0
libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver
linuxnet_interface_driver=nova.network.linux_net.LinuxOVSInterfaceDriver
#If you want Neutron + Nova Security groups
firewall_driver=nova.virt.firewall.NoopFirewallDriver
security_group_api=neutron
#If you want Nova Security groups only, comment the two lines above and uncomment line -1-.
#-1-firewall_driver=nova.virt.libvirt.firewall.IptablesFirewallDriver

#Metadata
service_neutron_metadata_proxy = True
neutron_metadata_proxy_shared_secret = helloOpenStack

# Compute #
compute_driver=libvirt.LibvirtDriver

# Cinder #
volume_api_class=nova.volume.cinder.API
osapi_volume_listen_port=5900
複製代碼
  • 同步數據庫:
nova-manage db sync
  • 重啓Nova全部服務:
cd /etc/init.d/; for i in $( ls nova-* ); do  service $i restart; done
  • 檢查全部nova服務是否啓動正常:
nova-manage service list
2.10.設置Cinder
  • 安裝Cinder軟件包
apt-get install  cinder-api cinder-scheduler cinder-volume iscsitarget open-iscsi iscsitarget-dkms
  • 配置iscsi服務:
sed -i 's/false/true/g' /etc/default/iscsitarget
  • 重啓服務:
service iscsitarget start
service open-iscsi start
  • 配置/etc/cinder/api-paste.ini
複製代碼
filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
service_protocol = http
service_host = 192.168.100.51
service_port = 5000
auth_host = 10.10.10.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = cinder
admin_password = service_pass
複製代碼
  • 編輯/etc/cinder/cinder.conf
複製代碼
[DEFAULT]
rootwrap_config=/etc/cinder/rootwrap.conf
sql_connection = mysql://cinderUser:cinderPass@10.10.10.51/cinder
api_paste_config = /etc/cinder/api-paste.ini
iscsi_helper=ietadm
volume_name_template = volume-%s
volume_group = cinder-volumes
verbose = True
auth_strategy = keystone
#osapi_volume_listen_port=5900
複製代碼
  • 接下來同步數據庫:
cinder-manage db sync
  • 最後別忘記建立一個卷組命名爲cinder-volumes:
複製代碼
dd if=/dev/zero of=cinder-volumes bs=1 count=0 seek=2G
losetup /dev/loop2 cinder-volumes
fdisk /dev/loop2
#Type in the followings:
n
p
1
ENTER
ENTER
t
8e
w
複製代碼
  • 建立物理卷和卷組:
pvcreate /dev/loop2
vgcreate cinder-volumes /dev/loop2
  • 注意:重啓後卷組不會自動掛載,以下進行設置:
vim /etc/init/losetup.conf

description "set up loop devices"
start on mounted MOUNTPOINT=/
task
exec /sbin/losetup  /dev/loop2 /home/cloud/cinder-volumes
  • 重啓cinder服務:
cd /etc/init.d/; for i in $( ls cinder-* ); do service $i restart; done
  • 確認Cinder服務在運行:
cd /etc/init.d/; for i in $( ls cinder-* ); do service $i status; done
2.11.設置Horizon
  • 安裝horizon:
apt-get install openstack-dashboard memcached
  • 若是你不喜歡OpenStack ubuntu主題,你能夠停用它:
dpkg --purge openstack-dashboard-ubuntu-theme
  • 重啓Apache和memcached服務:
service apache2 restart; service memcached restart

注意:重啓apache2,出現could not reliably determine the server's fully domain name,using 127.0.0.1 for ServerName.這是因爲沒有解析出域名致使的。解決方法以下:編輯/etc/apache2/apache2.conf,添加以下操做便可。

ServerName localhost

2.12.設置Ceilometer

  • 安裝Metering服務
apt-get install ceilometer-api ceilometer-collector ceilometer-agent-central python-ceilometerclient
  • 安裝MongoDB數據庫
apt-get install mongodb
  • 配置mongodb監聽全部網絡接口請求:
sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mongodb.conf

service mongodb restart
  • 建立ceilometer數據庫用戶:
#mongo
>use ceilometer
>db.addUser({ user:"ceilometer",pwd:"CEILOMETER_DBPASS",roles:["readWrite","dbAdmin"]})
  • 配置Metering服務使用數據庫
複製代碼
...
[database]
...
# The SQLAlchemy connection string used to connect to the
# database (string value)
connection = mongodb://ceilometer:CEILOMETER_DBPASS@10.10.10.51:27017/ceilometer
...
複製代碼
  • 配置RabbitMQ訪問,編輯/etc/ceilometer/ceilometer.conf
...
[DEFAULT]
rabbit_host = 10.10.10.51
  • 編輯/etc/ceilometer/ceilometer.conf使認證信息生效
複製代碼
[keystone_authtoken]
auth_host = 10.10.10.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = ceilometer
admin_password = CEILOMETER_PASS
複製代碼
  • 簡單獲取鏡像,你必須配置鏡像服務以發送通知給總線,編輯/etc/glance/glance-api.conf修改[DEFAULT]部分
notifier_strategy=rabbit
rabbit_host=10.10.10.51
  • 重啓鏡像服務
cd /etc/init.d/;for i in $(ls glance-* );do service $i restart;done
  • 重啓服務,使配置信息生效
cd /etc/init.d;for i in $( ls ceilometer-* );do service $i restart;done
  • 編輯/etc/cinder/cinder.conf,獲取volume。
control_exchange=cinder
notification_driver=cinder.openstack.common.notifier.rpc_notifier
  • 重啓Cinder服務
cd /etc/init.d/;for i in $( ls cinder-* );do service $i restart;done

3.網絡結點

  • 安裝好ubuntu 12.04 Server 64bits後,進入root模式下完成配置:

sudo su - 
  • 添加Havana源:
#apt-get install python-software-properties
#add-apt-repository cloud-archive:havana
  • 升級系統:

  • apt-get update
    apt-get upgrade
    apt-get dist-upgrade
  • 安裝ntp服務:
apt-get install ntp
  • 配置ntp服務從控制節點上同步時間:
複製代碼
sed -i 's/server 0.ubuntu.pool.ntp.org/#server 0.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i 's/server 1.ubuntu.pool.ntp.org/#server 1.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i 's/server 2.ubuntu.pool.ntp.org/#server 2.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i 's/server 3.ubuntu.pool.ntp.org/#server 3.ubuntu.pool.ntp.org/g' /etc/ntp.conf

#Set the network node to follow up your conroller node
sed -i 's/server ntp.ubuntu.com/server 10.10.10.51/g' /etc/ntp.conf

service ntp restart
複製代碼
  • 配置網絡:
複製代碼
# OpenStack management
auto eth0
iface eth0 inet static
address 10.10.10.52
netmask 255.255.255.0

# VM Configuration
auto eth1
iface eth1 inet static
address 10.20.20.52
netmask 255.255.255.0

# VM internet Access
auto eth2
iface eth2 inet static
address 192.168.100.52
netmask 255.255.255.0
gateway 192.168.100.1
dns-servers 8.8.8.8
複製代碼
  • 編輯/etc/sysctl.conf,開啓路由轉發和關閉包目的過濾,這樣網絡節點能協做VMs的traffic。
net.ipv4.ip_forward=1
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0

#運行下面命令,使生效
sysctl -p

3.3.安裝OpenVSwitch

  • 安裝OpenVSwitch軟件包:
apt-get install  openvswitch-controller openvswitch-switch openvswitch-datapath-dkms openvswitch-datapath-source
module-assistant auto-install openvswitch-datapath
/etc/init.d/openvswitch-switch restart
  • 建立網橋
#br-int will be used for VM integration
ovs-vsctl add-br br-int

#br-ex is used to make to VM accessable from the internet
ovs-vsctl add-br br-ex
  • 把網卡eth2加入br-ex:
ovs-vsctl add-port br-ex eth2
  • 從新修改網卡配置/etc/network/interfaces:
複製代碼
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# Not internet connected(used for OpenStack management)
# The primary network interface
auto eth0
iface eth0 inet static
# This is an autoconfigured IPv6 interface
# iface eth0 inet6 auto
address 10.10.10.52
netmask 255.255.255.0

auto eth1
iface eth1 inet static
address 10.20.20.52
netmask 255.255.255.0

#For Exposing OpenStack API over the internet
auto eth2
iface eth2 inet manual
up ifconfig $IFACE 0.0.0.0 up
up ip link set $IFACE promisc on
down ip link set $IFACE promisc off
down ifconfig $IFACE down

auto br-ex
iface br-ex inet static
address 192.168.0.52
netmask 255.255.255.0
gateway 192.168.100.1
dns-nameservers 8.8.8.8
複製代碼
  • 重啓網絡服務:
/etc/init.d/networking restart
  • 查看網橋配置:
複製代碼
root@network:~# ovs-vsctl list-br
br-ex
br-int

root@network:~# ovs-vsctl show
    Bridge br-int
        Port br-int
            Interface br-int
                type: internal
    Bridge br-ex
        Port "eth2"
            Interface "eth2"
        Port br-ex
            Interface br-ex
                type: internal
    ovs_version: "1.4.0+build0"
複製代碼

3.4.Neutron-*

  • 安裝Neutron組件:
apt-get install neutron-plugin-openvswitch-agent neutron-dhcp-agent neutron-l3-agent neutron-metadata-agent
  • 編輯/etc/neutron/api-paste.ini
複製代碼
[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host = 10.10.10.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = neutron
admin_password = service_pass
複製代碼
  • 編輯OVS配置文件:/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
複製代碼
[OVS]
tenant_network_type = gre
enable_tunneling = True
tunnel_id_ranges = 1:1000
integration_bridge = br-int
tunnel_bridge = br-tun
local_ip = 10.20.20.52

#Firewall driver for realizing neutron security group function
[SECURITYGROUP]
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
複製代碼
  • 更新/etc/neutron/metadata_agent.ini:
複製代碼
auth_url = http://10.10.10.51:35357/v2.0
auth_region = RegionOne
admin_tenant_name = service
admin_user = neutron
admin_password = service_pass

# IP address used by Nova metadata server
nova_metadata_ip = 10.10.10.51
    
# TCP Port used by Nova metadata server
nova_metadata_port = 8775

metadata_proxy_shared_secret = helloOpenStack
複製代碼
  • 編輯/etc/neutron/neutron.conf
複製代碼
rabbit_host = 10.10.10.51
    
[keystone_authtoken]
auth_host = 10.10.10.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = neutron
admin_password = service_pass
signing_dir = /var/lib/quantum/keystone-signing

[database]
connection = mysql://neutronUser:neutronPass@10.10.10.51/neutron
複製代碼
  • 編輯/etc/neutron/l3_agent.ini:
複製代碼
[DEFAULT]
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
use_namespaces = True
external_network_bridge = br-ex
signing_dir = /var/cache/neutron
admin_tenant_name = service
admin_user = neutron
admin_password = service_pass
auth_url = http://10.10.10.51:35357/v2.0
l3_agent_manager = neutron.agent.l3_agent.L3NATAgentWithStateReport
root_helper = sudo neutron-rootwrap /etc/neutron/rootwrap.conf
複製代碼
  • 編輯/etc/neutron/dhcp_agent.ini:
複製代碼
[DEFAULT]
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
use_namespaces = True
signing_dir = /var/cache/neutron
admin_tenant_name = service
admin_user = neutron
admin_password = service_pass
auth_url = http://10.10.10.51:35357/v2.0
dhcp_agent_manager = neutron.agent.dhcp_agent.DhcpAgentWithStateReport
root_helper = sudo neutron-rootwrap /etc/neutron/rootwrap.conf
state_path = /var/lib/neutron
複製代碼
  • 重啓服務:
cd /etc/init.d/; for i in $( ls neutron-* ); do service $i restart; done

 

4.計算結點

4.1.準備結點

  • 安裝好ubuntu 12.04 Server 64bits後,進入root模式進行安裝:
sudo su - 
  • 添加Havana源:
#apt-get install python-software-properties
#add-apt-repository cloud-archive:havana
  • 升級系統:
apt-get update
apt-get upgrade
apt-get dist-upgrade
  • 安裝ntp服務:
apt-get install ntp
  • 配置ntp服務從控制節點同步時間:
複製代碼
sed -i 's/server 0.ubuntu.pool.ntp.org/#server 0.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i 's/server 1.ubuntu.pool.ntp.org/#server 1.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i 's/server 2.ubuntu.pool.ntp.org/#server 2.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i 's/server 3.ubuntu.pool.ntp.org/#server 3.ubuntu.pool.ntp.org/g' /etc/ntp.conf
    
#Set the network node to follow up your conroller node
sed -i 's/server ntp.ubuntu.com/server 10.10.10.51/g' /etc/ntp.conf

service ntp restart
複製代碼

4.2.配置網絡

  • 以下配置網絡/etc/network/interfaces:
複製代碼
# The loopback network interface
auto lo
iface lo inet loopback
    
# Not internet connected(used for OpenStack management)
# The primary network interface
auto eth0
iface eth0 inet static
# This is an autoconfigured IPv6 interface
# iface eth0 inet6 auto
address 10.10.10.53
netmask 255.255.255.0
    
# VM Configuration
auto eth1
iface eth1 inet static
address 10.20.20.53
netmask 255.255.255.0
複製代碼
  • 開啓路由轉發:
sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/' /etc/sysctl.conf
sysctl -p

4.3.KVM

  • 確保你的硬件啓動virtualization:
apt-get install cpu-checker
kvm-ok
  • 安裝kvm並配置它:
apt-get install -y kvm libvirt-bin pm-utils
  • 在/etc/libvirt/qemu.conf配置文件中啓用cgroup_device_aci數組:
cgroup_device_acl = [
"/dev/null", "/dev/full", "/dev/zero",
"/dev/random", "/dev/urandom",
"/dev/ptmx", "/dev/kvm", "/dev/kqemu",
"/dev/rtc", "/dev/hpet","/dev/net/tun"
]
  • 刪除默認的虛擬網橋:
virsh net-destroy default
virsh net-undefine default
  • 更新/etc/libvirt/libvirtd.conf配置文件:
listen_tls = 0
listen_tcp = 1
auth_tcp = "none"
  • 編輯libvirtd_opts變量在/etc/init/libvirt-bin.conf配置文件中:
env libvirtd_opts="-d -l"
  • 編輯/etc/default/libvirt-bin文件:
libvirtd_opts="-d -l"
  • 重啓libvirt服務使配置生效:
service libvirt-bin restart

4.4.OpenVSwitch

  • 安裝OpenVSwitch軟件包:
apt-get install  openvswitch-switch openvswitch-datapath-dkms openvswitch-datapath-source
module-assistant auto-install openvswitch-datapath
service openvswitch-switch restart
  • 建立網橋:
ovs-vsctl add-br br-int

4.5.Neutron

  • 安裝Neutron OpenVSwitch代理:
apt-get install neutron-plugin-openvswitch-agent
  • 編輯OVS配置文件/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini:
複製代碼
[OVS]
tenant_network_type = gre
tunnel_id_ranges = 1:1000
integration_bridge = br-int
tunnel_bridge = br-tun
local_ip = 10.20.20.53
enable_tunneling = True
    
#Firewall driver for realizing quantum security group function
[SECURITYGROUP]
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
複製代碼
  • 編輯/etc/neutron/neutron.conf
複製代碼
rabbit_host = 10.10.10.51

[keystone_authtoken]
auth_host = 10.10.10.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = neutron
admin_password = service_pass
signing_dir = /var/lib/neutron/keystone-signing

[database]
connection = mysql://neutronUser:neutronPass@10.10.10.51/neutron
複製代碼
  • 重啓服務:
service neutron-plugin-openvswitch-agent restart

4.6.Nova

  • 安裝nova組件:
apt-get install nova-compute-kvm python-guestfs
  • 注意:若是你的宿主機不支持kvm虛擬化,可把nova-compute-kvm換成nova-compute-qemu
  • 同時/etc/nova/nova-compute.conf配置文件中的libvirt_type=qemu
  • 在/etc/nova/api-paste.ini配置文件中修改認證信息:
複製代碼
[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host = 10.10.10.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = nova
admin_password = service_pass
signing_dirname = /tmp/keystone-signing-nova
# Workaround for https://bugs.launchpad.net/nova/+bug/1154809
auth_version = v2.0
複製代碼
  • 編輯修改/etc/nova/nova.conf
複製代碼
[DEFAULT]
logdir=/var/log/nova
state_path=/var/lib/nova
lock_path=/run/lock/nova
verbose=True
api_paste_config=/etc/nova/api-paste.ini
compute_scheduler_driver=nova.scheduler.simple.SimpleScheduler
rabbit_host=10.10.10.51
nova_url=http://10.10.10.51:8774/v1.1/
sql_connection=mysql://novaUser:novaPass@10.10.10.51/nova
root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf
my_ip = 10.10.10.53
# Auth
use_deprecated_auth=false
auth_strategy=keystone

# Imaging service
glance_api_servers=10.10.10.51:9292
image_service=nova.image.glance.GlanceImageService

# Vnc configuration
novnc_enabled=true
novncproxy_base_url=http://192.168.100.51:6080/vnc_auto.html
novncproxy_port=6080
vncserver_proxyclient_address=10.10.10.53                   #這是與控制節點不一樣的地方。
vncserver_listen=0.0.0.0

# Network settings
network_api_class=nova.network.neutronv2.api.API
neutron_url=http://10.10.10.51:9696
neutron_auth_strategy=keystone
neutron_admin_tenant_name=service
neutron_admin_username=neutron
neutron_admin_password=service_pass
neutron_admin_auth_url=http://10.10.10.51:35357/v2.0
libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver
linuxnet_interface_driver=nova.network.linux_net.LinuxOVSInterfaceDriver
#If you want Neutron + Nova Security groups
firewall_driver=nova.virt.firewall.NoopFirewallDriver
security_group_api=neutron
#If you want Nova Security groups only, comment the two lines above and uncomment line -1-.
#-1-firewall_driver=nova.virt.libvirt.firewall.IptablesFirewallDriver

#Metadata
service_neutron_metadata_proxy = True
neutron_metadata_proxy_shared_secret = helloOpenStack

# Compute #
compute_driver=libvirt.LibvirtDriver

# Cinder #
volume_api_class=nova.volume.cinder.API
osapi_volume_listen_port=5900
複製代碼
  • 重啓nova-*服務:
cd /etc/init.d/; for i in $( ls nova-* ); do service $i restart; done
  • 檢查全部nova服務是否正常啓動:
nova-manage service list

4.7. 爲監控服務安裝計算代理

  • 安裝監控服務:
ap-get install ceilometer-agent-compute
  • 配置修改/etc/nova/nova.conf:
複製代碼
...
[DEFAULT]
...
instance_usage_audit=True
instance_usage_audit_period=hour
notify_on_state_change=vm_and_task_state
notification_driver=nova.openstack.common.notifier.rpc_notifier
notification_driver=ceilometer.compute.nova_notifier
複製代碼
  • 重啓服務:
service ceilometer-agent-compute restart

 

5.建立第一VM

5.1.爲admin租戶建立內網、外網、路由器和虛擬機

  • 設置環境變量:
複製代碼
vim creds-admin

#Paste the following:
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=admin_pass
export OS_AUTH_URL="http://192.168.100.51:5000/v2.0/"

source creds-admin
複製代碼
  • 列出已建立的用戶和租戶:
複製代碼
keystone user-list

# keystone tenant-list
+----------------------------------+--------------------+---------+
| id | name | enabled |
+----------------------------------+--------------------+---------+
| 4cb714b719204285acc7ecea40c33ca8 | admin | True |
| eb8c703bee4549feb2c9c551013296d5 | demo | True |
| 1e78ea73b9d741a7bcde1eaf6a6b5555 | invisible_to_admin | True |
| 16542d36818f480d94554438c1fc0761 | service | True |
+----------------------------------+--------------------+---------+

複製代碼
  • 爲admin租戶建立網絡:
複製代碼
neutron net-create --tenant-id $id_of_tenant --router:external=True net_admin

Created a new network:
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| id | 04d2e397-ceae-43df-b4e9-63e8ea12ddfa |
| name | net_admin |
| provider:network_type | gre |
| provider:physical_network | |
| provider:segmentation_id | 1 |
| shared | False |
| status | ACTIVE |
| subnets | |
| tenant_id | 4cb714b719204285acc7ecea40c33ca8 |
+---------------------------+--------------------------------------+

複製代碼
  • 爲admin租戶建立子網:
複製代碼

# neutron subnet-create --tenant-id 4cb714b719204285acc7ecea40c33ca8 net_admin 50.50.1.0/24
Created a new subnet:
+------------------+----------------------------------------------+
| Field | Value |
+------------------+----------------------------------------------+
| allocation_pools | {"start": "50.50.1.2", "end": "50.50.1.254"} |
| cidr | 50.50.1.0/24 |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 50.50.1.1 |
| host_routes | |
| id | 13be7adc-5837-4462-8887-d20548f6283f |
| ip_version | 4 |
| name | |
| network_id | 04d2e397-ceae-43df-b4e9-63e8ea12ddfa |
| tenant_id | 4cb714b719204285acc7ecea40c33ca8 |
+------------------+----------------------------------------------+

複製代碼
  • 爲admin租戶建立路由器:
複製代碼

# neutron router-create --tenant-id 4cb714b719204285acc7ecea40c33ca8 router_admin
Created a new router:
+-----------------------+--------------------------------------+
| Field | Value |
+-----------------------+--------------------------------------+
| admin_state_up | True |
| external_gateway_info | |
| id | 04f207ec-6d4b-49e7-8614-b69eee12feb8 |
| name | router_admin |
| status | ACTIVE |
| tenant_id | 4cb714b719204285acc7ecea40c33ca8 |
+-----------------------+--------------------------------------+

複製代碼
  • 列出路由代理類型:
複製代碼

# neutron agent-list
+--------------------------------------+--------------------+---------+-------+----------------+
| id | agent_type | host | alive | admin_state_up |
+--------------------------------------+--------------------+---------+-------+----------------+
| 18c4a977-f9b3-4a36-bcb5-a7d92346522c | DHCP agent | network | :-) | True |
| 70e2b440-49d2-4860-9888-401dd7f6102b | Open vSwitch agent | network | :-) | True |
| b4b9781d-de82-476f-97f6-560914210f0a | L3 agent | network | :-) | True |
| d1a3c1cb-9383-410d-b84b-a9574ad328ec | Open vSwitch agent | compute | :-) | True |
+--------------------------------------+--------------------+---------+-------+----------------+

複製代碼
  • 將router_admin設置爲L3代理類型:
neutron l3-agent-router-add $id_of_l3_agent router_admin

Added router router_admin to L3 agent
  • 將net_admin子網與router_admin路由關聯:

# neutron router-interface-add 1568ec23-0c79-43d0-8b83-52b0a63cf1df c5ac3b09-829c-48d4-8ac7-f07619479a66 
Added interface 6e2533c9-f6a0-4e40-a05c-074b62164995 to router 1568ec23-0c79-43d0-8b83-52b0a63cf1df.

  • 建立外網net_external,注意設置--router:external=True:
複製代碼

# neutron net-create net_external --router:external=True --shared
Created a new network:
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| id | bcf6e1cb-dd57-40a8-9b61-a6bc6d0a6696 |
| name | net_external |
| provider:network_type | gre |
| provider:physical_network | |
| provider:segmentation_id | 2 |
| router:external | True |
| shared | True |
| status | ACTIVE |
| subnets | |
| tenant_id | 4cb714b719204285acc7ecea40c33ca8 |
+---------------------------+--------------------------------------+

複製代碼
  • 爲net_admin建立子網,注意設置的gateway必須在給到的網段內:
複製代碼

neutron subnet-create --tenant-id 4cb714b719204285acc7ecea40c33ca8 --allocation-pool start=192.168.100.110,end=192.168.100.130 --gateway=192.168.100.1 net_external 192.168.100.0/24 --enable_dhcp=False
Created a new subnet:
+------------------+----------------------------------------------------+
| Field | Value |
+------------------+----------------------------------------------------+
| allocation_pools | {"start": "192.168.100.110", "end": "192.168.100.130"} |
| cidr | 192.168.100.0/24 |
| dns_nameservers | |
| enable_dhcp | False |
| gateway_ip | 192.168.100.1 |
| host_routes | |
| id | d8461e75-e259-43c5-9bdc-68221a6cf111 |
| ip_version | 4 |
| name | |
| network_id | bcf6e1cb-dd57-40a8-9b61-a6bc6d0a6696 |
| tenant_id | 4cb714b719204285acc7ecea40c33ca8 |
+------------------+----------------------------------------------------+

複製代碼
  • 將net_external與router_admin路由器關聯:
neutron router-gateway-set router_admin net_external

Set gateway for router router_admin
  • 建立floating ip:
複製代碼

neutron floatingip-create net_external
Created a new floatingip:
+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| fixed_ip_address | |
| floating_ip_address | 192.168.100.111 |
| floating_network_id | bcf6e1cb-dd57-40a8-9b61-a6bc6d0a6696 |
| id | 942b66e7-d4a5-4136-8be0-3bf00688a56d |
| port_id | |
| router_id | |
| tenant_id | 4cb714b719204285acc7ecea40c33ca8 |
+---------------------+--------------------------------------+

# neutron floatingip-create net_external
Created a new floatingip:
+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| fixed_ip_address | |
| floating_ip_address | 192.168.100.112 |
| floating_network_id | bcf6e1cb-dd57-40a8-9b61-a6bc6d0a6696 |
| id | e46c9811-59f2-4a0f-a7b0-3c93185dde58 |
| port_id | |
| router_id | |
| tenant_id | 4cb714b719204285acc7ecea40c33ca8 |
+---------------------+--------------------------------------+

複製代碼

 

6.參考文檔:

1.openstack官方文檔:http://docs.openstack.org/havana/install-guide/install/apt/openstack-install-guide-apt-havana.pdf  目前openstack官方文檔已經作的很好了,如何安裝,配置,寫的都挺不錯的,還有neutron那一節對各類狀況的網絡結構列出的很詳細。

2.感謝Bilel Msekni作出的貢獻,https://github.com/mseknibilel/OpenStack-Grizzly-Install-Guide/blob/OVS_MultiNode/OpenStack_Grizzly_Install_Guide.rst

相關文章
相關標籤/搜索