1. ubuntu只安装openssh服务,给eth0网卡设置静态IP,不用dhcp
在你的home下,例如我的是/home/mycisco/
2.apt-get install git
3. git clone https://github.com/openstack-dev/devstack.git
下面耐心等,完毕后,创建如下localrc文件放到/home/mycisco/devstack下
===============================
#替换host IP为你设置的IP
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 45 46 47 48 49 50 51 52 53 54 55 56 57 |
HOST_IP=<em>192.168.232.138</em> SERVICE_HOST=<em>192.168.232.138</em> #FLOATING_RANGE=192.168.143.224/27 FIXED_RANGE=10.0.100.0/24 FIXED_NETWORK_SIZE=256 NETWORK_GATEWAY=10.0.100.1 #HOST_IP_IFACE=eth0 #PUBLIC_INTERFACE=eth0 #FLAT_INTERFACE=eth1 ADMIN_PASSWORD=<em>yourpassword</em> MYSQL_PASSWORD=<em>yourpassword</em> RABBIT_PASSWORD=<em>yourpassword</em> SERVICE_PASSWORD=<em>yourpassword</em> 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 ## Neutron . Neutron L4/L7 Network Service enable_service q-lbaas #enable_service quantum #enable_service s-proxy #enable_service s-object #enable_service s-container #enable_service s-account NOVA_BRANCH=stable/icehouse CINDER_BRANCH=stable/icehouse GLANCE_BRANCH=stable/icehouse HORIZON_BRANCH=stable/icehouse KEYSTONE_BRANCH=stable/icehouse NEUTRON_BRANCH=stable/icehouse SWIFT_BRANCH=stable/icehouse Q_HOST=$SERVICE_HOST Q_PLUGIN=ml2 Q_AGENT=openvswitch Q_ML2_PLUGIN_MECHANISM_DRIVERS=openvswitch,linuxbridge,l2population Q_ML2_TENANT_NETWORK_TYPE=gre Q_USE_SECGROUP=True Q_AGENT_EXTRA_AGENT_OPTS=(tunnel_types=gre) Q_AGENT_EXTRA_SRV_OPTS=(local_ip=$HOST_IP) ## Optional, to enable tempest configuration as part of devstack enable_service tempest SERVICE_TOKEN=tokentoken #SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5 #SWIFT_REPLICAS=1 #the default pvs/lvs created by devstack is not big enough (pvs = 10Gb and it creates a 1G partition out of it) VOLUME_BACKING_FILE_SIZE=60000M #Enable logging in a file instead of having to use screen -r SCREEN_LOGDIR=/opt/stack/logs/screen |
===================================
4.运行 ./stack.sh
耐心等待,因为都是外国源很慢,也容易出错。发现出差可以反复运行该脚本。完成后类似如下:
然后可以通过浏览器访问
5. 修改/etc/rc.local 增加以下内容,因为重启系统后 br-ex的接口ip会丢失,NAT条目是为了内部VM可以通过hypervisor实现上网
ifconfig br-ex 172.24.4.1 netmask 255.255.255.0
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/home/mycisco/devstack/rejoin-stack.sh