安装部署整体架构。
虚拟机配置
主机:
windows 7
虚拟机:
VirtualBox 4
安装镜像:
Ubuntu 12.04 ISO
安装步骤:
1.安装配置VirtualBox
open File → Preferences → Network tab
添加 host-only netwok vboxnet0 – 这个作为 Public interface
设置ip 172.16.0.254, mask 255.255.0.0, dhcp disbaled
添加 host-only netwok vboxnet1 – 这个作为 Private (VLAN) interface
设置ip 11.0.0.1, mask 255.0.0.0, dhcp disbaled
2.在VirtualBox中新建虚拟机 内存:1024M
硬盘:20G
cpu:2个
Acceleration: 勾选 VT-x
网络:
Adapter 1: attached to NAT – eth0 will connect here;
Adapter 2: attached to Host-Only Adapter, vboxnet0
Adapter 3: attached to Host-Only Adapter, vboxnet1
3.安装Ubuntu 12.04
过程比较简单一路选则默认。
4.配置客户机
sudo /etc/network/interfaces
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
#Public Interface
auto eth1
iface eth1 inet static
address 172.16.0.1
netmask 255.255.0.0
network 172.16.0.0
broadcast 172.16.255.255
#Private VLAN interface
auto eth2
iface eth2 inet manual
up ifconfig eth2 up
启动网卡ifup eth1 #之后, ifconfig 显示 inet addr:172.16.0.1
ifup eth2
更新
sudo apt-get update && sudo apt-get upgrade
安装Git
sudo apt-get -y install git
获取Kevin的脚本
git clone https://github.com/uksysadmin/OpenStackInstaller.git
cd OpenStackInstaller
sudo git checkout essex
安装openstack
./OSinstall.sh -F 172.16.1.0/24 -f 11.1.0.0/16 -s 512 -p eth2 -t demo -v qemu
上传Ubuntu镜像
./upload_ubuntu.sh -a admin -p openstack -t demo -C 172.16.0.1
添加keypair
. demorc
euca-add-keypair demo > demo.pem
chmod 0600 demo.pem
添加安全组:
euca-authorize default -P tcp -p 22 -s 0.0.0.0/0
euca-authorize default -P tcp -p 80 -s 0.0.0.0/0
euca-authorize default -P tcp -p 8080 -s 0.0.0.0/0
euca-authorize default -P icmp -t -1:-1
登录Horizon启动虚拟机
http://172.16.0.1
到Images & Snapshots页点击Launch Instance
登录到虚拟机:(登录时会有点慢,耐心等待)
ssh -i demo.pem [email protected]
参考
http://www.tikalk.com/alm/blog/expreimenting-openstack-essex-ubuntu-1204-lts-under-virtualbox