"Virtualization"의 두 판 사이의 차이
잔글 |
잔글 |
||
(같은 사용자의 중간 판 24개는 보이지 않습니다) | |||
1번째 줄: | 1번째 줄: | ||
− | 가상화 | + | Virtualization(가상화)을 정리 합니다. |
− | == 가상화 | + | == 가상화 인프라 == |
+ | *CPU 가상화 | ||
+ | :*VT (Virtualization Technology)를 지원하는 CPU | ||
+ | :*Intel-VT, AMD-V | ||
+ | |||
+ | *Windows에서 CPU가 VT를 지원하는지 확인하는 방법 | ||
+ | |||
+ | :*[http://www.intel.com/support/kr/processors/tools/piu/sb/cs-014921.htm Windows*용 인텔® 프로세서 식별 유틸리티 다운로드]에서 프로그램을 다운로드 합니다. | ||
+ | :*프로그램 실행 후, 아래 붉은 칸으로 표시된 부분을 확인 합니다. | ||
+ | |||
+ | [[File:VirtualizationIntel.png|700px|VirtualizationIntel.png]] | ||
+ | |||
+ | *Linux에서 CPU가 VT를 지원하는지 확인하는 방법 | ||
+ | |||
+ | grep --color vmx /proc/cpuinfo | ||
+ | grep --color svm /proc/cpuinfo | ||
+ | egrep '(vmx|svm)' --color=always /proc/cpuinfo | ||
+ | |||
+ | *CPU가 VT를 지원하는데 활성화 되어 있지 않은 경우 | ||
+ | |||
+ | :*Windows를 새로 기동하면서 F2 키를 눌러 BIOS 설정 화면을 표시 합니다. | ||
+ | :*SysInfo 탭에서 | ||
+ | |||
+ | CPU VT (VT-X) Supported | ||
+ | |||
+ | :*Advanced 탭에서 | ||
+ | |||
+ | Intel vPro Configuration | ||
+ | MEBx Entry Hot-Key [Disabled] | ||
+ | |||
+ | CPU VT (VT-x) [Enabled] | ||
+ | Intel VT-d [Enabled] | ||
+ | Intel TxT [Disabled] | ||
+ | |||
+ | == 가상화 기술의 종류 == | ||
− | <span style="color:#008000;"><span style="font-size:larger;">'''가상화 종류'''</span></span> | + | <span style="color:#008000;"><span style="font-size:larger;">'''가상화 기술의 종류'''</span></span> |
{| border="1" cellspacing="0" cellpadding="2" style="width: 100%;" | {| border="1" cellspacing="0" cellpadding="2" style="width: 100%;" | ||
|- | |- | ||
− | | style="text-align: center; background-color: rgb(241, 241, 241);" rowspan="1" colspan="2" | | + | | style="text-align: center; background-color: rgb(241, 241, 241);" rowspan="1" colspan="2" | 가상화 기술 |
| style="text-align: center; background-color: rgb(241, 241, 241);" | 상세 | | style="text-align: center; background-color: rgb(241, 241, 241);" | 상세 | ||
|- | |- | ||
20번째 줄: | 54번째 줄: | ||
|- | |- | ||
| | | | ||
− | Full Virtualization<br/> (전 가상화) | + | - Full Virtualization<br/> (전 가상화) |
| | | | ||
26번째 줄: | 60번째 줄: | ||
|- | |- | ||
− | | Para Virtualization<br/> (반 가상화)<br/> | + | | - Para Virtualization<br/> (반 가상화)<br/> |
| | | | ||
*Privileged 명령어(Hypercall)는 Hypervisor가 하드웨어로 명령을 수행 | *Privileged 명령어(Hypercall)는 Hypervisor가 하드웨어로 명령을 수행 | ||
66번째 줄: | 100번째 줄: | ||
− | <span style="color:#008000;"><span style="font-size:larger;">'''가상화 방식'''</span></span> | + | <span style="color:#008000;"><span style="font-size:larger;">'''Hypervisor별 가상화 방식'''</span></span> |
{| border="1" cellspacing="0" cellpadding="2" style="width: 100%;" | {| border="1" cellspacing="0" cellpadding="2" style="width: 100%;" | ||
|- | |- | ||
− | | style="text-align: center; background-color: rgb(241, 241, 241);" | < | + | | style="text-align: center; background-color: rgb(241, 241, 241);" | Hypervisor |
− | | style="text-align: center; background-color: rgb( | + | | style="text-align: center; background-color: rgb(241, 241, 241);" | 상세 |
+ | |- | ||
+ | | style="text-align: center;" | | ||
+ | KVM | ||
+ | |||
+ | VMware | ||
+ | |||
+ | | | ||
+ | *Full Virtualization | ||
+ | *VT (Virtualization Technology)를 지원하는 CPU가 필요함 | ||
+ | **HVM (Hardware Virtual Machine) | ||
+ | **Intel-VT, AMD-V | ||
+ | **ARM (Cortex-A 15 이후) | ||
+ | *현재는 Para Virtualization도 지원함 | ||
+ | |||
+ | |- | ||
+ | | style="text-align: center;" | Xen | ||
+ | | | ||
+ | *Para Virtualization | ||
+ | *현재는 Full Virtualization도 지원함 | ||
+ | |||
+ | |} | ||
+ | |||
+ | == Linux Namespace == | ||
+ | |||
+ | Linux에서 제공하는 lightweight 가상화 기술로 격리된 환경을 제공 합니다. | ||
+ | |||
+ | <span style="color:#006400;">'''Namespace 분류'''</span> | ||
+ | |||
+ | {| border="1" cellspacing="0" cellpadding="2" style="width:100%;" | ||
+ | |- | ||
+ | | style="text-align: center; width: 126px; background-color: rgb(153, 153, 153);" | <font color="#ffffff">분류</font> | ||
+ | | style="text-align: center; width: 640px; background-color: rgb(153, 153, 153);" | <span style="color:#FFFFFF;">상세</span> | ||
+ | |- | ||
+ | | style="text-align: center; width: 126px;" | UTS | ||
+ | | style="width: 640px;" | Hostname 분할 | ||
+ | |- | ||
+ | | style="text-align: center; width: 126px;" | IPC | ||
+ | | style="width: 640px;" | Process 분할 | ||
+ | |- | ||
+ | | style="text-align: center; width: 126px;" | PID | ||
+ | | style="width: 640px;" | PID (Process ID) 분할 | ||
+ | |- | ||
+ | | style="text-align: center; width: 126px;" | NS | ||
+ | | style="width: 640px;" | File system의 mount 지점 분할 | ||
+ | |- | ||
+ | | style="text-align: center; width: 126px;" | NET | ||
+ | | style="width: 640px;" | Network resource 분할<br/>사례) Global namespace에 veth0를 zzns namespace에 veth1을 만들어 통신을 합니다.<br/>ip netns add zzns #--- zzns Namespace 생성<br/>ip netns list zzna<br/>ip link add veth0 type veth peer name veth1 #--- veth0, veth1 Veth (Virtual Ethernet) 생성<br/>ip link list<br/>ip link set veth1 netns zzns #--- veth1을 zzns namespace에 추가<br/><span style="color:#0000CD;">'''ip netns exec'''</span> zzns ip link list<br/> | ||
|- | |- | ||
− | | style="text-align: center;" | | + | | style="text-align: center; width: 126px;" | USER |
− | | | + | | style="width: 640px;" | User와 Group ID 분할 |
|} | |} | ||
− | == CPU | + | <span style="color:#006400;">'''참고 문헌'''</span> |
+ | |||
+ | *[http://bluese05.tistory.com/11 http://bluese05.tistory.com/11] | ||
+ | *[http://www.joinc.co.kr/modules/moniwiki/wiki.php/man/12/NetworkNamespace http://www.joinc.co.kr/modules/moniwiki/wiki.php/man/12/NetworkNamespace] | ||
+ | *[[Docker|Docker]] : LXC (LinuX Container) | ||
+ | |||
+ | == Cgroups == | ||
+ | |||
+ | Linux Resource의 독점을 방지<br/>CPU, Memory, Block I/O, Network 등을 할당 | ||
+ | |||
+ | <span style="color:#006400;">'''Subsystem'''</span> | ||
+ | |||
+ | blkio – control/limit IO from block devices<br/>cpu - uses the kernels scheduler to control access to cpu resource<br/>cpuacct – reporting of cpu usage<br/>cpuset – assignment of cpu and memory nodes | ||
+ | |||
+ | *cpusets.cpus (mandatory) | ||
+ | *cpusets.mems (mandatory) | ||
+ | *others optional | ||
+ | |||
+ | devices – allow or deny device access<br/>freezer – suspend or resume tasks<br/>hugetlb – controls and reporting on hugepages<br/>memory – limit and report on memory usage by tasks<br/>net_cls – tags network packets with class id<br/>net_prio – by network interface set priority of network traffic<br/>ns – namespace subsystem | ||
+ | |||
+ | vi /etc/cgconfig.conf | ||
+ | <pre>mount { | ||
+ | cpuset = /cgroup/~; | ||
+ | } | ||
+ | group zzgroup { | ||
+ | cpu { ~ } | ||
+ | memory { ~ } | ||
+ | }</pre> | ||
+ | vi /etc/cgrules.conf | ||
+ | <pre>mount { | ||
+ | cpuset = /cgroup/cpuset; | ||
+ | cpu = /cgroup/cpu; | ||
+ | cpuacct = /cgroup/cpuacct; | ||
+ | memory = /cgroup/memory; | ||
+ | devices = /cgroup/devices; | ||
+ | freezer = /cgroup/freezer; | ||
+ | net_cls = /cgroup/net_cls; | ||
+ | blkio = /cgroup/blkio; | ||
+ | }</pre> | ||
+ | vi /usr/lib/systemd/system/~.service<br/>systemctl daemon-reload<br/>systemctl restart ~.service | ||
+ | |||
+ | service cgconfig start<br/>chkconfig cgconfig on | ||
+ | |||
+ | <span style="color:#006400;">'''Sample'''</span> | ||
+ | <pre>yum -y install libcgroup | ||
+ | mkdir -p /service_group | ||
+ | mount -t cgroup -o cpu,memory,nodev /service_group | ||
+ | cd /service_group | ||
+ | #--- cgcreate -g subsystem: path | ||
+ | cgcreate -g cpu,memory /service_group/web #--- cgroup 생성 | ||
+ | cgset -r cpuset.cpus='0,2,4,6,8,10,12,14' web #--- cgroup parameter 설정 | ||
+ | cgset -r cpuset.mems = '0' httpd #--- cgset -r parm=value cgroup_path | ||
+ | cgcreate -g cpu,memory /service_group/db | ||
+ | cgset -r cpuset.cpus='1,3,5,7,9,11,13,15' db | ||
+ | cgset -r cpuset.mems = '1' db | ||
+ | lscgroup -g cpu:/docker #--- Group 조회 | ||
+ | lssubsys ~ #--- Sussystem 조회 | ||
+ | cgget ~ #--- cgroup parameter 조회 | ||
+ | #--- cgexec -g subsystem:cgroup command | ||
+ | cgexec ~ #--- cgroup 정보를 가지고 process 시작 | ||
+ | #--- cgdelete [-r] subsystem: path | ||
+ | cgdelete | ||
+ | #--- cgclassify -g subsystem:cgroup pid | ||
+ | cgclassify #--- process를 cgroup에 할당 | ||
+ | cgsnapshot | ||
+ | systemd-cgls | ||
+ | systemd-cgtop | ||
+ | ps -eO cgroup | ||
+ | |||
+ | </pre> | ||
+ | <span style="color:#006400;">'''참고 문헌'''</span> | ||
+ | |||
+ | *[http://www.slideshare.net/sprdd/linux-performan-tuning-part-1 http://www.slideshare.net/sprdd/linux-performan-tuning-part-1] | ||
+ | *[https://share.confex.com/share/125/webprogram/Handout/Session17308/Managing%20Resources%20with%20cgroups.pdf https://share.confex.com/share/125/webprogram/Handout/Session17308/Managing%20Resources%20with%20cgroups.pdf] | ||
+ | |||
+ | == VLAN == | ||
+ | |||
+ | LAN : Local Area Network, L2 Switch로 연결된 network | ||
+ | |||
+ | Virtual LAN | ||
+ | |||
+ | <span style="color:#006400;">'''802.1Q Tagged VLAN'''</span> | ||
+ | |||
+ | <span style="line-height: 1.6;">IEEE 802.1Q VLAN</span> | ||
+ | |||
+ | 802.1Q Tagged port (Trunk port, Tagged link) | ||
+ | |||
+ | VLAN Tag : 4 bytes | ||
+ | |||
+ | *TRID : 16 bits : Tag Protocol Identifier (0x8100, 0x9100, 0x9200, ...) | ||
+ | *Priority : 3 bits : Priority levels (0 ~ 7) | ||
+ | *CFI : 1 byte : Cononical Fromat | ||
+ | **0 : canonical MAC | ||
+ | **1 : non-canonical MAC | ||
+ | *VID : 12 bytes : Unique VLAN identifier (0 ~ 4095) | ||
+ | **Reserved VID : 0, 4095 | ||
− | + | Ethernet Frame : [http://cafe.naver.com/neteg/80475 http://cafe.naver.com/neteg/80475] | |
− | : | + | <span style="color:#006400;">'''Untagged VLAN (Native VLAN)'''</span> |
− | |||
− | + | 가장 많은 Traffic이 있는 VLAN 트래픽에 Tag를 붙이지 않도록 하여 사용 | |
− | + | Tagged port에서 오직 한개만 사용 가능 | |
− | |||
− | + | <span style="color:#006400;">'''Access VLAN'''</span> | |
− | + | Switch 장비에서 VLAN 설정하는 방식으로<br/>Access port에 1개의 VLAN Tag를 지정해 주는 방식으로 동작 | |
− | + | Switch의 Access port별로 VLAN Tag가 지정이 되므로 untagged VLAN으로 동작 합니다. | |
− | + | <pre>? #--- 도움말 | |
− | + | conf t #--- configure terminal | |
+ | int range fa0/1-3 #--- port 1번에서 3번 지정 | ||
+ | switchport mode access | ||
+ | switchport access vlan 10 #--- VLAN Tag 지정 | ||
+ | exit | ||
+ | int range fa0/4-6 | ||
+ | switchport mode access | ||
+ | switchport access vlan 20 | ||
+ | exit | ||
+ | end | ||
− | + | show vlan brief</pre> | |
+ | <span style="color:#006400;">'''참고 문헌'''</span> | ||
− | : | + | *[http://m.blog.naver.com/goduck2/220218907545 http://m.blog.naver.com/goduck2/220218907545] |
− | : | ||
− | + | == VDI == | |
− | : | + | VDI (<span style="color: rgb(37, 37, 37); font-family: sans-serif; font-size: 13.3000001907349px; line-height: 21px;">Virtual Desktop Infrastructure)의 display protocol</span> |
− | + | *<span style="color: rgb(37, 37, 37); font-family: sans-serif; font-size: 13.3000001907349px; line-height: 21px;">RDP, RDP 7/8 for windows</span> | |
− | + | *<font color="#252525" face="sans-serif"><span style="font-size: 13.3000001907349px; line-height: 21px;">NX : for linux</span></font> | |
− | + | *<font color="#252525" face="sans-serif"><span style="font-size: 13.3000001907349px; line-height: 21px;">SPICE for linux, windows</span></font> | |
− | + | *<font color="#252525" face="sans-serif"><span style="font-size: 13.3000001907349px; line-height: 21px;">VNC</span></font> | |
− | |||
− | |||
== 참고 문헌 == | == 참고 문헌 == | ||
+ | *[[Virtual Appliance|Virtual Appliance]] | ||
*[http://pat.im/479 내 CPU가 가상화 기술(VT)을 지원하는지 알아보기, 2009.07] | *[http://pat.im/479 내 CPU가 가상화 기술(VT)을 지원하는지 알아보기, 2009.07] | ||
*[http://searchservervirtualization.techtarget.com/photostory/2240211915/Top-10-virtualization-companies-emerging-in-2014/2/CloudPhysics-infrastructure-analytics-defines-a-new-category#contentCompress Top 10 virtualization companies emerging in 2014] | *[http://searchservervirtualization.techtarget.com/photostory/2240211915/Top-10-virtualization-companies-emerging-in-2014/2/CloudPhysics-infrastructure-analytics-defines-a-new-category#contentCompress Top 10 virtualization companies emerging in 2014] | ||
+ | *[https://ovirtkorea.wordpress.com/ oVirt Korea User Group] | ||
[[Category:Virtual Appliance|Category: Virtual Appliance]]<br/>[[Category:Cloud|Category: Cloud]] | [[Category:Virtual Appliance|Category: Virtual Appliance]]<br/>[[Category:Cloud|Category: Cloud]] |
2015년 10월 30일 (금) 13:04 기준 최신판
Virtualization(가상화)을 정리 합니다.
가상화 인프라
- CPU 가상화
- VT (Virtualization Technology)를 지원하는 CPU
- Intel-VT, AMD-V
- Windows에서 CPU가 VT를 지원하는지 확인하는 방법
- Windows*용 인텔® 프로세서 식별 유틸리티 다운로드에서 프로그램을 다운로드 합니다.
- 프로그램 실행 후, 아래 붉은 칸으로 표시된 부분을 확인 합니다.
- Linux에서 CPU가 VT를 지원하는지 확인하는 방법
grep --color vmx /proc/cpuinfo grep --color svm /proc/cpuinfo egrep '(vmx|svm)' --color=always /proc/cpuinfo
- CPU가 VT를 지원하는데 활성화 되어 있지 않은 경우
- Windows를 새로 기동하면서 F2 키를 눌러 BIOS 설정 화면을 표시 합니다.
- SysInfo 탭에서
CPU VT (VT-X) Supported
- Advanced 탭에서
Intel vPro Configuration MEBx Entry Hot-Key [Disabled] CPU VT (VT-x) [Enabled] Intel VT-d [Enabled] Intel TxT [Disabled]
가상화 기술의 종류
가상화 기술의 종류
가상화 기술 | 상세 | |
서버 가상화 | Bare-metal Virtualization |
|
- Full Virtualization |
| |
- Para Virtualization (반 가상화) |
| |
Hosted Virtualization |
| |
데스크탑 가상화 |
| |
애플리케이션 가상화 |
| |
리소스 가상화 |
| |
|
Hypervisor별 가상화 방식
Hypervisor | 상세 |
KVM VMware |
|
Xen |
|
Linux Namespace
Linux에서 제공하는 lightweight 가상화 기술로 격리된 환경을 제공 합니다.
Namespace 분류
분류 | 상세 |
UTS | Hostname 분할 |
IPC | Process 분할 |
PID | PID (Process ID) 분할 |
NS | File system의 mount 지점 분할 |
NET | Network resource 분할 사례) Global namespace에 veth0를 zzns namespace에 veth1을 만들어 통신을 합니다. ip netns add zzns #--- zzns Namespace 생성 ip netns list zzna ip link add veth0 type veth peer name veth1 #--- veth0, veth1 Veth (Virtual Ethernet) 생성 ip link list ip link set veth1 netns zzns #--- veth1을 zzns namespace에 추가 ip netns exec zzns ip link list |
USER | User와 Group ID 분할 |
참고 문헌
- http://bluese05.tistory.com/11
- http://www.joinc.co.kr/modules/moniwiki/wiki.php/man/12/NetworkNamespace
- Docker : LXC (LinuX Container)
Cgroups
Linux Resource의 독점을 방지
CPU, Memory, Block I/O, Network 등을 할당
Subsystem
blkio – control/limit IO from block devices
cpu - uses the kernels scheduler to control access to cpu resource
cpuacct – reporting of cpu usage
cpuset – assignment of cpu and memory nodes
- cpusets.cpus (mandatory)
- cpusets.mems (mandatory)
- others optional
devices – allow or deny device access
freezer – suspend or resume tasks
hugetlb – controls and reporting on hugepages
memory – limit and report on memory usage by tasks
net_cls – tags network packets with class id
net_prio – by network interface set priority of network traffic
ns – namespace subsystem
vi /etc/cgconfig.conf
mount { cpuset = /cgroup/~; } group zzgroup { cpu { ~ } memory { ~ } }
vi /etc/cgrules.conf
mount { cpuset = /cgroup/cpuset; cpu = /cgroup/cpu; cpuacct = /cgroup/cpuacct; memory = /cgroup/memory; devices = /cgroup/devices; freezer = /cgroup/freezer; net_cls = /cgroup/net_cls; blkio = /cgroup/blkio; }
vi /usr/lib/systemd/system/~.service
systemctl daemon-reload
systemctl restart ~.service
service cgconfig start
chkconfig cgconfig on
Sample
yum -y install libcgroup mkdir -p /service_group mount -t cgroup -o cpu,memory,nodev /service_group cd /service_group #--- cgcreate -g subsystem: path cgcreate -g cpu,memory /service_group/web #--- cgroup 생성 cgset -r cpuset.cpus='0,2,4,6,8,10,12,14' web #--- cgroup parameter 설정 cgset -r cpuset.mems = '0' httpd #--- cgset -r parm=value cgroup_path cgcreate -g cpu,memory /service_group/db cgset -r cpuset.cpus='1,3,5,7,9,11,13,15' db cgset -r cpuset.mems = '1' db lscgroup -g cpu:/docker #--- Group 조회 lssubsys ~ #--- Sussystem 조회 cgget ~ #--- cgroup parameter 조회 #--- cgexec -g subsystem:cgroup command cgexec ~ #--- cgroup 정보를 가지고 process 시작 #--- cgdelete [-r] subsystem: path cgdelete #--- cgclassify -g subsystem:cgroup pid cgclassify #--- process를 cgroup에 할당 cgsnapshot systemd-cgls systemd-cgtop ps -eO cgroup
참고 문헌
- http://www.slideshare.net/sprdd/linux-performan-tuning-part-1
- https://share.confex.com/share/125/webprogram/Handout/Session17308/Managing%20Resources%20with%20cgroups.pdf
VLAN
LAN : Local Area Network, L2 Switch로 연결된 network
Virtual LAN
802.1Q Tagged VLAN
IEEE 802.1Q VLAN
802.1Q Tagged port (Trunk port, Tagged link)
VLAN Tag : 4 bytes
- TRID : 16 bits : Tag Protocol Identifier (0x8100, 0x9100, 0x9200, ...)
- Priority : 3 bits : Priority levels (0 ~ 7)
- CFI : 1 byte : Cononical Fromat
- 0 : canonical MAC
- 1 : non-canonical MAC
- VID : 12 bytes : Unique VLAN identifier (0 ~ 4095)
- Reserved VID : 0, 4095
Ethernet Frame : http://cafe.naver.com/neteg/80475
Untagged VLAN (Native VLAN)
가장 많은 Traffic이 있는 VLAN 트래픽에 Tag를 붙이지 않도록 하여 사용
Tagged port에서 오직 한개만 사용 가능
Access VLAN
Switch 장비에서 VLAN 설정하는 방식으로
Access port에 1개의 VLAN Tag를 지정해 주는 방식으로 동작
Switch의 Access port별로 VLAN Tag가 지정이 되므로 untagged VLAN으로 동작 합니다.
? #--- 도움말 conf t #--- configure terminal int range fa0/1-3 #--- port 1번에서 3번 지정 switchport mode access switchport access vlan 10 #--- VLAN Tag 지정 exit int range fa0/4-6 switchport mode access switchport access vlan 20 exit end show vlan brief
참고 문헌
VDI
VDI (Virtual Desktop Infrastructure)의 display protocol
- RDP, RDP 7/8 for windows
- NX : for linux
- SPICE for linux, windows
- VNC