VirtualBox下安裝Openstack
VirtualBox下安裝Openstack
安裝部署整體架構。
虛擬機配置
主機:
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啓動虛擬機
到Images & Snapshots頁點擊Launch Instance
登錄到虛擬機:(登錄時會有點慢,耐心等待)
ssh -i demo.pem [email protected]
參考
http://www.tikalk.com/alm/blog/expreimenting-openstack-essex-ubuntu-1204-lts-under-virtualbox