1. 구축환경
1) Host OS
- Windows 7
- Hypervisor : VMware Workstation 9
- IP Address
Private,Host-only(VMnet1, 192.168.140.0/24)
2) Guest OS
> 64-bit PC (amd64, x86_64)
> 3.Ubuntu 12.04 "Precise Pangolin" Minimal CD 30MB*
IP(eth1) : Manual IP
2. Virtual Machine Settings
3. Minimal Ubuntu 12.04 Install
IP address : 192.168.0.101
Netmask : 255.255.255.0
Gateway : 192.168.0.1
4. openstack 설치
$ sudo vi /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.0.101
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 168.126.63.1
dns-search kobic.re.kr
auto eth1
iface eth1 inet dhcp
iface eth1 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
stack$ sudo service networking restart
stack$ sudo apt-get install git -y
stack$ sudo apt-get install lvm2 -y
stack$ sudo fdisk /dev/sdb
n > p > 1 > ENTER > ENTER > t > 8e > w
stack$ sudo pvcreate /dev/sdb1
stack$ sudo vgcreate cinder-volumes /dev/sdb1
stack$ sudo su -
root# echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
root# sync; shutdown -r now
stack$ sudo apt-get update
stack$ sudo apt-get upgrade
stack$ sudo apt-get dist-upgrade
stack$ git clone git://github.com/openstack-dev/devstack.git
stack$ cd devstack
stack$ vi localrc
ADMIN_PASSWORD=isbyeontistorycom
MYSQL_PASSWORD=isbyeontistorycom
RABBIT_PASSWORD=isbyeontistorycom
SERVICE_PASSWORD=isbyeontistorycom
SERVICE_TOKEN=openstackservicetoken
HOST_IP=192.168.0.101
FLOATING_RANGE=192.168.0.64/28
FIXED_RANGE=10.0.0.0/24
FIXED_NETWORK_SIZE=256
FLAT_INTERFACE=eth0
VOLUME_GROUP="cinder-volumes"
VOLUME_NAME_PREFIX="volume-"
stack$ ./stack.sh
......
......
Horizon is now available at http://192.168.0.101/
Keystone is serving at http://192.168.0.101:5000/v2.0/
Examples on using novaclient command line is in exercise.sh
The default users are: admin and demo
The password: kobic123
This is your host ip: 192.168.0.101
stack$ source openrc
stack$ nova secgroup-add-rule "default" tcp 22 22 0.0.0.0/0
stack$ nova secgroup-add-rule "default" tcp 80 80 0.0.0.0/0
stack$ nova secgroup-add-rule "default" icmp -1 -1 0.0.0.0/0
5. VM 및 Keypairs 생성 후 VM 접속 방법
http://192.168.0.101
stack$ chmod 0600 isbyeonkey.pem
stack$ ssh cirros@10.0.0.2 -i isbyeonkey.pem
cirros$ id
uid=1000(cirros) gid=1000(cirros) groups=1000(cirros)
cirros$ ifconfig
eth0 Link encap:Ethernet HWaddr FA:16:3E:69:28:9A
inet addr:10.0.0.2 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: fe80::f816:3eff:fe69:289a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:472 errors:0 dropped:0 overruns:0 frame:0
TX packets:209 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:46722 (45.6 KiB) TX bytes:25436 (24.8 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
cirros$ exit
stack$ ssh cirros@192.168.0.65 -i isbyeonkey.pem
$
6. Ubuntu Image 추가
stack$ mkdir images
stack$ cd images
stack$ wget http://smoser.brickies.net/ubuntu/ttylinux-uec/old/ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz
stack$ tar zxvfp ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz
stack$ source ~/devstack/openrc
stack$ glance image-create --name="tty-linux-kernel" --disk-format=aki --container-format=aki < ttylinux-uec-amd64-12.1_2.6.35-22_1-vmlinuz
stack$ glance image-create --name="tty-linux-ramdisk" --disk-format=ari --container-format=ari < ttylinux-uec-amd64-12.1_2.6.35-22_1-loader
stack$ glance image-create --name="tty-linux" --disk-format=ami --container-format=ami --property kernel_id=4cc59fd2-ecbb-4537-bd57-476665511c82 --property ramdisk_id=9423924a-d442-4c17-8b83-5a7abff04abf < ttylinux-uec-amd64-12.1_2.6.35-22_1.img
stack$ ssh root@10.0.0.3 -i isbyeonkey.pem
The authenticity of host '10.0.0.3 (10.0.0.3)' can't be established.
RSA key fingerprint is 45:df:23:ce:00:3c:9f:43:29:be:38:ba:e0:0c:52:ad.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.0.0.3' (RSA) to the list of known hosts.
Chop wood, carry water.
root# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 23.2M 16.9M 5.2M 76% /
devtmpfs 245.0M 0 245.0M 0% /dev
tmpfs 24.0K 0 24.0K 0% /dev/shm
7. RCB OpenStack Image
http://isbyeon.tistory.com/267
$ wget http://c250663.r63.cf1.rackcdn.com/centos60_x86_64.qcow2
$ glance image-create --name centos60_x86_64 --disk-format=raw --container-format=bare --file centos60_x86_64.qcow2
최근댓글