2. Resource on OpenStack
• OpenStack은 Compute node의 자원으로 Instance의 자원을 할당
• OpenStack의 자원관련
1. Quata – 사용자별 사용가능한 논리적 자원
2. Flavors – 인스턴스 생성 단위
3. Over Commit – 가상화 기술로 물리적 리소스를 뻥튀기해서 사용할 수 있는 논리적 자원을 지원하는 기능
3. OpenStack Quota
• Quatas are operational limits.
• 각 Tenant 별로 클라우드 자원을 최대한 활용하기 위한 개념
• Tenant와 Tenant User 레벨에서의 논리적 개념
• Quota management for the Other Service
- OpenStack Compute Service
- OpenStack Block Storage Service
- OpenStack Networking Service
• 일반적으로 Quota는 Compute node에서 Tenant가 10개 이상의 volume 또는 1TB를 필요로 할때,
default 설정을 변경
▼ OpenStack DashBoard – Quotas Usage
4. OpenStack Quota
• Manage Compute Service Qoutas
nova quota-* 라는 명령으로 management
# to view&update qouta values for an existing tenant
$ nova quota-defaults
$ nova quota-class-update --key value default
$ nova quota-class-update --instances 15 default
$ tenant=$(keystone tenant-list | awk '/tenantName/ {print $2}')
$ nova quota-show --tenant $tenant
$ tenant=$(keystone tenant-list | awk '/tenantName/ {print $2}')
$ nova quota-update --quotaName quotaValue tenantID
$ nova quota-update --floating-ips 20 $tenant
$ nova quota-show --tenant $tenant
$ nova help quota-update
5. OpenStack Quota
• Manage Compute Service Qoutas
# to view$update qouta values for an existing tenant user
“nova absolute-lismits” 명령은 현재 quota 값과 사용현황을 확인할 때 사용
$ nova absolute-limits --tenant tenantName
$ tenant=$(keystone tenant-list | awk '/tenantName/ {print $2}')
$ nova quota-show --user $tenantUser --tenant $tenant
$ nova quota-update --user $tenantUser --quotaName quotaValue $tenant
$ nova quota-update --user $tenantUser --floating-ips 12 $tenant
$ nova quota-show --user $tenantUser --tenant $tenant
6. OpenStack Quota
• Manage Compute Service Qoutas – default Quotas
▲ Compute Quota description
Quota name Description
cores Number of instance cores (VCPUs) allowed per tenant.
fixed-ips
Number of fixed IP addresses allowed per tenant. This number m
ust be equal to or greater than the number of allowed instances.
floating-ips Number of floating IP addresses allowed per tenant.
injected-file-content
-bytes
Number of content bytes allowed per injected file.
injected-file-path-by
tes
Length of injected file path.
injected-files Number of injected files allowed per tenant.
instances Number of instances allowed per tenant.
key-pairs Number of key pairs allowed per user.
metadata-items Number of metadata items allowed per instance.
ram Megabytes of instance ram allowed per tenant.
security-groups Number of security groups per tenant.
security-group-rules Number of rules per security group.
7. OpenStack Quota
• Manage Compute Service Qoutas – default Quotas on DashBoard
1. 관리자로 로그인
2. 관리자
3. 시스템패널
4. 시스템정보
5. 기본 Qoutas
1
2
4
3
5
8. OpenStack Quota
• Manage Compute Service Qoutas - test
- 설정한 Quotas 스펙에서 over되는 동작을 시도하면 오류메시지 출력과 함께 해당 작업이 수행되지 않음
- 설정한 Quotas 스펙에서 꽉 찼을경우, 버튼이 disable 되어 더 이상의 인스턴스 생성이 불가능함
9. OpenStack Quota
• Manage Block Storage Service Qoutas
cinder quota-* 라는 명령으로 management
▼ Block Storage Quotas
# to view qouta values
$ cinder quota-defaults TENANT_ID
$ cinder quota-show TENANT_NAME
$ cinder quota-usage tenantID
roperty name Defines the number of
gigabytes Volume gigabytes allowed for each tenant.
snapshots Volume snapshots allowed for each tenant.
volumes Volumes allowed for each tenant.
10. OpenStack Quota
• Manage Block Storage Service Qoutas
# to edit & update qouta values
1. Clear per-tenant quota limits
$ cinder quota-delete tenantID
2. for a new project
/etc/cinder/cinder.conf, “quota” section
3. for a exsiting tenant
$ tenant=$(keystone tenant-list | awk '/tenantName/ {print $2}')
$ cinder quota-update --quotaName NewValue tenantID
$ cinder quota-update --volumes 15 $tenant
$ cinder quota-show tenant01
◀ /etc/cinder/cinder.conf
11. OpenStack Quota
• Manage Netwoking Service Qoutas
1. Basic quota configuration
2. Configure per-tenant quotas
Basic quota configuration
: all tenants have the same quota values
▼ neutron.conf
12. OpenStack Quota
• Manage Netwoking Service Qoutas
Configure per-tenant quotas
1. Set the quota_driver option in the neutron.conf
quota_driver = neutron.db.quota_db.DbQuotaDriver
(이 설정을 해주면 command API를 사용할 수 있음)
2. quotas extension
# to list the Networking extension & show information for quotas extension
$ neutron ext-list -c alias -c name
$ neutron ext-show quotas
$ neutron quota-list
$ neutron quota-show --tenant_id 6f88036c45344d9999a1f971e4882723
$ neutron quota-show
14. OpenStack Flavors
• Nova Computing Instance들에게 할당되는 사용가능한 하드웨어의 크기를 설정 (가상 하드웨어의 템플릿 정의)
• Instance가 생성될때 “size”로 정의
▲ default Flavors
Flavor VCPUs Disk (in GB) RAM (in MB)
m1.tiny 1 1 512
m1.small 1 20 2048
m1.medium 2 40 4096
m1.large 4 80 8192
m1.xlarge 8 160 16384
15. OpenStack Flavors
• 최적의 Flavor (예시)
물리 자원 : 4cores, 60GB memory
1. cpu HyperThreading 지원 시로 가정 : 4cores * 2 = 8cores vCPU
2. ram 60GB(사실은 60GB – 오버헤드GB값) = 8cores * 7.5GB (ram 7.5GB per core)
3. overcommit : (default 1:16)
- 8cores * 16 = 64cores
- 7.5GB / 16 = 480MB
64 vCPU, 480MB per VM
Nice Flavors
: 64 vCPU, RAM 60GB(480MB per vCPU), local storage 10GB
1vCPU / 480MB / 10GB(small) ◀ default(Basic)
2vCPU / 960MB / 20GB(medium)
4vCPU / 1.8GB / 40GB(large)
8vCPU / 3.6GB / 80GB(extra large)
16vCPU / 7.2GB / 160GB(extra extra large)
16. OpenStack Flavors
# Create a flavor
$ nova flavor-list
$ nova flavor-create FLAVOR_NAME FLAVOR_ID RAM_IN_MB ROOT_DISK_IN_GB NUMBER_OF_VCPUS
$ nova flavor-create --is-public true m1.extra_tiny auto 256 0 1 --rxtx-factor .1
$ nova help flavor-create
$ nova flavor-access-add FLAVOR TENANT_ID
# Delete a flavor
$ nova flavor-delete FLAVOR_ID
17. OpenStack OverCommit
• Compute nodes에서 CPU와 RAM에 대한 overcommit을 지원
• 인스턴스들에게 물리적자원보다 더 많은 자원을 할당 할 수 있음
• OpenStack 클라우드 환경에서 Instance들의 퍼포먼스 감소를 허용하고 많은 수의 인스턴스들을 운용할 수 있음
▼ default overcommit
CPU allocation ratio – 16:1
RAM allocation ratio – 1.5:1
DISK allocation ratio – 1:1
• Compute node에서의 생성 가능한 instance의 수
(OR * PC) / VC
OR - CPU overcommit ratio(virtual cores per physical core)
PC - Number of physical cores
VS – Number of cores per instances
18. OpenStack OverCommit
• nova.conf (*-allocation-ratio)
cpu_allocation_ratio = 16.0
ram_allocation_ratio = 1.5
disk_allocation_ratio = 1.0
• Overcommit & Nova Scheduler
- Overcommit은 Nova Scheduler에서 관리
- Scheduler는 Filter라는 개념으로 Scheduling을 수행
OverCommit과 관련한 Filter
CoreFilter (cpu_allocation_ratio)
RamFilter (ram_allocation_ratio
DiskFilter (disk_allocation_ratio)
• Configure
CPU overcommitting ^2로 사용 (1:2, 1:4, 1:8 …)
RAM overcommitting 메모리 overcommitting은 사용하지 않는 것을 추천 memory o
Disk overcommitting 사용을 추천하지 않음
19. • OverCommit 고려사항
OpenStack 레벨에서의 overcommitting
KVM 레벨에서의 overcommitting
libvirt 레벨에서의 overcommitting
• 간단 Test
▲ OpenStack DashBoard
메모리 over : OverCommit된 메모리 23GB를 넘기자 인스턴스 생성시, 오류가 발생
OpenStack OverCommit
22. OpenStack OverCommit
• 예외사항 및 참고
http://docs.fedoraproject.org/en-US/Fedora/13/html/Virtualization_Guide/sect-Virtualization-Tips_and_tricks-
Overcommitting_with_KVM.html
https://doc.opensuse.org/products/draft/SLES/SLES-kvm_sd_draft/book.kvm.html
http://serverascode.com/2013/02/20/overcommitting-with-kvm.html
23. OpenStack Scheduling & Filter
• Compute는 nova-scheduler를 사용하여 compute 및 volume서비스를 수행
• 여러가지 옵션이 있음
▲ nova
24. OpenStack Scheduling & Filter
• Scheduler - Nova-scheduler는 Queue와 central DB를 통하여 다른 nova component들과 통신
• Queue
- Queue는 scheduling에 있어 필수적임
- 주기적으로 모든 compute node는 nova-scheduler에서 가용자원 및 하드웨어 사양에 대해 Queue를 통해 전달
- Compute Scheduler는 Filter Scheduler의 configure를 진행
AvailabilityZoneFilter
– Are in the requested availability zone
RamFilter
– Have sufficient RAM available
ComputeFilter
– capable of servicing the reqquest
Nova VM Provisioning ▶
• Filter Schedulter - Filtering과 weighting으로 새 인스턴스가 생성 될 수 있도록 하는 정보를 만듬
25. OpenStack Scheduling & Filter
• Filtering & Weights
- 필터 속성을 사용하여 Filtering을 수행
- 표준 필터 클래스 (nova.scheduler.filters)
- Filter Scheduler는 weights hosts 베이스로 동작하며 scheduler_weight_classe 옵션을 configure
* Weights hosts Base : RamWeigher 큰 weight인 호스트가 우선
- 반복적인 filtering과 weighting을 찾는 일은 리소스가 들어가므로 이를 적절히 조절하는 기능도 있음
- Filter Algorithm을 직접 만들어 적용 할 수 있음