4. 2011 Korea Community Day
하지만 역시 복습은 중요...
• OpenStack = {Cloud Operating System}
∩ {Open Source SW} ∩ {Community}
• OpenStack ∋ {Nova, Swift, Glance,
Keystone, Dashboard}
• 추가 복습은 www.openstack.or.kr 에서 하세요
11년 12월 5일 월요일
5. 2011 Korea Community Day
다시 오늘의 주제로...
• OpenStack Compute (필수전공)
• Nova라고 불림
• Public/Private Cloud Infra Service를
만들어 줄 수 있음
11년 12월 5일 월요일
6. 2011 Korea Community Day
무엇을 만든다구요?
Connects to apps via APIs Self-service Portals for users
USERS ADMINS
APPS
CLOUD OPERATING SYSTEM
Control Automates E ciently allocate resources
Pools of Resources
Compute Pool Storage Pool Network Pool
Virtualized Virtualized Virtualized
Servers Storage Networks
11년 12월 5일 월요일
7. 2011 Korea Community Day
앞으로 나올 내용들...
• OpenStack Compute 기능모듈
• OpenStack Compute Architecture
• OpenStack Compute Deployment
• OpenStack Compute 활용하기
11년 12월 5일 월요일
8. 2011 Korea Community Day
앞으로 나올 내용들...
• OpenStack Nova 기능모듈
• OpenStack Nova Architecture
• OpenStack Nova Deployment
• OpenStack Nova 활용하기
11년 12월 5일 월요일
9. 2011 Korea Community Day
OpenStack Nova 모듈
Pluggable
- simple (least-load)
- chance (random)
- distributed scheduler (zone-
aware) - QEMU, KVM, UML, LXC
* host-filter - Xen and XenServer
* least-cost function - Hyper-V
- resource (capability) aware - VMware vSphere
scheduler
- Flat, FlatDHCP, Vlan
- IPv4 / IPv6
- WSGI middleware
- EC2/OpenStack API
- Keystone/standalone auth
- Local LVM volume groups - Sqlite
- iSCSI - MySQL
- Sheepdog - Postgres
- HP/Lefthand SANs P
-
-
11년 12월 5일 월요일 P
10. 2011 Korea Community Day
System Architecture
Web UI Volume
Volume
Storage
(Dashboard) Worker (iSCSI
OpenStack Network
API
Identity Queue Worker
local
(keystone) API서버 method
middleware
EC2 API
REST Compute
Scheduler Worker
REST
User
(CLI, REST)
REST
Image
Image Store
(Local, Swift, Service
AWS S3 etc) (Glance)
11년 12월 5일 월요일
11. 2011 Korea Community Day
OpenStack Glance (Image)
1. 1. Store retrieve VM images
VM image를 저장/가져오기
2. REST기반 API
2. REST-based API
3. Compatible with all common image formats
3. 대다수의 이미지 포맷들과 호환가능
4. Storage 스토리지 Store 지원 locally, or use
4. 다양한 agnostic: 방식 images
- 로칼 OpenStack Object Storage, HTTP, or S3
스토리지
- Http, AWS S3, OpenStack Swift
11년 12월 5일 월요일
12. 2011 Korea Community Day
가상서버 생성 과정
response
to client compute node가 instance data를 받아서
DB 업데이트하고, block device를 준비함 compute node가 network node가
Client 새로운 instance를 위해 필요한
네트워크 리소스를 준비
Client가 “생성” 메세지를 HTTP를 통해 compute (allocate_fixed_ip) 하도록
/servers/create로 보냄 queue에 message를 넣는다.
queue message rpc.call
nova-api
queue message network
rpc.cast method “run_instance”
API가 create_instance()를 호출, queue message
parameter조회, DB entry등록 한 후에
compute node가 volume
scheduler에게 인계 scheduler 노드를 호출하여 volume
compute 생성 및 attach 진행
scheduler가 instance가 위치할 compute node을 (volume)
선정한 후에, 해당 node의 queue에 생성작업을 iptables를 통한 network
하도록 메세지를 넣는다. filtering (firewall), 그리고
(API가 요청한 data를 return함) image creation.
hypervisor API
RETURN
hypervisor API를 통해
hypervisor/ VM spawning;
nova-api Compute libvert 최종적으로 VM을 부
팅함.
RETURN
11년 12월 5일 월요일
13. 2011 Korea Community Day
Network 구조 (Overview)
• Flat Mode
모든 instance가 하나의 bridge에 연결되어 고정 IP를 부여받음.
• Flat DHCP Mode
Flat Mode와 동일.
Ethernet device (‘eth0’)이 bridge가 되며 Instance는 ‘dhcpdiscover’로
‘dnsmasq로부 IP를 할당 받음
• VLAN DHCP mode
자신의 instance를 public영역에 노출 시키지 않고, VPN을 통해 접근 가능.
프로젝트별로 VLAN과 bridge를 생성 (프로젝트는 private ip대역을 얻음)
Instance는 해당 프로젝트가 할당받은 private ip중 하나를 받음.
11년 12월 5일 월요일
15. 2011 Korea Community Day
어떻게 생겼는지 알았으면
이제 써봐야죠!
• OpenStack Nova Deployment
• OpenStack Nova 활용하기
11년 12월 5일 월요일
16. 2011 Korea Community Day
Nova Deployment 단계
시스템 설계
리소스 파악, Nova 구성요소 배치, 네트워크 구성
INSTALLATION
Nova 구성요소, Glance
CONFIGURATIONS
nova.conf 생성, Path 설정, 네트워크 설정
실행
서비스 동작 확인, 이미지 생성, 가상머신 생성, Volume
서버 추가
Nova 구성요소 추가
11년 12월 5일 월요일
17. 2011 Korea Community Day
Nova 설치
1 Package를 이용한 설치
# add-apt-repository ppa:nova-core/trunk
# apt-get install nova-common nova-api nova-network nova-scheduler nova-compute
OpenStack 개발자들이 만든 스크립트, Nova 뿐 아
2 Script를 이용한 설치
니라 Glance, Keystone등의 설치를 한 번에 진행
http://devstack.org/
# git clone git://github.com/cloudbuilders/devstack.git
# cd devstack
# ./stack.sh
3 Source Code를 이용한 설치 Manual Configuration
http://wiki.openstack.or.kr
# git clone https://github.com/openstack/nova.git
# ./nova/contrib/nova.sh
★ 설치 결과: 커맨드라인에서 Nova 실행파일들을 실행할 수 있는 상태
11년 12월 5일 월요일
18. 2011 Korea Community Day
Nova deployment
on Virtual Environment
• 자동화된 deployment 및 Configuration은 효과적인 대규
모 deployment를 위한 필수조건. 이는 CI (Continuous
Integration)과 Testing을 위해서도 반드시 필요.
• 하지만, 클라우드 시스템을 위한 deployment나
integration test는 많은 서버리소스를 필요로 하며, 많은
dependency들이 존재함.
➜ 실제 적용 전 가상화 환경에서 구축하고 테스트 하는
방법이 필요
11년 12월 5일 월요일
19. 2011 Korea Community Day
어떤 툴들이 사용되는가?
• VirtualBox는 가상화 소프트웨어
(www.virtualbox.org)
• Vagrants는 가상화된 개발/테스트 환경을 자동
으로 구축할 수 있게 해주는 툴 (vagrantup.com)
• Chef은 인프라 구축 및 Configuration을 자동화
해주는 오픈소스 system integration
framework (www.opscode.com)
11년 12월 5일 월요일
21. 2011 Korea Community Day
Chef 구성
• Chef Client는 타겟서버에서 작동.
• Client가 Chef Server와 연동.
• 설정하고자 하는 시스템을 Node라 하며,
• 각 Node는 룰(역할) 설정이 가능 (webserver, database,
monitoring, etc)
• Chef은 Node상에 리소스들을 관리
• Resources는 타입, 이름, 파라메터를 가지며 Action을 취할 수 있
음.
• Recipes 는 리소스들의 리스트.
• Cookbook은 Recipes, Files, Templates, Attributes, Metadata를 조
합한 패키지.
- 배포의 기본 단위이며,
- community.opscode.com에서 많이 얻을 수 있음.
11년 12월 5일 월요일
22. 2011 Korea Community Day
CloudBuilder Ver.
무엇을 해야 하나요?
• Install VirtualBox Grab the nova code
#
curl
-‐OL
http://download.virtualbox.org/virtualbox/4.1.0/VirtualBox-‐4.1.0-‐73009-‐OSX.dmg
#
open
VirtualBox-‐4.1.0-‐73009-‐OSX.dmg
#
cd
~
#
mkdir
bzr
#
cd
bzr
#
bzr
init-‐repo
.
#
bzr
branch
lp:nova
trunk
• Install RubyGems Vagrant
• Get the Chef Recipes
• Get the chef-solo Vagrant file
참고: vagrant를 provisioning하기위해서 chef-solo, chef-server,
chef, 혹은 puppet 사용이 가능하다. 여기서는 가장 simple한 chef-
solo를 사용한다.
11년 12월 5일 월요일
23. 2011 Korea Community Day
Install RubyGems Vagrant
Mac OSX
1) Simple Easy Built-in Install
#
sudo
gem
update
-‐-‐system
#
sudo
gem
install
vagrant
2) via MacPorts
Install MacPorts (you need XCode Installed) - www.macports.org
#
sudo
port
install
ruby
rb-‐rubygems
#
sudo
gem
update
-‐-‐system
#
sudo
gem
install
vagrant
Ubuntu
#
sudo
gem
install
vagrant
#
sudo
ln-‐s
/var/lib/gems/1.8/bin/vagrant
/usr/local/bin/vagrant
11년 12월 5일 월요일
24. 2011 Korea Community Day
CloudBuilder Ver.
Get the Chef Cookbook
#
export
COOKBOOKS=~/openstack-‐cookbooks
#
git
clone
https://github.com/cloudbuilders/openstack-‐
cookbooks.git
$COOKBOOKS
Setup Directories
$
mkdir
aptcache
$
mkdir
-‐p
vagrant/dev
$
cd
vagrant/dev
Get chef-solo Vagrant file
$
curl
-‐o
Vagrantfile
https://raw.github.com/gist/786945/
source.rb
참고: vagrant를 provisioning하기위해서 chef-solo, chef-server, chef, 혹은 puppet 사용
이 가능하다.
11년 12월 5일 월요일
25. 2011 Korea Community Day
Running Nova within a
Vagrant instance
$
vagrant
up
3-10 분 정도 소요
$
vagrant
ssh
$
.
/vagrant/novarc
$
euca-‐add-‐keypair
test
test.pem
$
chmod
600
test.pem
$
euca-‐run-‐instance
-‐t
m1.tiny
-‐k
test
ami-‐tty
boot 되기를 기다린 후에,
$
ssh
-‐i
test.pem
root@10.0.0.3
Instance가 OpenStack Nova상에서 생성되었고, Nova자체는 VirtualBox의 VM상에서
돌아가는 형태로 구성.
11년 12월 5일 월요일
26. 2011 Korea Community Day
System 지우기
$
vagrant
destroy
$
rm
*.pem
novarc
• VirtualBox Vagrant Chef 조합을 사용하여,
원하는 구조와 셋팅으로 시스템을 손쉽게 구축하고 없애는
것이 가능함으로써, Continuous Integration이나 System
Testing에 유용하게 활용이 가능.
(참고) 현재 essex milestone-1 이 나온 이후로, 오류가 발생하
고 있습니다. vagrant와 chef에 관심있으신 분들은 커뮤니티로
오셔서 같이 해결해보시죠. :)
11년 12월 5일 월요일
27. 2011 Korea Community Day
Nova 활용하기
• WebUI
• Dashboard
• 한국커뮤니티 공개개발프로젝트
- NIPA의 공개SW커뮤니티 지원사업으로 개발
- www.openstack.or.kr을 통한 소스 공개 및 커뮤니티 프로젝트화
11년 12월 5일 월요일