엮음 5.8
1801 Varsity Drive
Raleigh, NC 27606-2072 USA
Phone: +1 919 754 3700
Phone: 888 733 4281
Fax: +1 919 754 3701
ftpd
고정폭 굵은체
현재 작업 중인 디렉토리에 있는my_next_bestselling_novel
파일 내용을 확인하려면, 쉘 프롬프트에서cat my_next_bestselling_novel
명령을 입력하고 Enter 키를 눌러 명령을 실행합니다.
Enter 키를 눌러 명령을 실행합니다.Ctrl+Alt+F2을 눌러 첫번째 가상 터미널로 전환합니다. Ctrl+Alt+F1을 눌러 X-윈도우 세션으로 돌아갑니다.
고정폭 굵은체
로 나타나게 됩니다. 예:
파일 관련 클래스에는 파일 시스템의 경우filesystem
, 파일의 경우file
, 디렉토리의 경우dir
가 포함됩니다. 각각의 클래스에는 자체의 권한 설정이 있습니다.
주 메뉴 바에서 마우스 기본 설정을 시작합니다. 버튼 탭에서, 왼손 잡이 마우스 체크 상자를 선택하고 를 클릭하여 주요 마우스 버튼을 왼쪽에서 오른쪽으로 전환합니다 (왼손 잡이일 경우 보다 적절하게 마우스 사용을 할 수 있게 함).→ → 를 선택하여gedit 파일에 특수 문자를 삽입하려면, 주 메뉴 바에서 → → 를 선택합니다. 다음으로 글자 표에서 → 를 선택하고, 검색란에 글자 이름을 입력한 후 버튼을 클릭합니다. 찾으려는 글자가 글자 표에 표시되면, 이를 더블 클릭하여 복사할 글자란에 위치하게 한 후, 버튼을 클릭합니다. 그 후 문서로 다시 돌아와서 gedit 메뉴 바에서 → 를 선택합니다.
고정폭 굵은 이텔릭체
또는 가변폭 굵은 이텔릭체
ssh를 사용하여 원격 컴퓨터에 연결하려면, 쉘 프롬프트에ssh
을 입력합니다. 원격 컴퓨터가username
@domain.name
example.com
이고 사용자 이름이 john일 경우,ssh john@example.com
을 입력합니다.mount -o remount
명령은 지정한 파일 시스템을 다시 마운트합니다. 예를 들어,file-system
/home
파일 시스템을 다시 마운트하려면mount -o remount /home
명령을 사용합니다.현재 설치된 패키지 버전을 보려면,rpm -q
명령을 사용합니다. 그러면 다음과 같은 값이 출력됩니다:package
.
package-version-release
Publican은 DocBook 발행 시스템입니다.
mono-spaced roman
에 설정되어 다음과 같이 나타납니다:
books Desktop documentation drafts mss photos stuff svn books_tests Desktop1 downloads images notes scripts svgs
mono-spaced roman
에 설정되지만, 다음과 같이 구문 강조가 추가되어 있습니다:
package org.jboss.book.jca.ex1; import javax.naming.InitialContext; public class ExClient { public static void main(String args[]) throws Exception { InitialContext iniCtx = new InitialContext(); Object ref = iniCtx.lookup("EchoBean"); EchoHome home = (EchoHome) ref; Echo echo = home.create(); System.out.println("Created Echo"); System.out.println("Echo.echo('Hello') = " + echo.echo("Hello")); } }
5
.
NFS
, FTP
또는 HTTP
프로토콜을 사용하는 네트워크를 통해 사용 가능한 Red Hat Enterprise Linux 5 설치 트리가 필요합니다.
/var/lib/libvirt/images/
directory by default. If you use a different directory you must label the new directory according to SELinux policy. Refer to 18.2절. “SELinux 및 가상화 ” for details.
yum
으로 Xen 하이퍼바이저 설치 for more information.
grub.conf
file.
virtio
드라이버를 사용하는 반가상화 장치는 PCI 장치입니다. 현재 게스트는 최대 32 개의 PCI 장치로 제한되어 있습니다. 일부 PCI 장치는 게스트 실행을 위해 중요하며 이러한 장치는 제거될 수 없습니다. 기본값으로 필요한 장치는 다음과 같습니다:
fstab
file, the initrd
file or used by the kernel command line. If less privileged users, especially virtualized guests, have write access to whole partitions or LVM volumes the host system could be compromised.
/dev/sdb
). Virtualized guests with access to block devices may be able to access other block devices on the system or modify volume labels which can be used to compromise the host system. Use partitions (for example, /dev/sdb1
) or LVM volumes to prevent this issue.
phy
장치 수에 제한을 갖지 않습니다.
/etc/modprobe.conf
에서 다음 행을 추가합니다: /etc/rc.local
파일을 편집하고 다음의 행을 추가합니다:
options loop max_loop=64
# rmmod loop # modprobe loop
yum
명령 및 Red Hat Network (RHN)를 사용하여 설치할 수 있습니다.
virt-manager
, libvirt
, virt-viewer
및 설치를 위한 모든 종속 패키지를 선택합니다.
패키지 사용자 정의 (필요 시)
%packages
부분에 다음의 패키지 그룹을 추가합니다:
%packages @xen
xen-ia64-guest-firmware
rhn_register
명령을 실행하고 프롬프트를 따릅니다.
yum
으로 Xen 하이퍼바이저 설치 xen
및 kernel-xen
패키지가 필요합니다. xen
패키지에는 하이퍼바이저 및 기본 가상화 도구가 들어 있습니다. kernel-xen
패키지에는 하이퍼바이저에서 가상 장치 게스트로서 실행되는 수정된 리눅스 커널이 들어 있습니다.
xen
및 kernel-xen
패키지를 설치하려면 다음을 실행합니다:
# yum install xen kernel-xen
xen-ia64-guest-firmware
)를 필요로 합니다. 이러한 패키지는 yum
명령을 사용하여 RHN에서 설치될 수 있습니다:
# yum install xen-ia64-guest-firmware
python-virtinst
virt-install
명령을 제공합니다.
libvirt
libvirt
는 하이퍼바이저와 상호 작용하기 위한 API 라이브러리입니다. libvirt
는 가상 장치를 관리하기 위해 xm
가상화 프레임워크 및 virsh
명령행 도구를 사용합니다.
libvirt-python
libvirt
API가 제공하는 인터페이스를 사용하기 위해 Python 프로그래밍 언어에 쓰인 어플리케이션을 허용하는 모듈이 들어 있습니다.
virt-manager
virt-manager
는 가상 장치를 관리하기 위한 그래픽 도구를 제공합니다. 이는 관리 API로서 libvirt
라이브러리를 사용합니다.
# yum install virt-manager libvirt libvirt-python python-virtinst
virt-manager
, libvirt
, virt-viewer
를 선택합니다.
패키지 사용자 정의 (필요 시)
%packages
부분에 다음의 패키지 그룹을 추가합니다:
%packages @kvm
rhn_register
명령을 실행하고 프롬프트를 따릅니다.
yum
으로 KVM 하이퍼바이저 설치 kvm
패키지가 필요합니다. kvm
패키지에는 기본값 Red Hat Enterprise Linux 커널에서 KVM 하이퍼바이저를 제공하는 KVM 커널 모듈에 들어 있습니다.
kvm
패키지를 설치하려면 다음을 실행합니다:
# yum install kvm
python-virtinst
virt-install
명령을 제공합니다.
libvirt
libvirt
는 하이퍼바이저와 상호 작용하기 위한 API 라이브러리입니다. libvirt
는 가상 장치를 관리하기 위해 xm
가상화 프레임워크 및 virsh
명령행 도구를 사용합니다.
libvirt-python
libvirt
API가 제공하는 인터페이스를 사용하기 위해 Python 프로그래밍 언어에 쓰인 어플리케이션을 허용하는 모듈이 들어 있습니다.
virt-manager
virt-manager
는 가상 장치를 관리하기 위한 그래픽 도구를 제공합니다. 이는 관리 API로서 libvirt
라이브러리를 사용합니다.
# yum install virt-manager libvirt libvirt-python python-virtinst
virt-install
를 사용하여 게스트를 생성할 수 있습니다. 다음 부분에서는 두 가지 방식 모두를 설명합니다.
virt-install
명령을 사용하여 명령행에서 가상 게스트를 생성할 수 있습니다. virt-install
은 가상 장치를 자동 생성하기 위해 상호 대화식이나 스크립트식으로 사용될 수 있습니다. 킥스타트 파일로 virt-install
을 사용할 경우 가상 장치가 무인 설치될 수 있습니다.
virt-install
도구는 명령행에 전달할 수 있는 여러 옵션을 제공합니다. 옵션의 전체 목록을 보려면 다음을 실행합니다:
$ virt-install --help
virt-install
맨 페이지에는 각 명령 옵션 및 중요한 변수에 대해 설명되어 있습니다.
qemu-img
는 저장 장치 옵션을 설정하기 위해 virt-install
전에 사용할 수 있는 관련 명령입니다.
--vnc
option which opens a graphical window for the guest's installation.
rhel3support
라는 Red Hat Enterprise Linux 3 게스트를 생성합니다. 예에서는 KVM 하이퍼바이저를 사용합니다.
# virt-install --accelerate --hvm --connect qemu:///system \ --network network:default \ --name rhel3support --ram=756\ --file=/var/lib/libvirt/images/rhel3support.img \ --file-size=6 --vnc --cdrom=/dev/sr0
# virt-install --name fedora11 --ram 512 --file=/var/lib/libvirt/images/fedora11.img \ --file-size=3 --vnc --cdrom=/var/lib/libvirt/images/fedora11.iso
virt-manager
는 가상 게스트 생성 및 관리를 위한 그래픽 형식 도구입니다.
Open virt-manager
virt-manager
. Launch the application from the menu and submenu. Alternatively, run the virt-manager
command as root.
Optional: Open a remote hypervisor
Create a new guest
New guest wizard
Name the virtual machine
Choose virtualization method
kernel-xen
이 현재 실행 중인 커널이 아닐 경우 반가상화 옵션은 회색으로 표시되게 됩니다.
Select the installation method
.iso
file).
HTTP
, FTP
or NFS
.
HTTP
, FTP
or NFS
. The installation media URL must contain a Red Hat Enterprise Linux installation tree. This tree is hosted using NFS
, FTP
or HTTP
.
Installation media selection
ISO image or physical media installation
Network install tree installation
NFS
, FTP
or HTTP
. Optionally, a kickstart file can be specified to automated the installation. Kernel parameters can also be specified if required.
Network boot (PXE)
Storage setup
/var/lib/libvirt/images/
directory by default. In the default configuration, other directory locations for file-based images are prohibited by SELinux. If you use a different directory you must label the new directory according to SELinux policy. Refer to 18.2절. “SELinux 및 가상화 ” for details.
/var/lib/libvirt/images/
. If you are using a different location (such as /images/
in this example) make sure it is added to your SELinux policy and relabeled before you continue with the installation (later in the document you will find information on how to modify your SELinux policy).
Network setup
Memory and CPU allocation
Verify and start guest installation
virt-manager
. 8장. 게스트 운영 체제 설치 절차 contains step-by-step instructions to installing a variety of common operating systems.
새 브리지 생성
/etc/sysconfig/network-scripts/
디렉토리에 새 네트워크 스크립트 파일을 생성합니다. 예에서는 installation
라는 브리지를 만드는 ifcfg-installation
라는 파일을 생성합니다.
# cd /etc/sysconfig/network-scripts/ # vim ifcfg-installation DEVICE=installation TYPE=Bridge BOOTPROTO=dhcp ONBOOT=yes
TYPE=Bridge
, is case-sensitive. It must have uppercase 'B' and lower case 'ridge'.
ifup installation
command can start the individual bridge but it is safer to test the entire network restarts properly.
# service network restart
brctl show
명령을 사용하여 시스템 상의 네트워크 브리지에 관한 상세 정보를 확인합니다.
# brctl show bridge name bridge id STP enabled interfaces installation 8000.000000000000 no virbr0 8000.000000000000 yes
virbr0
브리지는 기본 이더넷 장치에 있는 NAT (Network Address Translation)에 대해 libvirt
를 사용하는 기본값 브리지입니다.
새 브리지에 인터페이스 추가
BRIDGE
파라미터를 설정 파일에 추가합니다.
# Intel Corporation Gigabit Network Connection DEVICE=eth1 BRIDGE=installation BOOTPROTO=dhcp HWADDR=00:13:20:F7:6E:8E ONBOOT=yes
# service network restart
brctl show
명령으로 인터페이스가 첨부되었는지 확인합니다.
# brctl show bridge name bridge id STP enabled interfaces installation 8000.001320f76e8e no eth1 virbr0 8000.000000000000 yes
보안 설정
iptables
를 설정하여 모든 트래픽이 브리지를 통해 전송되게 합니다.
# iptables -I FORWARD -m physdev --physdev-is-bridged -j ACCEPT # service iptables save # service iptables restart
iptables
규칙에 의해 처리되지 않게 합니다. /etc/sysctl.conf
에 다음 행을 추가합니다:
net.bridge.bridge-nf-call-ip6tables = 0 net.bridge.bridge-nf-call-iptables = 0 net.bridge.bridge-nf-call-arptables = 0
sysctl
로 설정된 커널 파라미터를 다시 불러옵니다
# sysctl -p /etc/sysctl.conf
설치 전 libvirt 재시작
libvirt
데몬을 다시 시작합니다.
# service libvirtd reload
virt-install
의 경우 --network=bridge:installation
설치 파라미터를 첨부합니다. 여기서 installation
은 브리지 이름입니다. PXE 설치의 경우 --pxe
파라미터를 사용합니다.
# virt-install --accelerate --hvm --connect qemu:///system \ --network=bridge:installation --pxe\ --name EL10 --ram=756 \ --vcpus=4 --os-type=linux --os-variant=rhel5 --file=/var/lib/libvirt/images/EL10.img \
PXE 선택
브리지 선택
설치 시작
virsh update-device Guest1 ~/Guest1.xml
(substituting your guest's name and XML file), and select OK to continue past this step.
kernel-xen
커널이 필요합니다.
virt-manager
, refer to the procedure in 7.2절. “virt-manager로 게스트 생성 ”.
virt-install
도구로 반가상화 게스트를 생성합니다. --vnc
옵션은 그래픽 설치를 보여줍니다. 예에서 게스트 이름은 rhel5PV
, 디스크 이미지 파일은 rhel5PV.dsk
이며 Red Hat Enterprise Linux 5 설치 트리의 로컬 미러는 ftp://10.1.1.1/trees/RHEL5-B2-Server-i386/
입니다. 이러한 값을 시스템 및 네트워크에 적합한 값으로 대체합니다.
# virt-install -nrhel5PV
-r 500 \ -f /var/lib/libvirt/images/rhel5PV.dsk
-s 3 --vnc -p \ -lftp://10.1.1.1/trees/RHEL5-B2-Server-i386/
DHCP
(as shown below) or a static IP address:
Installation Number
란에 입력해 주십시오:
rhn_register
명령을 사용하여 설치 후 Red Hat Network 계정 정보를 확인하실 수 있습니다. rhn_register
명령에는 root 액세스가 필요합니다.
virt-install
in 8.1절. “반가상화 게스트로서 Red Hat Enterprise Linux 5 설치 ”. If you used the default example the name is rhel5PV
.
virsh
를 사용하여 게스트를 재부팅합니다:
# virsh reboot rhel5PV
virt-manager
를 열고 게스트 이름을 선택합니다. 를 클릭하고 을 클릭합니다.
kdump
. The use of kdump
is unsupported on para-virtualized guests.
yum
command or RHN. Click .
virt-manager 열기
virt-manager
를 시작합니다. 메뉴에서 로 가서 프로그램을 시작합니다. 다른 방법으로 root로 virt-manager
명령을 실행합니다.
하이퍼바이저 선택
qemu
로 되어 있음에 유의하십시오.
새 가상 장치 마법사 시작
가상 장치 이름 지정
가상화 방식 선택
설치 방식 선택
설치 미디어 배치
/var/lib/libvirt/images/
directory. Any other location may require additional configuration for SELinux, refer to 18.2절. “SELinux 및 가상화 ” for details.
저장 장치 설정
/var/lib/libvirt/images/
directory. Assign sufficient space for your virtualized guest and any applications the guest requires.
네트워크 설정
메모리 및 CPU 할당
게스트 설치 확인 및 시작
Red Hat Enterprise Linux 설치
virt-manager 시작
가상 시스템 이름 지정
가상화 방식 선택
설치 방식 선택
/var/lib/libvirt/images/
directory. Any other location may require additional configuration for SELinux, refer to 18.2절. “SELinux 및 가상화 ” for details.
Choose installation image
/var/lib/libvirt/images/
directory by default. In the default configuration, other directory locations for file-based images are prohibited by SELinux. If you use a different directory you must label the new directory according to SELinux policy. Refer to 18.2절. “SELinux 및 가상화 ” for details.
/var/lib/libvirt/images/
를 사용할 것을 권장합니다. 다른 위치를 사용하고 계실 경우 (예: /images/
) 설치를 계속 진행하시기 전 이를 SELinux 정책에 추가하여 다시 레이블했는지를 확인합니다. (차후 이 문서에서 SELinux 정책을 수정하는 방법을 설명합니다)
네트워크 설정
HAL
, once you get the dialog box in the Windows install select the 'Generic i486 Platform
' tab. Scroll through selections with the Up and Down arrows.
# virsh start WindowsGuest
WindowsGuest
는 가상 장치의 이름입니다.
virsh reboot WindowsGuestName
명령을 사용하여 게스트를 재시작할 수 있습니다. 가상 장치를 재시작하면 Setup is being restarted
메세지가 나타나게 됩니다:
virt-install
command. virt-install
can be used instead of virt-manager
This process is similar to the Windows XP installation covered in 8.3절. “완전 가상화 게스트로 Windows XP 설치 ”.
virt-install
for installing Windows Server 2003 as the console for the Windows guest opens the virt-viewer
window promptly. The examples below installs a Windows Server 2003 guest with the virt-install
command.
Xen virt-install
# virt-install --virt-type=xen -hvm \ --name windows2003sp1 --file=/var/lib/libvirt/images/windows2003sp2.img \ --file-size=6 \ --cdrom=/var/lib/libvirt/images/ISOs/WIN/en_windows_server_2003_sp1.iso \ --vnc --ram=1024
KVM virt-install
# virt-install --accelerate --hvm --connect qemu:///system \ --name rhel3support \ --network network:default \ --file=/var/lib/libvirt/images/windows2003sp2.img \ --file-size=6 \ --cdrom=/var/lib/libvirt/images/ISOs/WIN/en_windows_server_2003_sp1.iso \ --vnc --ram=1024
표준 PC
를 선택합니다. Windows Server 2003 의 경우 컴퓨터 유형을 변경해야 합니다.
virt-manager 열기
virt-manager
를 시작합니다. 메뉴와 하위 메뉴에서 프로그램을 시작합니다. 다른 방법으로 root로 virt-manager
명령을 실행합니다.
하이퍼바이저 선택
qemu
로 되어 있습니다.
새 가상 장치 마법사 시작
가상 장치 이름 지정
가상화 방식 선택
가상화 방식 선택
설치 미디어 위치
/var/lib/libvirt/images/
directory. Any other location may require additional configuration for SELinux, refer to 18.2절. “SELinux 및 가상화 ” for details.
저장 장치 설정
/var/lib/libvirt/images/
directory. Assign sufficient space for your virtualized guest and any applications the guest requires.
네트워크 설정
메모리 및 CPU 할당
게스트 설치 확인 및 시작
Windows 설치
/dev/xvd[a to z][1 to 15]
/dev/xvdb13
/dev/xvd[a to i][a to z][1 to 15]
/dev/xvdbz13
/dev/sd[a to p][1 to 15]
/dev/sda1
/dev/hd[a to t][1 to 63]
/dev/hdd3
dd
command. Replace /dev/fd0
with the name of a floppy device and name the disk appropriately.
# dd if=/dev/fd0 of=~/legacydrivers.img
/var/lib/libvirt/images/rhel5FV.img
에 있는 이미지를 사용하여 완전 가상화 Red Hat Enterprise Linux 설치를 실행하는 virt-manager
로 생성된 게스트를 사용하고 있습니다. 예에서 Xen 하이퍼바이저가 사용되고 있습니다.
virsh
명령을 사용하여 게스트 이미지의 XML 설정 파일을 생성합니다.
# virsh dumpxml rhel5FV > rhel5FV.xml
# dd if=/dev/zero of=/var/lib/libvirt/images/rhel5FV-floppy.img bs=512 count=2880
<disk type='file' device='floppy'> <source file='/var/lib/libvirt/images/rhel5FV-floppy.img'/> <target dev='fda'/> </disk>
virsh shutdown
command instead.
# virsh destroy rhel5FV
# virsh create rhel5FV.xml
dd
명령을 사용하여 스파스 (sparse) 파일을 생성합니다. 스파스 파일은 데이터 무결성 및 실행 문제로 인해 권장되지 않습니다. 스파스 파일은 보다 빨리 생성되며 테스트 목적으로 사용될 수 있으나 실제 시스템에서는 사용하지 않습니다.
# dd if=/dev/zero of=/var/lib/libvirt/images/FileName.img bs=1M seek=4096 count=0
# dd if=/dev/zero of=/var/lib/libvirt/images/FileName.img bs=1M count=4096
Guest1
이며 파일은 사용자의 홈 디렉토리에 저장됩니다.
# virsh dumpxmlGuest1
> ~/Guest1
.xml
Guest1.xml
)을 엽니다. <disk>
항목을 찾습니다. 이러한 항목은 저장 장치를 설명합니다. 디스크 항목의 예는 다음과 같습니다:
<disk type='file' device='disk'> <driver name='tap' type='aio'/> <source file='/var/lib/libvirt/images/Guest1.img'/> <target dev='xvda'/> </disk>
<disk>
항목을 작성 또는 복사하여 추가 저장 장치를 더합니다. 가상 블록 장치 속성의 장치 이름을 지정했는지 확인합니다. 이러한 속성은 각각의 게스트 설정 파일에 대해 유일한 것이어야 합니다. 다음 예에는 FileName.img
라는 추가 파일 기반 저장 장치 컨테이너가 들어있는 설정 파일 부분이 있습니다.
<disk type='file' device='disk'> <driver name='tap' type='aio'/> <source file='/var/lib/libvirt/images/Guest1.img'/> <target dev='xvda'/> </disk> <disk type='file' device='disk'> <driver name='tap' type='aio'/> <source file='/var/lib/libvirt/images/FileName.img'/> <target dev='hda'/> </disk>
# virsh create Guest1.xml
FileName.img
as the device called /dev/sdb
. This device requires formatting from the guest. On the guest, partition the device into one primary partition for the entire device then format the device.
n
을 누릅니다.
# fdisk /dev/sdb Command (m for help):
p
를 누릅니다.
Command action e extended p primary partition (1-4)
1
을 입력하여 첫 번째 파티션을 선택합니다.
Partition number (1-4): 1
Enter
를 눌러 기본값으로 첫번째 실린더를 입력합니다.
First cylinder (1-400, default 1):
Enter
를 눌러 전체 디스크를 할당합니다.
Last cylinder or +size or +sizeM or +sizeK (2-400, default 400):
t
를 눌러 파티션 유형을 설정합니다.
Command (m for help): t
1
이 됩니다.
Partition number (1-4): 1
83
을 입력합니다.
Hex code (type L to list codes): 83
Command (m for help):w
Command (m for help):q
ext3
파일 시스템으로 포맷합니다.
# mke2fs -j /dev/sdb1
# mount /dev/sdb1 /myfiles
fstab
file, the initrd
file or used by the kernel command line. If less privileged users, especially virtualized guests, have write access to whole partitions or LVM volumes the host system could be compromised.
/dev/sdb
). Virtualized guests with access to block devices may be able to access other block devices on the system or modify volume labels which can be used to compromise the host system. Use partitions (for example, /dev/sdb1
) or LVM volumes to prevent this issue.
multipath
로 장치를 설정합니다.
virsh attach
command. Replace: myguest
with your guest's name, /dev/sdb1
with the device to add, and sdc
with the location for the device on the guest. The sdc
must be an unused device name. Use the sd*
notation for Windows guests as well, the guest will recognize the device correctly.
--type cdrom
parameter to the command for CD-ROM or DVD devices.
--type floppy
파라미터를 플로피 장치의 명령에 추가합니다.
# virsh attach-diskmyguest
/dev/sdb1
sdc
--driver tap --mode readonly
/dev/sdb
on Linux or D: drive
, or similar, on Windows. This device may require formatting.
multipath
must use 단일 경로 설정 . Systems running multipath
can use 다중 경로 설정 .
udev
. Only use this procedure for hosts which are not using multipath
.
/etc/scsi_id.config
파일을 편집합니다.
options=-b
행이 주석 처리되어 있는지를 확인합니다.
# options=-b
options=-g
udev
를 설정하여 부착된 모든 SCSI 장치가 UUID를 반환하게 합니다.
scsi_id -g -s /block/sd*
명령을 실행합니다. 예:
# scsi_id -g -s /block/sd* 3600a0b800013275100000015427b625e
/dev/sdc
장치의 UUID를 나타내고 있습니다.
scsi_id -g -s /block/sd*
명령에 의한 UUID 출력이 장치에 액세스하는 컴퓨터에서 동일한지 확인합니다.
/etc/udev/rules.d
디렉토리에 있는 20-names.rules
라는 파일을 생성합니다. 이 파일에 새로운 규칙을 추가합니다. 동일한 포맷을 사용하여 모든 규칙은 동일한 파일에 추가됩니다. 규칙은 다음과 같은 포맷으로 되어 있어야 합니다:
KERNEL=="sd[a-z]", BUS=="scsi", PROGRAM="/sbin/scsi_id -g -s /block/%k", RESULT="UUID
", NAME="devicename
"
UUID
및 devicename
을 검색된 UUID 및 장치 이름으로 대체합니다. 예에서 규칙은 다음과 같이 나타납니다:
KERNEL="sd*", BUS="scsi", PROGRAM="/sbin/scsi_id -g -s", RESULT="3600a0b800013275100000015427b625e", NAME="rack4row16"
udev
데몬은 규칙에 있는 UUID에 대해 /dev/sd*
라는 모든 장치를 검색합니다. 일치하는 장치가 시스템에 연결되면 장치는 규칙에서 이름을 할당합니다. 3600a0b800013275100000015427b625e의 UUID를 갖는 장치에서는 /dev/rack4row16
으로 표시됩니다.
/etc/rc.local
에 추가합니다:
/sbin/start_udev
/etc/scsi_id.config
, /etc/udev/rules.d/20-names.rules
, /etc/rc.local
에서의 변경 사항을 관련된 모든 호스트에 복사합니다.
/sbin/start_udev
multipath
패키지는 컴퓨터에서 저장 장치로 한 개 이상의 물리적 경로를 갖는 시스템에 대해 사용됩니다. multipath
는 Red Hat Enterprise Linux 시스템에 부착된 네트워크 저장 장치에 대해 장애 허용, 장애 복구, 성능 향상을 제공합니다.
multipath
environment requires defined alias names for your multipath devices. Each storage device has a UUID which acts as a key for the aliased names. Identify a device's UUID using the scsi_id
command.
# scsi_id -g -s /block/sdc
/dev/mpath
디렉토리에 생성됩니다. 아래 예에서는 4 개의 장치가 /etc/multipath.conf
에 정의되어 있습니다:
multipaths { multipath { wwid 3600805f30015987000000000768a0019 alias oramp1 } multipath { wwid 3600805f30015987000000000d643001a alias oramp2 } mulitpath { wwid 3600805f3001598700000000086fc001b alias oramp3 } mulitpath { wwid 3600805f300159870000000000984001c alias oramp4 } }
/dev/mpath/oramp1
, /dev/mpath/oramp2
, /dev/mpath/oramp3
and /dev/mpath/oramp4
. Once entered, the mapping of the devices' WWID to their new names are now persistent after rebooting.
virsh
with the attach-disk
parameter.
# virsh attach-disk [domain-id] [source] [target] --driver file --type cdrom --mode readonly
The source
and target
parameters are paths for the files and devices, on the host and guest respectively. The source
parameter can be a path to an ISO file or the device from the /dev
directory.
libvirt
installation provides NAT based connectivity to virtual machines out of the box. This is the so called 'default virtual network'. Verify that it is available with the virsh net-list --all
command.
# virsh net-list --all Name State Autostart ----------------------------------------- default active yes
# virsh net-define /usr/share/libvirt/networks/default.xml
/usr/share/libvirt/networks/default.xml
에서 정의됩니다.
# virsh net-autostart default Network default marked as autostarted
# virsh net-start default Network default started
libvirt
기본값 네트워크가 실행되면, 고립된 브리지 장치가 나타나게 됩니다. 이러한 장치는 외부와 연결하기 위해 NAT 및 IP 포워딩을 사용한 이래 물리적 인터페이스를 추가하지 않습니다. 새 인터페이스를 추가하시 마십시오.
# brctl show bridge name bridge id STP enabled interfaces virbr0 8000.000000000000 yes
libvirt
는 INPUT
, FORWARD
, OUTPUT
, POSTROUTING
체인에 있는 virbr0
장치에 부착된 게스트에서/부터 전송을 허용하는 iptables
규칙을 추가합니다. 그 후 libvirt
는 ip_forward
파라미터를 활성 시도합니다. 일부 다른 어플리케이션은 ip_forward
를 비활성화할 수 있으므로, 최상의 옵션은 다음을 /etc/sysctl.conf
에 추가하는 것입니다.
net.ipv4.ip_forward = 1
<interface type='network'> <source network='default'/> </interface>
<interface type='network'> <source network='default'/> <mac address='00:16:3e:1a:b3:4a'/> </interface>
/etc/xen/xend-config.sxp
파일을 편집하고 행을 변경하여 기본값 Xen 네트워크 브리지를 비활성화할 것을 권장합니다.
(network-script network-bridge)
(network-script /bin/true)
/etc/sysconfig/network-scripts/
directory):
# chkconfig NetworkManager off # chkconfig network on # service NetworkManager stop # service network start
NM_CONTROLLED=no
" to the ifcfg-*
scripts used in the examples. If you do not either set this parameter or disable NetworkManager entirely, any bridge configuration will be overwritten and lost when NetworkManager next starts.
/etc/sysconfig/network-scripts
디렉토리로 변경합니다:
# cd /etc/sysconfig/network-scripts
ifcfg-eth0
는 브리지의 일부분으로 설정된 물리적 네트워크 인터페이스를 정의하고 있습니다:
DEVICE=eth0 # change the hardware address to match the hardware address your NIC uses HWADDR=00:16:76:D6:C9:45 ONBOOT=yes BRIDGE=br0
MTU
variable to the end of the configuration file.
MTU=9000
/etc/sysconfig/network-scripts
디렉토리에 ifcfg-br0
라는 새로운 네트워크 스크립트를 생성합니다. br0
은 브리지 이름이며, 이는 파일 이름이 장치 파라미터와 동일할 경우 어느것이든지 될 수 있습니다.
DEVICE=br0 TYPE=Bridge BOOTPROTO=dhcp ONBOOT=yes DELAY=0
ifcfg-br0
file). Network access will not function as expected if IP address details are configured on the physical interface that the bridge is connected to.
TYPE=Bridge
, is case-sensitive. It must have uppercase 'B' and lower case 'ridge'.
# service network restart
iptables
를 설정하여 모든 전송이 브리지를 통해 포워딩되게 합니다.
# iptables -I FORWARD -m physdev --physdev-is-bridged -j ACCEPT # service iptables save # service iptables restart
iptables
규칙에 의해 프로세스되지 않게 합니다. /etc/sysctl.conf
에 다음과 같은 행을 추가합니다:
net.bridge.bridge-nf-call-ip6tables = 0 net.bridge.bridge-nf-call-iptables = 0 net.bridge.bridge-nf-call-arptables = 0
sysctl
로 설정된 커널 파라미터를 다시 불러옵니다.
# sysctl -p /etc/sysctl.conf
libvirt
데몬을 다시 시작합니다.
# service libvirtd reload
# brctl show bridge name bridge id STP enabled interfaces virbr0 8000.000000000000 yes br0 8000.000e0cb30550 no eth0
virbr0
브리지와 완전히 독립적인 것입니다. 물리적 장치를 virbr0
에 부착하려 하지 마십시오. virbr0
브리지는 NAT (Network Address Translation) 연결을 위한 것입니다.
virsh
(25장. virsh를 사용한 게스트 관리 ) and virt-manager
(26장. 가상 장치 관리자(virt-manager)를 사용한 게스트 관리 ). Those chapters provide a detailed description of the networking configuration tasks using both tools.
system-config-network
어플리케이션을 사용하여 다른 네트워크 인터페이스를 생성합니다. 또는 /etc/sysconfig/network-scripts/
디렉토리에 ifcfg-ethX
라는 새 설정 파일을 생성합니다. 여기서 X
는 이미 사용되지 않은 숫자이어야 합니다. 아래에는 eth1
이라는 두번째 네트워크 인터페이스에 해당하는 설정 파일의 예가 있습니다.
$ cat /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 BOOTPROTO=static ONBOOT=yes USERCTL=no IPV6INIT=no PEERDNS=yes TYPE=Ethernet NETMASK=255.255.255.0 IPADDR=10.1.1.1 GATEWAY=10.1.1.254 ARP=yes
/etc/xen/scripts/network-bridge
파일을 /etc/xen/scripts/network-bridge.xen
에 복사합니다.
/etc/xen/xend-config.sxp
and add the line (network-xen-multi-bridge)
. A typical xend-config.sxp
file should have the following line. Comment this line out. Use the # symbol to comment out lines.
network-script network-bridge
network-xen-multi-bridge
parameter to enable multiple network bridges.
#network-script network-bridge network-script network-xen-multi-bridge
network-xen-multi-bridge.sh
in the /etc/xen/scripts/
directory. A sample scripts is below, this example script will create two Xen network bridges (xenbr0 and xenbr1) one will be attached to eth1 and the other one to eth0. If you want to create additional bridges just follow the example in the script and copy nad paste the lines as required:
#!/bin/sh # network-xen-multi-bridge # Exit if anything goes wrong. set -e # First arg is the operation. OP=$1 shift script=/etc/xen/scripts/network-bridge.xen case ${OP} in start) $script start vifnum=1 bridge=xenbr1 netdev=eth1 $script start vifnum=0 bridge=xenbr0 netdev=eth0 ;; stop) $script stop vifnum=1 bridge=xenbr1 netdev=eth1 $script stop vifnum=0 bridge=xenbr0 netdev=eth0 ;; status) $script status vifnum=1 bridge=xenbr1 netdev=eth1 $script status vifnum=0 bridge=xenbr0 netdev=eth0 ;; *) echo 'Unknown command: ' ${OP} echo 'Valid commands are: start, stop, status' exit 1 esac
# chmod +x /etc/xen/scripts/network-xen-multi-bridge.sh
# service network restart
virt-manager
에 게스트를 생성할 때 "Virtual Network" 어댑터를 사용합니다. NetworkManager는 Red Hat Enterprise Linux 5.1 이상 버전에서 기본값으로 가상 네트워크 장치와 함께 작동합니다.
<interface type='network'> <mac address='AA:AA:AA:AA:AA:AA'/> <source network='default'/> <target dev='vnet0'/> <model type='virtio'/> </interface>
xm
설정 파일에서 가상 네트워크 장치는 "vif
"로 레이블됩니다.
ifup
or ifdown
calls to the network interface it is using. In addition wireless network cards do not work well in a virtualization environment due to Xen's (default) bridged network usage.
dummy0
. This will also allow you to use a hidden IP address space for your guests.
/etc/modprobe.conf
에 다음과 같은 행을 추가합니다
alias dummy0 dummy options dummy numdummies=1
/etc/sysconfig/network-scripts/ifcfg-dummy0
을 편집/생성합니다:
DEVICE=dummy0 BOOTPROTO=none ONBOOT=yes USERCTL=no IPV6INIT=no PEERDNS=yes TYPE=Ethernet NETMASK=255.255.255.0 IPADDR=10.1.1.1 ARP=yes
xenbr0
를 dummy0
로 바인드하여 실제 네트워크에 연결되지 않을 경우에도 네트워킹을 사용할 수 있게 합니다. netdev=dummy0
항목을 포함시키기 위해 /etc/xen/xend-config.sxp
를 편집합니다:
(network-script 'network-bridge bridge=xenbr0 netdev=dummy0')
/etc/sysconfig/network
in the guest and modify the default gateway to point to dummy0
. If you are using a static IP, set the guest's IP address to exist on the same subnet as dummy0
.
NETWORKING=yes HOSTNAME=localhost.localdomain GATEWAY=10.1.1.1 IPADDR=10.1.1.10 NETMASK=255.255.255.0
/etc/init.d/xenLaptopNAT
에 복사하고 /etc/rc3.d/S99xenLaptopNAT
에 소프트 링크를 생성할 수 있습니다. 이는 부팅시 NAT를 자동으로 시작합니다.
#!/bin/bash PATH=/usr/bin:/sbin:/bin:/usr/sbin export PATH GATEWAYDEV=`ip route | grep default | awk {'print $5'}` iptables -F case "$1" in start) if test -z "$GATEWAYDEV"; then echo "No gateway device found" else echo "Masquerading using $GATEWAYDEV" /sbin/iptables -t nat -A POSTROUTING -o $GATEWAYDEV -j MASQUERADE fi echo "Enabling IP forwarding" echo 1 > /proc/sys/net/ipv4/ip_forward echo "IP forwarding set to `cat /proc/sys/net/ipv4/ip_forward`" echo "done." ;; *) echo "Usage: $0 {start|restart|status}" ;; esac
dnsmasq
를 설정하는 방법에 대해 간략하게 설명합니다:
dnsmasq.tgz
. The tar archive includes the following files:
nm-dnsmasq
파일은 NetworkManager에 대해 디스패처(dispatcher) 스크립트로 사용될 수 있습니다. 이는 NetworkManager가 연결 변경을 감지할 때 마다 실행되어 dnsmasq의 재시작/다시 불러오기를 강제하게 됩니다. 이는 /etc/NetworkManager/dispatcher.d/nm-dnsmasq
에 복사해 두어야 합니다
xenDNSmasq
는 /etc/init.d/xenDNSmasq
에 대한 주요 시작 또는 종료 스크립트로 사용될 수 있습니다
dnsmasq.conf
는 /etc/dnsmasq.conf
에 대한 예시 설정 파일입니다
dnsmasq
는 /usr/local/sbin/dnsmasq
에 대한 바이너리 이미지입니다
/usr/local/sbin/dnsmasq
로 바이너리됨) dnsmasq 설정 파일을 편집해야 합니다. 파일은 /etc/dnsmaqs.conf
에 위치해 있습니다
interface
파라미터는 특정 인터페이스에서만 dnsmasq
가 DHCP
및 DNS
요청을 청취하게 합니다. 이는 공개 인터페이스가 아닌 더미 인터페이스나 로컬 루프백 인터페이스가 될 수 있습니다. 하나 이상의 인터페이스에 대해 다른 interface
행을 추가합니다. interface=dummy0
은 dummy0
인터페이스에서 청취하는 예입니다.
dhcp-range
통합된 DHCP 서버를 활성화하려면, 할당 시간에 대한 사용 가능한 주소 범위를 제공해야 합니다. 네트워크가 하나 이상있을 경우, DHCP
서비스를 제공하고자 하는 각각의 네트워크에 대해 이를 반복해야 합니다. 할당 시간이 12 시간인 네트워크 10.1.1.*의 경우의 예는 다음과 같습니다: dhcp-range=10.1.1.10,10.1.1.50,255.255.255.0,12h
dhcp-option
dnsmasq에 의해 제공된 기본값 라우트를 덮어쓰기하기 위해 라우터는 dnsmasq가 실행되고 있는 장치와 동일한 장치에 있다고 가정합니다. 예: dhcp-option=3,10.1.1.1
xenDNSmasq
로서 /etc/init.d
에 복사할 수 있습니다
chkconfig --add xenDNSmasq
chkconfig --levels 345 xenDNSmasq on
dnsmasq
를 설정하려면 nm-dnsmasq
스크립트를 사용할 수 있습니다.
nm-dnsmasq
스크립트를 /etc/NetworkManager/dispatcher.d/
에 복사해 둡니다
dnsmasq
는 /etc/resolv.conf
에서의 변경 사항을 감지하여 자동으로 이를 다시 불러오기 합니다. (예: VPN 세션을 시작할 경우)
nm-dnsmasq
및 xenDNSmasq
스크립트에 NAT를 설정해야 합니다.
pv-on-hvm
모듈이 기본값 커널 패키지로 들어 있습니다. 이는 반가상화 드라이버가 Red Hat Enterprise Linux 4.7 이상 또는 5.3 및 그 이상 버전 게스트에 대해 사용 가능함을 의미합니다.
kmod-xenpv
.
kmod-xenpv
,
modules-init-tools
(for versions prior to Red Hat Enterprise Linux 4.6z you require modules-init-tools-3.1-0.pre5.3.4.el4_6.1
or greater), and
modversions
.
kmod-xenpv
.
/lib
file system.
# rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' kernel
커널 구조 | Red Hat Enterprise Linux 3 | Red Hat Enterprise Linux 4 | Red Hat Enterprise Linux 5 |
---|---|---|---|
athlon | 지원됨 (AMD) | ||
athlon-SMP | 지원됨 (AMD) | ||
i32e | 지원됨 (Intel) | ||
i686 | 지원됨 (Intel) | 지원됨 | 지원됨 |
i686-PAE | 지원됨 | ||
i686-SMP | 지원됨 (Intel) | 지원됨 | |
i686-HUGEMEM | 지원됨 (Intel) | 지원됨 | |
x86_64 | 지원됨 (AMD) | 지원됨 | 지원됨 |
x86_64-SMP | 지원됨 (AMD) | 지원됨 | |
x86_64-LARGESMP | 지원됨 | ||
Itanium (IA64) | 지원됨 |
# rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' kernel
kernel-PAE-2.6.18-53.1.4.el5.i686
GRUB
GRUB
)가 들어있는 디스크, 또는 커널 initrd
이미지가 들어있는 디스크에서 그러합니다. 즉, /boot
디렉토리 또는 파티션이 있는 디스크는 반가상화 블록 장치 드라이버를 사용할 수 없습니다.
xen-pci-platform
모듈을 불러오지 못하게 됩니다.
게스트 커널 유형 | 필요한 호스트 커널 유형 |
---|---|
ia32e (UP 및 SMP) | x86_64 |
i686 | i686 |
i686-SMP | i686 |
i686-HUGEMEM | i686 |
게스트 커널 유형 | 필요한 호스트 커널 유형 |
---|---|
athlon | i686 |
athlon-SMP | i686 |
x86_64 | x86_64 |
x86_64-SMP | x86_64 |
MBR
및 부트로더 (GRUB
)가 들어있는 디스크 및 /boot
파티션에 대해 반가상화 드라이버를 사용합니다. 이러한 파티션은 /boot
파티션 만을 생성할 수 있을 정도로 작은 용량일 수 있습니다.
/
, /usr
) 또는 논리 볼륨 용으로 두 번째 디스크 및 추가 디스크를 사용합니다.
/boot
파티션에 액세스하기 위해 가상화 블록 장치 드라이버를 사용하게 됩니다.
rpm
명령이나 yum
명령을 사용하여 패키지를 설치합니다. rpm
유틸리티는 다음과 같은 새로운 네 개의 커널 모듈을 /lib/modules/[%kversion][%kvariant]/extra/xenpv/%release
에 설치하게 됩니다:
xen_platform_pci.ko
,
xen_balloon.ko
,
xen_vbd.ko
,
xen_vnif.ko
.
xen-vbd
) disk driver.
<disk type='file' device='disk'> <driver name='file'/> <source file='/dev/hda6'/> <target dev='hda'/> </disk>
<disk type='file' device='disk'> <driver name='tap' type='aio'/> <source file='/dev/hda6'/> <target dev='xvda'/> </disk>
# xm start YourGuestName
YourGuestName
is the name of the configuration file or the guest operating system's name as defined in its configuration file in the name = "os_name" parameter.
kernel-2.4.21-60.EL
for all the required headers.
kmod-xenpv
rpm을 게스트 운영 체제에 복사합니다.
rpm
유틸리티를 사용하여 RPM 패키지를 설치합니다. 게스트 운영 체제 변형 및 구조에 따라 어떤 패키지가 필요한 지를 확인합니다.
[root@rhel3]# rpm -ivh kmod-xenpv*
[root@rhel3]# mkdir -p /lib/modules/'uname -r'/extra/xenpv [root@rhel3]# cp -R /lib/modules/2.4.21-52.EL[%kvariant]/extra/xenpv/%release \ /lib/modules/'uname -r'/extra/xenpv [root@rhel3]# depmod -ae [root@rhel3]# modprobe xen-vbd [root@rhel3]# modprobe xen-vnif
insmod
에 의해 경고 메세지가 생성됩니다. 이러한 경고 메세지는 무시하셔도 됩니다.
/etc/modules.conf
를 확인하여 아래와 같이 eth0
에 대한 알리아스가 있는 지를 확인합니다. 다수의 인터페이스를 설정하고자 할 경우 각각의 인터페이스에 대해 추가 행을 더합니다.
alias eth0 xen-vnif
/etc/rc.local
파일을 편집하고 다음의 행을 추가합니다:
insmod /lib/modules/'uname -r'/extra/xenpv/%release/xen-vbd.o
#shutdown -h now
” 명령 사용).
/etc/xen/YourGuestName
with a text editor, performing the following changes:
vif=
” 항목에서 “type=ioemu
” 항목을 삭제합니다.
xen-vbd
) 디스크 드라이버를 통해 액세스할 수 있게 합니다.
<disk type='file' device='disk'> <driver name='file'/> <source file='/dev/hda6'/> <target dev='hda'/> </disk>
<disk type='file' device='disk'> <driver name='tap' type='aio'/> <source file='/dev/hda6'/> <target dev='xvda'/> </disk>
# xm start YourGuestName
YourGuestName
is the name of the configuration file or the guest operating system's name as defined in its configuration file in the name = "os_name" parameter.
weak-modules
및 modversions
가 Red Hat Enterprise Linux 3에서 지원되지 않기 때문에 반가상화 드라이버를 시스템에 자동으로 추가하거나 읽어올 수 없습니다. 모듈을 넣으려면 아래의 명령을 실행합니다.
insmod xen_vbd.ko
xen-vbd
를 사용하는 블록 장치에 대한 특정 파일을 수동으로 생성해야 합니다. 다음에서는 반가상화 블록 장치를 생성하고 등록하는 방법에 대해 설명합니다.
#!/bin/sh module="xvd" mode="664" major=`awk "\\$2==\"$module\" {print \\$1}" /proc/devices` # < mknod for as many or few partitions on xvd disk attached to FV guest > # change/add xvda to xvdb, xvbd, etc. for 2nd, 3rd, etc., disk added in # in xen config file, respectively. mknod /dev/xvdb b $major 16 mknod /dev/xvdb1 b $major 17 mknod /dev/xvdb2 b $major 18 chgrp disk /dev/xvd* chmod 0660 /dev/xvd*
# mknod /dev/xvdc b $major 16 # mknod /dev/xvdc1 b $major 17
# mknod /dev/xvdd b $major 32 # mknod /dev/xvdd1 b $major 33
[root@rhel3]# cat /proc/partitions major minor #blocks name 3 0 10485760 hda 3 1 104391 hda1 3 2 10377990 hda2 202 16 64000 xvdb 202 17 32000 xvdb1 202 18 32000 xvdb2 253 0 8257536 dm-0 253 1 2031616 dm-1
xvdb
” 장치를 시스템에서 사용할 수 있음을 알 수 있습니다.
[root@rhel3]# mkdir /mnt/pvdisk_p1 [root@rhel3]# mkdir /mnt/pvdisk_p2
[root@rhel3]# mount /dev/xvdb1 /mnt/pvdisk_p1 [root@rhel3]# mount /dev/xvdb2 /mnt/pvdisk_p2
[root@rhel3]# df /mnt/pvdisk_p1 Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvdb1 32000 15 31985 1% /mnt/pvdisk_p1
/etc/fstab
파일을 업데이트합니다. 다음 행을 추가합니다:
/dev/xvdb1 /mnt/pvdisk_p1 ext3 defaults 1 2 /dev/xvdb2 /mnt/pvdisk_p2 ext3 defaults 1 2
dom0
), the "noapic
" parameter should be added to the kernel boot line in your virtual guest's /boot/grub/grub.conf
entry as seen below. Keep in mind your architecture and kernel version may be different.
kernel /vmlinuz-2.6.9-67.EL ro root=/dev/VolGroup00/rhel4_x86_64 rhgb noapic
kmod-xenpv
, modules-init-tools
및 modversions
RPM을 게스트 운영 체제에 복사합니다.
rpm
유틸리티를 사용하여 RPM 패키지를 설치합니다. 게스트 운영 체제 변형 및 구조에 따라 어떤 패키지가 필요한 지를 확인하시기 바랍니다. 업데이트된 module-init-tools에는 이러한 패키지가 필요하며, 이는 Red Hat Enterprise Linux4-6-z 커널 이상에서 사용 가능합니다.
[root@rhel4]# rpm -ivh modversions [root@rhel4]# rpm -Uvh module-init-tools [root@rhel4]# rpm -ivh kmod-xenpv*
cat /etc/modprobe.conf
to verify you have an alias for eth0
like the one below. If you are planning to configure multiple interfaces add an additional line for each interface. If it does not look like the entry below change it.
alias eth0 xen-vnif
#shutdown -h now
” 명령 사용).
/etc/xen/YourGuestsName
에 있는 게스트 설정 파일을 편집합니다:
vif=
” 항목에서 “type=ioemu
” 항목을 삭제합니다.
xen-vbd
) 디스크 드라이버를 통해 액세스할 수 있게 합니다.
disk=
” 부분에 아래와 유사한 항목을 추가합니다. 원래의 “disk=
” 항목은 아래와 유사하게 나타납니다.
disk = [ "file:/var/lib/libvirt/images/rhel4_64_fv.dsk,hda,w"]
disk = [ "file:/var/lib/libvirt/images/rhel3_64_fv.dsk,hda,w", "tap:aio:/var/lib/libvirt/images/UserStorage.dsk,xvda,w" ]
tap:aio
” 명령을 사용합니다.
virsh
명령을 사용하여 가상 장치를 부팅합니다:
# virsh start YourGuestName
kudzu
는 "Realtek 네트워크 장치 사용 또는 삭제" 및 "xen-bridge 장치 설정"을 요청하게 됩니다.
dom0
), the "noapic
" parameter should be added to the kernel boot line in your virtual guest's /boot/grub/grub.conf
entry as seen below. Keep in mind your architecture and kernel version may be different.
kernel /vmlinuz-2.6.9-67.EL ro root=/dev/VolGroup00/rhel4_x86_64 rhgb noapic
[root@rhel4]# cat /proc/partitions major minor #blocks name 3 0 10485760 hda 3 1 104391 hda1 3 2 10377990 hda2 202 0 64000 xvdb 202 1 32000 xvdb1 202 2 32000 xvdb2 253 0 8257536 dm-0 253 1 2031616 dm-1
xvdb
” 장치를 시스템에서 사용할 수 있음을 알 수 있습니다.
[root@rhel4]# mkdir /mnt/pvdisk_p1 [root@rhel4]# mkdir /mnt/pvdisk_p2
[root@rhel4]# mount /dev/xvdb1 /mnt/pvdisk_p1 [root@rhel4]# mount /dev/xvdb2 /mnt/pvdisk_p2
[root@rhel4]# df /mnt/pvdisk_p1 Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvdb1 32000 15 31985 1% /mnt/pvdisk_p1
/etc/fstab
파일을 업데이트합니다. 다음 행을 추가합니다:
/dev/xvdb1 /mnt/pvdisk_p1 ext3 defaults 1 2 /dev/xvdb2 /mnt/pvdisk_p2 ext3 defaults 1 2
xen-vbd
드라이버가 자동으로 불러지지 않을 경우, 게스트에서 다음과 같은 명령을 실행합니다. %release는 반가상화 드라이버의 올바른 릴리즈 버전으로 대체합니다.
# insmod /lib/modules/'uname -r'/weak-updates/xenpv/%release/xen_vbd.ko
#shutdown -h now
” 명령 사용).
/etc/xen/<Your GuestsName>
에 있는 게스트 설정 파일을 편집합니다:
vif=
” 항목에서 “type=ioemu
” 항목을 삭제합니다.
xen-vbd
) 디스크 드라이버를 통해 액세스할 수 있게 합니다.
disk=
” 부분에 아래와 유사한 항목을 추가합니다. 원래의 “disk=
” 항목은 아래와 유사하게 나타납니다.
disk = [ "file:/var/lib/libvirt/images/rhel4_64_fv.dsk,hda,w"]
disk = [ "file:/var/lib/libvirt/images/rhel3_64_fv.dsk,hda,w", "tap:aio:/var/lib/libvirt/images/UserStorage.dsk,xvda,w" ]
tap:aio
” 명령을 사용합니다.
virsh
명령을 사용하여 가상 장치를 부팅합니다:
# virsh start YourGuestName
[root@rhel5]# ifconfig eth0
[root@rhel5]# cat /proc/partitions major minor #blocks name 3 0 10485760 hda 3 1 104391 hda1 3 2 10377990 hda2 202 0 64000 xvdb 202 1 32000 xvdb1 202 2 32000 xvdb2 253 0 8257536 dm-0 253 1 2031616 dm-1
xvdb
” 장치를 시스템에서 사용할 수 있음을 알 수 있습니다.
[root@rhel5]# mkdir /mnt/pvdisk_p1 [root@rhel5]# mkdir /mnt/pvdisk_p2
[root@rhel5]# mount /dev/xvdb1 /mnt/pvdisk_p1 [root@rhel5]# mount /dev/xvdb2 /mnt/pvdisk_p2
[root@rhel5]# df /mnt/pvdisk_p1 Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvdb1 32000 15 31985 1% /mnt/pvdisk_p1
/etc/fstab
파일을 업데이트합니다. 다음 행을 추가합니다:
/dev/xvdb1 /mnt/pvdisk_p1 ext3 defaults 1 2 /dev/xvdb2 /mnt/pvdisk_p2 ext3 defaults 1 2
dom0
), the "noapic
" parameter should be added to the kernel boot line in your virtual guest's /boot/grub/grub.conf
entry as seen below. Keep in mind your architecture and kernel version may be different.
kernel /vmlinuz-2.6.9-67.EL ro root=/dev/VolGroup00/rhel4_x86_64 rhgb noapic
/etc/modprobe.d/blacklist
file. Blacklist 8139cp
and 8139too
for the RealTek 8139 and e1000
for the virtualized Intel e1000 NIC.
8139cp
8139too
e1000
/etc/sysconfig/network-scripts
directory.
xen_emul_unplug=never
virt-manager
에서 게스트 용 콘솔 화면을 열고 root
로 로그인합니다.
alias eth0 xen-vnif
” 행이 들어있는 /etc/modprobe.conf
파일을 확인합니다.
# cat /etc/modprobe.conf alias eth0 xen-vnif
eth0
execute “# ifconfig eth0
”. If you receive an error about the device not existing you should load the modules manually as outlined in 36.4절. “반가상화 드라이버를 수동으로 불러오기 ”.
ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:00:00:6A:27:3A BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:630150 errors:0 dropped:0 overruns:0 frame:0 TX packets:9 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:109336431 (104.2 MiB) TX bytes:846 (846.0 b)
# system-config-network
”. Click on the “ ” button to start the network card configuration.
ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:16:3E:49:E4:E0 inet addr:192.168.78.180 Bcast:192.168.79.255 Mask:255.255.252.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:630150 errors:0 dropped:0 overruns:0 frame:0 TX packets:501209 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:109336431 (104.2 MiB) TX bytes:46265452 (44.1 MiB)
/etc/xen/YourGuestName
에 있는 게스트 설정 파일을 편집합니다. 여기서 YourGuestName
은 게스트 이름으로 대체합니다.
vif = [ "mac=00:16:3e:2e:c5:a9,bridge=xenbr0" ]
vif=
” 부분에 추가 항목을 더합니다.
vif = [ "mac=00:16:3e:2e:c5:a9,bridge=xenbr0", "mac=00:16:3e:2f:d5:a9,bridge=xenbr0" ]
# echo 'import virtinst.util ; print virtinst.util.randomMAC()' | python
/etc/modules.conf
에 Red Hat Enterprise Linux 4 및 Red Hat Enterprise Linux 5에서는 /etc/modprobe.conf
에 업데이트가 추가되었는지를 확인합니다. 추가한 각각의 새 인터페이스에 대해 새 알리아스를 추가합니다.
alias eth1 xen-vnif
# ifconfig eth1
system-config-network
를 사용하거나 Red Hat Enterprise Linux3에서 redhat-config-network
를 사용하여 새 네트워크 인터페이스를 설정합니다.
/etc/xen/YourGuestName
에서 YourGuestName
을 게스트 이름으로 변경하여 게스트 설정 파일을 편집합니다. 원래 항목은 아래와 같이 나타납니다.
disk = [ "file:/var/lib/libvirt/images/rhel5_64_fv.dsk,hda,w"]
disk=
” 파라미터에 추가합니다. 반가상화 드라이버를 사용하는 저장 장치 항목은 아래와 유사하게 나타납니다. “tap:aio
” 파라미터는 반가상화 드라이버를 사용하기 위해 하이퍼바이저에 지시합니다.
disk = [ "file:/var/lib/libvirt/images/rhel5_64_fv.dsk,hda,w", "tap:aio:/var/lib/libvirt/images/UserStorage1.dsk,xvda,w" ]
disk=
” 부분에 추가합니다.
xvd
' device, that is for your second storage entity it would be 'xvdb
' instead of 'xvda
'.
disk = [ "file:/var/lib/libvirt/images/rhel5_64_fv.dsk,hda,w", "tap:aio:/var/lib/libvirt/images/UserStorage1.dsk,xvda,w", "tap:aio:/var/lib/libvirt/images/UserStorage2.dsk,xvdb,w" ]
# cat /proc/partitions major minor #blocks name 3 0 10485760 hda 3 1 104391 hda1 3 2 10377990 hda2 202 0 64000 xvda 202 1 64000 xvdb 253 0 8257536 dm-0 253 1 2031616 dm-1
xvdb
”가 시스템에서 사용 가능함을 알 수 있습니다.
/etc/fstab
을 업데이트하여 부팅시 장치 및 파티션을 마운트하게 합니다.
# mkdir /mnt/pvdisk_xvda # mkdir /mnt/pvdisk_xvdb # mount /dev/xvda /mnt/pvdisk_xvda # mount /dev/xvdb /mnt/pvdisk_xvdb # df /mnt Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvda 64000 15 63985 1% /mnt/pvdisk_xvda /dev/xvdb 64000 15 63985 1% /mnt/pvdisk_xvdb
드라이버 다운로드
yum
command.
# yum install virtio-win
/usr/share/virtio-win/
디렉토리에 CD-ROM 이미지, virtio-win.iso
를 설치합니다.
반가상화 드라이버 설치
virt-manager
사용 ” to add a CD-ROM image with virt-manager
and then install the drivers.
virt-manager
사용 Open virt-manager and the virtualized guest
virt-manager
, select your virtualized guest from the list by double clicking the guest name.
Open the hardware tab
Select the device type
Select the ISO file
/usr/share/virtio-win/virtio-win.iso
.
Disc assigned
Reboot
Open My Computer
Select the correct installation files
RHEV-Block.msi
for 32-bit guests or RHEV-Block64.msi
for 64-bit guests),
RHEV-Network.msi
for 32-bit guests or RHEV-Block64.msi
for 64-bit guests),
Install the block device driver
Start the block device driver installation
RHEV-Block.msi
or RHEV-Block64.msi
.
Confirm the exception
Finish
Install the network device driver
Start the network device driver installation
RHEV-Network.msi
or RHEV-Network64.msi
.
Performance setting
Value | Action |
---|---|
0 | Disable TCP timestamps and window scaling. |
1 | Enable TCP window scaling. |
2 | Enable TCP timestamps. |
3 | Enable TCP timestamps and window scaling. |
Confirm the exception
Finish
Reboot
viostor.vfd
를 플로피로 첨부합니다
Windows Server 2003
Windows Server 2008
virtio
driver instead of virtualized IDE driver. This example edits libvirt configuration files. Alternatively, virt-manager
, virsh attach-disk
or virsh attach-interface
can add a new device using the para-virtualized drivers 13.4절. “새 장치에 대해 KVM 반가상화 드라이버 사용 ”.
<disk type='file' device='disk'> <source file='/var/lib/libvirt/images/disk1.img'/> <target dev='vda' bus='ide'/> </disk>
virtio
로 수정하여 반가상화 장치를 사용하도록 항목을 변경합니다.
<disk type='file' device='disk'>
<source file='/var/lib/libvirt/images/disk1.img'/>
<target dev='vda' bus='virtio'/>
</disk>
virt-manager
로 KVM 반가상화 드라이버를 사용하여 새 장치를 생성하는 방법에 대해 설명합니다.
virsh attach-disk
또는 virsh attach-interface
명령으로 반가상화 드라이버를 사용하여 장치를 부착할 수 있습니다.
virt-manager
에 있는 게스트 이름을 더블 클릭하여 가상 게스트를 엽니다.
Enable the Intel VT-d extensions
Activate Intel VT-d in the kernel
intel_iommu=on
parameter to the kernel line of the kernel line in the /boot/grub/grub.conf
file.
grub.conf
file with Intel VT-d activated.
default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Red Hat Enterprise Linux Server (2.6.18-190.el5) root (hd0,0) kernel /vmlinuz-2.6.18-190.el5 ro root=/dev/VolGroup00/LogVol00 intel_iommu=on initrd /initrd-2.6.18-190.el5.img
Ready to use
Enable AMD IOMMU extensions
iommu=on
parameter to the hypervisor command line. Modify the /boot/grub/grub.conf
file as follows to enable PCI passthrough:
default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Red Hat Enterprise Linux Server (2.6.18-192.el5) root (hd0,0) kernel /xen.gz-2.6.18-192.el5 iommu=on module /vmlinuz-2.6.18-192.el5xen ro root=/dev/VolGroup00/LogVol00 module /initrd-2.6.18-190.el5xen.img
pci_8086_3a6c
, and a fully virtualized guest named win2k3
.
Identify the device
virsh nodedev-list
command lists all devices attached to the system. The --tree
option is useful for identifying devices attached to the PCI device (for example, disk controllers and USB controllers).
# virsh nodedev-list --tree
# virsh nodedev-list | grep pci
****
is a four digit hexadecimal code):
pci_8086_****
lspci
output to lspci -n
(which turns off name resolution) output can assist in deriving which device has which device identifier code.
virsh nodedev-dumpxml
command:
# virsh nodedev-dumpxml pci_8086_3a6c <device> <name>pci_8086_3a6c</name> <parent>computer</parent> <capability type='pci'> <domain>0</domain> <bus>0</bus> <slot>26</slot> <function>7</function> <id='0x3a6c'>82801JD/DO (ICH10 Family) USB2 EHCI Controller #2</product> <vendor id='0x8086'>Intel Corporation</vendor> </capability> </device>
# virsh nodedev-dettach pci_8086_3a6c Device pci_8086_3a6c dettached
$ printf %x 0 0 $ printf %x 26 1a $ printf %x 7 7
bus='0x00' slot='0x1a' function='0x7'
virsh edit
(or virsh attach device) and add a device entry in the <devices>
section to attach the PCI device to the guest. Only run this command on offline guests. Red Hat Enterprise Linux does not support hotplugging PCI devices at this time.
# virsh edit win2k3
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x00' slot='0x1a' function='0x7'/>
</source>
</hostdev>
ehci
driver is loaded by default for the USB PCI controller.
$ readlink /sys/bus/pci/devices/0000\:00\:1d.7/driver ../../../bus/pci/drivers/ehci_hcd
$ virsh nodedev-dettach pci_8086_3a6c
$ readlink /sys/bus/pci/devices/0000\:00\:1d.7/driver ../../../bus/pci/drivers/pci-stub
# setsebool -P virt_use_sysfs 1
# virsh start win2k3
virt-manager
tool. The following procedure adds a 2 port USB controller to a virtualized guest.
Identify the device
virsh nodedev-list
command lists all devices attached to the system. The --tree
option is useful for identifying devices attached to the PCI device (for example, disk controllers and USB controllers).
# virsh nodedev-list --tree
# virsh nodedev-list | grep pci
****
is a four digit hexadecimal code):
pci_8086_****
lspci
output to lspci -n
(which turns off name resolution) output can assist in deriving which device has which device identifier code.
Detach the PCI device
# virsh nodedev-dettach pci_8086_3a6c Device pci_8086_3a6c dettached
Power off the guest
Open the hardware settings
Add the new device
Select a PCI device
Confirm the new device
--host-device
parameter.
Identify the PCI device
virsh nodedev-list
command lists all devices attached to the system. The --tree
option is useful for identifying devices attached to the PCI device (for example, disk controllers and USB controllers).
# virsh nodedev-list --tree
# virsh nodedev-list | grep pci
****
is a four digit hexadecimal code):
pci_8086_****
lspci
output to lspci -n
(which turns off name resolution) output can assist in deriving which device has which device identifier code.
Add the device
virsh nodedev
command as the value for the --host-device
parameter.
# virt-install \
-n hostdev-test -r 1024 --vcpus 2 \
--os-variant fedora11 -v --accelerate \
-l http://download.fedoraproject.org/pub/fedora/linux/development/x86_64/os \
-x 'console=ttyS0 vnc' --nonetworks --nographics \
--disk pool=default,size=8 \
--debug --host-device=pci_8086_10bd
Complete the installation
/etc/modprobe.conf
hides the device from dom0. Either the bnx2
module must be reloaded or the host must be restarted.
install bnx2 /sbin/modprobe pciback; /sbin/modprobe --first-time --ignore-install bnx2 options pciback hide=(0000:09:00.0)
/etc/modprobe.conf
to hide multiple devices.
options pciback hide=(0000:09:00.0)(0000:0a:04.1)
virsh
(14.1절. “Adding a PCI device with virsh” - Step 5);
virt-manager
(14.2절. “Adding a PCI device with virt-manager”); or
virt-install
(14.3절. “PCI passthrough with virt-install”)
/boot/grub/grub.conf
file to enable SR-IOV. To enable SR-IOV with Xen for Intel systems append the pci_pt_e820_access=on
parameter to the kernel.
default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Red Hat Enterprise Linux Server (2.6.18-192.el5xen) root (hd0,0) kernel /xen.gz-2.6.18-192.el5 iommu=1 module /vmlinuz-2.6.18-192.el5xen ro root=/dev/VolGroup00/LogVol00 pci_pt_e820_access=on module /initrd-2.6.18-192.el5xen.img
Enable Intel VT-d in BIOS and in the kernel
Verify support
lspci
command to verify if the device was detected.
# lspci 03:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01) 03:00.1 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
Start the SR-IOV kernel modules
modprobe
command. The Intel 82576 network interface card uses the igb
driver kernel module.
# modprobe igb [<option>=<VAL1>,<VAL2>,] # lsmod |grep igb igb 87592 0 dca 6708 1 igb
Activate Virtual Functions
max_vfs
parameter of the igb
module allocates the maximum number of Virtual Functions. The max_vfs
parameter causes the driver to spawn, up to the value of the parameter in, Virtual Functions. For this particular card the valid range is 0
to 7
.
# modprobe -r igb
max_vfs
set to 1
or any number of Virtual Functions up to the maximum supported by your device.
# modprobe igb max_vfs=1
Inspect the new Virtual Functions
lspci
command, list the newly added Virtual Functions attached to the Intel 82576 network device.
# lspci | grep 82576 03:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01) 03:00.1 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01) 03:10.0 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 03:10.1 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
-n
parameter of the lspci
command.
# lspci -n | grep 03:00.0 03:00.0 0200: 8086:10c9 (rev 01) # lspci -n | grep 03:10.0 03:10.0 0200: 8086:10ca (rev 01)The Physical Function corresponds to
8086:10c9
and the Virtual Function to 8086:10ca
.
Find the devices with virsh
virsh nodedev-list
command to list available host devices.
# virsh nodedev-list | grep 8086
pci_8086_10c9
pci_8086_10c9_0
pci_8086_10ca
pci_8086_10ca_0
[output truncated]
Get advanced details
pci_8086_10c9
is one of the Physical Functions and pci_8086_10ca_0
is the first corresponding Virtual Function for that Physical Function. Use the virsh nodedev-dumpxml
command to get advanced output for both devices.
# virsh nodedev-dumpxml pci_8086_10ca # virsh nodedev-dumpxml pci_8086_10ca_0 <device> <name>pci_8086_10ca_0</name> <parent>pci_8086_3408</parent> <driver> <name>igbvf</name> </driver> <capability type='pci'> <domain>0</domain> <bus>3</bus> <slot>16</slot> <function>1</function> <product id='0x10ca'>82576 Virtual Function</product> <vendor id='0x8086'>Intel Corporation</vendor> </capability> </device>
pci_8086_10ca_0
to the guest in 단계 8. Note the bus
, slot
and function
parameters of the Virtual Function, these are required for adding the device.
Add the Virtual Function to the guest
virsh nodedev-dumpxml pci_8086_10ca_0
command to calculate the values for the configuration file. Convert slot and function values to hexadecimal values (from decimal) to get the PCI bus addresses. Append "0x" to the beginning of the output to tell the computer that the value is a hexadecimal number.
printf
utility to convert decimal values to hexadecimal values.
$ printf %x 3 3 $ printf %x 16 10 $ printf %x 1 1
bus='0x03' slot='0x10' function='0x01'
virsh edit
command. This example edits a guest named MyGuest
.
# virsh edit MyGuest
devices
section of the XML configuration file.
<hostdev mode='subsystem' type='pci' managed='yes'> <source> <address bus='0x03' slot='0x10' function='0x01'/> </source> </hostdev>
Restart
# virsh start MyGuest
# virsh start test error: Failed to start domain test error: internal error unable to start guest: char device redirected to /dev/pts/2 get_real_device: /sys/bus/pci/devices/0000:03:10.0/config: Permission denied init_assigned_device: Error: Couldn't get real device (03:10.0)! Failed to initialize assigned device host=03:10.0
ntpd
서비스를 활성화합니다:
# service ntpd start
# chkconfig ntpd on
ntpd
서비스를 사용는 것은 모든 경우 클럭 스큐 (clock skew)의 효과를 최소화하는 것입니다.
constant_tsc
플래그가 있으면 CPU는 constant TSC (Time Stamp Counter)를 갖습니다. CPU가 constant_tsc
플래그를 갖고 있는지 확인하려면 다음 명령을 실행합니다:
$ cat /proc/cpuinfo | grep constant_tsc
constant_tsc
비트를 갖습니다. 출력이없는 경우에는 다음의 지시를 따르십시오.
constant_tsc
비트가 없는 경우 모든 전원 관리 기능 (BZ#513138)을 비활성화합니다. 각 시스템은 여러 타이머를 사용하여 시간을 유지합니다. TSC는 호스트에서 불안정하므로 cpufreq
변경, deep C 상태, 보다 빠른 TSC가 있는 호스트로의 이전의 원인이 됩니다. Deep C sleep 상태에서는 TSC를 중지시킬 수 있습니다. 커널이 deep C 상태를 사용하지 못하게 하려면 호스트 상의 grub.conf
파일에 있는 커널 부팅 옵션에 "processor.max_cstate=1
" 을 추가합니다:
term Red Hat Enterprise Linux Server (2.6.18-159.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-159.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet processor.max_cstate=1
/etc/sysconfig/cpuspeed
설정 파일을 편집하여 cpufreq
를 비활성화하고 (constant_tsc
가 없는 호스트에서만) MIN_SPEED
및 MAX_SPEED
변수를 사용할 수 있는 최상의 주파수로 변경합니다. 유효 한계는 /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies
에서 확인하실 수 있습니다.
Red Hat Enterprise Linux | 추가 게스트 커널 파라미터 |
---|---|
반가상화 클럭이 있는 5.4 AMD64/Intel 64 | 추가 파라미터가 필요하지 않음 |
반가상화 클럭이 없는 5.4 AMD64/Intel 64 | divider=10 notsc lpj=n |
반가상화 클럭이 있는 5.4 x86 | 추가 파라미터가 필요하지 않음 |
반가상화 클럭이 없는 5.4 x86 | divider=10 clocksource=acpi_pm lpj=n |
5.3 AMD64/Intel 64 | divider=10 notsc |
5.3 x86 | divider=10 clocksource=acpi_pm |
4.8 AMD64/Intel 64 | notsc divider=10 |
4.8 x86 | clock=pmtmr divider=10 |
3.9 AMD64/Intel 64 | 추가 파라미터가 필요하지 않음 |
3.9 x86 | 추가 파라미터가 필요하지 않음 |
boot.ini
파일에 추가합니다:
/use pmtimer
boot.ini
file is no longer used from Windows Vista and newer. Windows Vista, Windows Server 2008 and Windows 7 use the Boot Configuration Data Editor (bcdedit.exe
) to modify the Windows boot parameters.
{default}
in the example below) should be changed if the system UUID is different than the default boot device.
C:\Windows\system32>bcdedit /set {default} USEPLATFORMCLOCK on The operation completed successfully
# setenforce 1
AutoFS
, NFS
, FTP
, HTTP
, NIS
, telnetd
, sendmail
등과 같은 불필요한 서비스를 삭제 또는 비활성화합니다.
/var/lib/libvirt/images/
아래에 저장되어야 합니다. 가상 장치 이미지에 대해 다른 디렉토리를 사용하고 계실 경우 설치 시작 전 SELinux 정책에 해당 디렉토리를 추가하고 이를 다시 레이블하였는지를 확인합니다.
vsftpd
서버에 저장됩니다.
fstab
file, the initrd
file or used by the kernel command line. If less privileged users, especially virtualized guests, have write access to whole partitions or LVM volumes.
/dev/sdb
). Use partitions (for example, /dev/sdb1
) or LVM volumes.
virt_image_t
label applied to them. The /var/lib/libvirt/images
directory has this label applied to it and its contents by default. This does not mean that images must be stored in this directory; images can be stored anywhere, provided they are labeled with virt_image_t
.
volumegroup
이라는 볼륨 그룹에 NewVolumeName
이라는 5 기가 바이트의 논리 볼륨을 생성하고 있습니다.
# lvcreate -nNewVolumeName
-L5G volumegroup
NewVolumeName
논리 볼륨을 ext3와 같은 확장 속성을 지원하는 파일 시스템으로 포맷합니다.
# mke2fs -j /dev/volumegroup/NewVolumeName
/etc
, /var
, /sys
) 또는 홈 디렉토리 (/home
또는 /root
)에 배치하지 않는 것이 좋습니다. 이 예제에서는 /virtstorage
라는 디렉토리를 사용하고 있습니다.
# mkdir /virtstorage
# mount /dev/volumegroup/NewVolumeName /virtstorage
semanage fcontext -a -t xen_image_t "/virtstorage(/.*)?"
semanage fcontext -a -t virt_image_t "/virtstorage(/.*)?"
/etc/selinux/targeted/contexts/files/file_contexts.local
파일에 행을 추가하여 변경 사항을 영구화할 수 있습니다. 추가되는 행은 다음과 유사합니다:
/virtstorage(/.*)? system_u:object_r:xen_image_t:s0
/dev/volumegroup/NewVolumeName
with the correct label:
# semanage fcontext -a -t xen_image_t /dev/volumegroup/NewVolumeName # restorecon /dev/volumegroup/NewVolumeName
# semanage fcontext -a -t xen_image_t -f -b /dev/sda2 # restorecon /dev/sda2
xend_disable_t
는 데몬을 다시 시작한 후 xend
를 자유 모드에 설정할 수 있습니다. 전체 시스템 보다 하나의 데몬에 대한 보안 기능을 비활성화하는 것이 좋습니다. 디렉토리를 다른 위치에서 사용할 수 있는 xen_image_t
로 다시 레이블하지 않을 것을 권장합니다.
SELinux Boolean | Description |
---|---|
allow_unconfined_qemu_transition | Default: off. This boolean controls whether KVM guests can be transitioned to unconfined users. |
qemu_full_network | Default: on. This boolean controls full network access to KVM guests. |
qemu_use_cifs | Default: on. This boolean controls KVM's access to CIFS or Samba file systems. |
qemu_use_comm | Default: off. This boolean controls whether KVM can access serial or parallel communications ports. |
qemu_use_nfs | Default: on. This boolean controls KVM's access to NFS file systems. |
qemu_use_usb | Default: on. This boolean allows KVM to access USB devices. |
net.ipv4.ip_forward = 1
) is required for virtual bridge devices. Note that installing libvirt enables this variable so it will be enabled when the virtualization packages are installed unless it was manually disabled.
xend
를 사용한 게스트 관리 /etc/xen/xend-config.sxp
라는 xend 설정 파일을 편집하여 운영 파라미터를 지정해야 합니다. 다음은 xend-config.sxp
설정 파일에서 활성화 또는 비활성화할 수 있는 파라미터를 보여줍니다:
아이템 | 설명 |
---|---|
(console-limit)
|
Determines the console server's memory buffer limit and assigns that limit on a per domain basis.
|
(min-mem)
|
domain0에 사용되는 메가바이트의 최소 수를 결정합니다 (0을 입력하면, 값은 변하지 않음).
|
(dom0-cpus)
|
domain0에서 사용되는 CPU 개수를 결정합니다 (기본값으로 최소 1 CPU 할당됨).
|
(enable-dump)
|
활성화되어 있을 경우, 충돌 발생 시 Xen은 덤프 파일을 생성합니다. (기본값: 0)
|
(external-migration-tool)
|
외부 장치 이전을 제어하는 스크립트 또는 어플리케이션을 지정합니다. 스크립트는 반드시
/etc/xen/scripts/external-device-migrate 디렉토리에 있어야 합니다.
|
(logfile)
|
로그 파일의 위치를 결정합니다 (기본값:
/var/log/xend.log ).
|
(loglevel)
|
로그 모드 값을 선별합니다: DEBUG, INFO, WARNING, ERROR, CRITICAL (기본값: DEBUG).
|
(network-script)
|
네트워크 환경을 활성화하는 스크립트를 지정합니다. 스크립트는
/etc/xen/scripts/ 디렉토리에 있어야 합니다.
|
(xend-http-server)
|
http 스트림 패킷 관리 서버를 활성화합니다 (기본값: no).
|
(xend-unix-server)
|
UNIX 도메인 소켓 서버를 활성화합니다. 소켓 서버는 낮은 수준의 네트워크 연결을 처리하는 통신 종단점으로 들어오는 연결을 허용하거나 거부합니다. 기본값은 yes로 설정되어 있습니다.
|
(xend-relocation-server)
|
장치 교체 이전을 위한 재배치 서버를 활성화합니다 (기본값: no).
|
(xend-unix-path)
|
xend-unix-server 명령 출력 데이터가 있는 위치를 지정합니다. (기본값: /var/lib/xend/xend-socket )
|
(xend-port)
|
http 관리 서버가 사용하는 포트를 결정합니다 (기본값: 8000).
|
(xend-relocation-port)
|
재배치 서버가 사용하는 포트를 결정합니다 (기본값: 8002).
|
(xend-relocation-address)
|
시스템 이전에 사용되는 호스트 주소를 결정합니다. 기본값은
xend-address 값입니다.
|
(xend-address)
|
도메인 소켓 서버가 바인드하는 주소를 결정합니다. 기본값은 모든 접속을 허용하는 것입니다.
|
service xend start
service xend stop
service xend restart
service xend status
xend
활성화 chkconfig
명령을 사용하여 initscript
에 xend
를 추가합니다.
chkconfig --level 345 xend
xend
는 런레벨 3, 4, 5에서 시작됩니다.
virsh migrate
명령을 사용합니다.
# virsh migrateGuestName
libvirtURI
virsh migrate
명령의 --live
옵션을 사용합니다.
# virsh migrate--liveGuestName
libvirtURI
/etc/xen/xend-config.sxp
설정 파일에 일부 사항을 변경해야 합니다. 이전 기능은 잘못 설정되어 있을 경우 보안에 잠재적으로 영향을 미칠 수 있으므로 기본값으로 비활성화되어 있습니다. 이전 포트를 열어두면 인증되지 않은 호스트가 이전 포트로의 연결이나 이전을 초기화하게 할 수 있습니다. 이전 요청을 위해 인증이 설정되어 있지 않으므로 제어 메카니즘을 호스트 및 IP 주소에만 기반하게 되므로 이전 포트가 인증되지 않은 호스트에 액세스할 수 없는지를 각별히 주의하여 확인합니다.
/etc/xen/xend-config.sxp
에 있는 다음의 항목을 수정합니다. 필요시 값을 수정하고 다음과 같은 파라미터 앞의 주석 (#
)을 삭제합니다:
(xend-relocation-server yes)
no
입니다. xend-relocation-server
의 값을 yes
로 변경하면 이전 기능을 활성화하게 됩니다.
(xend-relocation-port 8002)
xend-relocation-server
가 yes
로 설정되어 있을 경우, 파라미터 (xend-relocation-port)
는 재배치 인터페이스 용으로 사용할 xend
포트를 지정합니다.
xend-relocation-port
파라미터에 의해 설정된 포트는 양쪽 시스템 모두에서 열려있어야 합니다.
(xend-relocation-address '')
xend-relocation-server
가 설정되어 있을 경우 (xend-relocation-address)
는 xend
가 relocation-socket
연결에서의 이전 명령에 대해 청취해야 하는 주소입니다.
(xend-relocation-address)
parameter restricts the migration server to only listen to a specific interface. The default value in /etc/xen/xend-config.sxp
is an empty string(''
). This value should be replaced with a single, valid IP address. For example:
(xend-relocation-address '10.0.0.1')
(xend-relocation-hosts-allow '')
(xend-relocation-hosts-allow 'hosts')
parameter controls which hostnames can communicate on the relocation port.
xend-relocation-hosts-allow
option to restrict access to the migration server.
xend-relocation-port
및 xend-relocation-address
도 살펴보시기 바랍니다.
(xend-relocation-hosts-allow)
파라미터는 빈 칸으로 구분된 정규 표현식 순서로 되어야 합니다. 이러한 정규 표현식과 일치하는 FQDN 또는 IP 주소로된 호스트는 허용됩니다.
(xend-relocation-hosts-allow)
속성의 예:
(xend-relocation-hosts-allow '^localhost$ ^localhost\\.localdomain$')
# service xend restart
et-virt07
및 et-virt08
)로 구성되어 있으며, 두 서버 모두 기본값 네트워크 인터페이스로 eth1
을 사용하고 있는 반면 Xen 네트워크 브리지로 xenbr1
을 사용하고 있습니다. NFS를 사용하는 저장 장치 공유 용으로 et-virt07
상에 로컬로 부착된 SCSI 디스크 (/dev/sdb
)를 사용하고 있습니다.
# mkdir /var/lib/libvirt/images # mount /dev/sdb /var/lib/libvirt/images
/var/lib/libvirt/images/
를 내보내고 있을 경우 이 디렉토리는 xend
데몬 및 기타 다른 도구에 의해 사용되고 있으므로 /var/lib/xen/
이 아닌 /var/lib/libvirt/images/
만을 내보내고 있는지를 확인합니다. /var/lib/xen/
공유는 예기치 않는 작동의 원인이 될 수 있습니다.
# cat /etc/exports /var/lib/libvirt/images *(rw,async,no_root_squash)
# showmount -e et-virt07 Export list for et-virt07: /var/lib/libvirt/images *
# virt-install -p -f /var/lib/libvirt/images/testvm1
.dsk -s 5 -n\testvm1
--vnc -r 1024 -l http://example.com/RHEL5-tree\ Server/x86-64/os/ -b xenbr1
[et-virt08 ~]# brctl show bridge name bridge id STP enabled interfaces xenbr1 8000.feffffffffff no peth1 vif0.1
[et-virt07 ~]# brctl show bridge name bridge id STP enabled interfaces xenbr1 8000.feffffffffff no peth1 vif0.1
[et-virt07 ~]# grep xend-relocation /etc/xen/xend-config.sxp |grep -v '#' (xend-relocation-server yes) (xend-relocation-port 8002) (xend-relocation-address '') (xend-relocation-hosts-allow '')
[et-virt08 ~]# grep xend-relocation /etc/xen/xend-config.sxp |grep -v '#' (xend-relocation-server yes) (xend-relocation-port 8002) (xend-relocation-address '') (xend-relocation-hosts-allow '')
[et-virt07 ~]# lsof -i :8002 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME python 3445 root 14u IPv4 10223 TCP *:teradataordbms (LISTEN)
[et-virt08 ~]# lsof -i :8002 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME python 3252 root 14u IPv4 10901 TCP *:teradataordbms (LISTEN)
/var/lib/libvirt/images
directory is available and mounted with networked storage on both hosts. Shared, networked storage is required for migrations.
[et-virt08 ~]# df /var/lib/libvirt/images Filesystem 1K-blocks Used Available Use% Mounted on et-virt07:/var/lib/libvirt/images 70562400 2379712 64598336 4% /var/lib/libvirt/images
[et-virt08 ~]# file /var/lib/libvirt/images/testvm1
.dsk /var/lib/libvirt/images/testvm1
.dsk: x86 boot sector; partition 1: ID=0x83, active, starthead 1, startsector 63, 208782 sectors; partition 2: ID=0x8e, starthead 0, startsector 208845, 10265535 sectors, code offset 0x48
[et-virt08 ~]# touch /var/lib/libvirt/images/foo [et-virt08 ~]# rm -f /var/lib/libvirt/images/foo
[et-virt07 ~]# virsh list Id Name State ---------------------------------- Domain-0 running
[et-virt07 ~]# virsh starttestvm1
Domaintestvm1
started
[et-virt07 ~]# virsh list
Id Name State
----------------------------------
Domain-0 running
testvm1
blocked
[et-virt07 images]# time virsh savetestvm1
testvm1
.sav real 0m15.744s user 0m0.188s sys 0m0.044s
[et-virt07 images]# ls -lrttestvm1
.sav -rwxr-xr-x 1 root root 1075657716 Jan 12 06:46testvm1
.sav
[et-virt07 images]# virsh list Id Name State ---------------------------------- Domain-0 running
[et-virt07 images]# virsh restore testvm1
.sav
[et-virt07 images]# virsh list
Id Name State
----------------------------------
Domain-0 running
testvm1
blocked
domain-id
from et-virt08
to et-virt07
. The hostname you are migrating to and <domain-id> must be replaced with valid values. This example uses the et-virt08
host which must have SSH access to et-virt07
[et-virt08 ~]# xm migrate --live testvm1
et-virt07
et-virt08
[et-virt08 ~]# virsh list Id Name State ---------------------------------- Domain-0 running
et-virt07
:
[et-virt07 ~]# virsh list
Id Name State
----------------------------------
Domain-0 running
testvm1
running
#!/bin/bash while true do touch /var/tmp/$$.log echo `hostname` >> /var/tmp/$$.log echo `date` >> /var/tmp/$$.log cat /var/tmp/$$.log df /var/tmp ls -l /var/tmp/$$.log sleep 3 done
et-virt07
로 이전하기 전에 가상 장치가 et-virt08에서 실행되는지를 확인합니다:
[et-virt08 ~]# virsh list
Id Name State
----------------------------------
Domain-0 running
testvm1
blocked
et-virt07
에 실시간 이전을 초기화합니다. time
명령을 추가하여 이전에 얼마의 시간이 걸리는 지를 확인하실 수 있습니다:
[et-virt08 ~]# xm migrate --live testvm1
et-virt07
# ./doit dhcp78-218.lab.boston.redhat.com Fri Jan 12 02:26:27 EST 2007 Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VolGroup00-LogVol00 2983664 2043120 786536 73% / -rw-r--r-- 1 root root 62 Jan 12 02:26 /var/tmp/2279.log dhcp78-218.lab.boston.redhat.com Fri Jan 12 02:26:27 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 02:26:30 EST 2007 Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VolGroup00-LogVol00 2983664 2043120 786536 73% / -rw-r--r-- 1 root root 124 Jan 12 02:26 /var/tmp/2279.log dhcp78-218.lab.boston.redhat.com Fri Jan 12 02:26:27 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 02:26:30 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 02:26:33 EST 2007 Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VolGroup00-LogVol00 2983664 2043120 786536 73% / -rw-r--r-- 1 root root 186 Jan 12 02:26 /var/tmp/2279.log Fri Jan 12 02:26:45 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 02:26:48 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 02:26:51 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 06:54:57 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 06:55:00 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 06:55:03 EST 2007 Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VolGroup00-LogVol00 2983664 2043120 786536 73% / -rw-r--r-- 1 root root 744 Jan 12 06:55 /var/tmp/2279.log dhcp78-218.lab.boston.redhat.com Fri Jan 12 02:26:27 EST 2007
et-virt08
에서 종료되었는지를 확인합니다:
[et-virt08 ~]# virsh list Id Name State ---------------------------------- Domain-0 running
et-virt07
에서 시작되었는지를 확인합니다:
[et-virt07 images]# virsh list
Id Name State
----------------------------------
Domain-0 running
testvm1
blocked
et-virt07
에서 et-virt08
로 다른 이전 주기를 실행합니다. et-virt07
에서 et-virt08
로 이전을 초기화합니다:
[et-virt07 images]# xm migrate --live testvm1
et-virt08
[et-virt07 images]# virsh list Id Name State ---------------------------------- Domain-0 running
# ./doit dhcp78-218.lab.boston.redhat.com Fri Jan 12 06:57:53 EST 2007 Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VolGroup00-LogVol00 2983664 2043120 786536 73% / -rw-r--r-- 1 root root 62 Jan 12 06:57 /var/tmp/2418.log dhcp78-218.lab.boston.redhat.com Fri Jan 12 06:57:53 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 06:57:56 EST 2007 Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VolGroup00-LogVol00 2983664 2043120 786536 73% / -rw-r--r-- 1 root root 124 Jan 12 06:57 /var/tmp/2418.log dhcp78-218.lab.boston.redhat.com Fri Jan 12 06:57:53 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 06:57:56 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 06:58:00 EST 2007 Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VolGroup00-LogVol00 2983664 2043120 786536 73% / -rw-r--r-- 1 root root 186 Jan 12 06:57 /var/tmp/2418.log dhcp78-218.lab.boston.redhat.com Fri Jan 12 06:57:53 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 06:57:56 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 06:58:00 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 02:30:00 EST 2007 Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VolGroup00-LogVol00 2983664 2043120 786536 73% / -rw-r--r-- 1 root root 248 Jan 12 02:30 /var/tmp/2418.log dhcp78-218.lab.boston.redhat.com Fri Jan 12 06:57:53 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 06:57:56 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 06:58:00 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 02:30:00 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 02:30:03 EST 2007 Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VolGroup00-LogVol00 2983664 2043120 786536 73% / -rw-r--r-- 1 root root 310 Jan 12 02:30 /var/tmp/2418.log dhcp78-218.lab.boston.redhat.com Fri Jan 12 06:57:53 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 06:57:56 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 06:58:00 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 02:30:00 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 02:30:03 EST 2007 dhcp78-218.lab.boston.redhat.com Fri Jan 12 02:30:06 EST 2007 Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VolGroup00-LogVol00 2983664 2043120 786536 73% / -rw-r--r-- 1 root root 372 Jan 12 02:30 /var/tmp/2418.log
et-virt07
상에서 이전 명령을 완료한 후 et-virt08
에서 가상 장치가 시작되었는지를 확인합니다:
[et-virt08 ~]# virsh list
Id Name State
----------------------------------
Domain-0 running
testvm1
blocked
[et-virt08 ~]# time virsh migrate --live testvm1
et-virt07
real 0m10.378s
user 0m0.068s
sys 0m0.052s
xm migrate
명령을 사용하여 오프라인 방식으로 수행됩니다. 실시간 이전은 동일한 명령을 사용하여 실행될 수 있지만, xend-config
설정 파일에 몇 가지 수정 사항을 추가해야 합니다. 다음 예에서는 성공적인 이전을 위해 반드시 수정해야 하는 항목을 보여주고 있습니다:
(xend-relocation-server yes)
(xend-relocation-port 8002)
xend
가 이전에 사용할 포트를 설정합니다. 네트워크 환경이 사용자 설정 값을 요청하지 않을 경우 이 값을 사용합니다. 주석 처리를 제거하여 이를 활성화합니다.
(xend-relocation-address )
xend-relocation-server
를 활성화한 후, 재배치 소켓 연결을 청취하는 주소를 가리킵니다. Xen 하이퍼바이저는 특정 인터페이스에 있는 이전 네트워크 소통량 만을 청취합니다.
(xend-relocation-hosts-allow )
(xend-relocation-hosts-allow- '^localhost\\.localdomain$' )>
virsh
명령을 사용하여 게스트를 다른 호스트로 이전할 수 있습니다. migrate
명령은 다음과 같은 형식으로 파라미터를 허용합니다:
# virsh migrate --live GuestName DestinationURL
GuestName
파라미터는 이전하려는 게스트의 이름을 나타냅니다.
DestinationURL
파라미터는 대상 시스템의 URL 또는 호스트 이름입니다. 대상 시스템은 동일한 Red Hat Enterprise Linux 버전을 실행해야 하며, 동일한 하이퍼바이저를 사용하고 libvirt
를 실행하고 있어야 합니다.
test1.example.com
에서 test2.example.com
로 이전하고 있습니다. 사용자 환경에 따라 호스트 이름을 변경합니다. 예제에서는 RHEL4test
라는 가상 장치를 이전하고 있습니다.
실행되고 있는 게스트 확인
test1.example.com
소스 시스템에서 RHEL4test
가 실행되고 있는지 확인합니다:
[root@test1 ~]# virsh list Id Name State ---------------------------------- 10 RHEL4 running
게스트 이전
test2.example.com
으로 실시간 이전하기 위해 다음 명령을 실행합니다. /system
을 대상 URL의 마지막에 첨부하여 libvirt에게 완전 액세스가 필요함을 알립니다.
# virsh migrate --live RHEL4test qemu+ssh://test2.example.com/system
대기
virsh
는 오류만을 보고합니다. 게스트는 완전 이전될 때 까지 소스 호스트에서 계속 실행됩니다.
게스트가 대상 호스트에 도착하였는지 확인
test2.example.com
대상 시스템에서 RHEL4test
가 실행되고 있는지 확인합니다:
[root@test2 ~]# virsh list Id Name State ---------------------------------- 10 RHEL4 running
virt-manager
를 사용하여 KVM 기반 게스트를 이전하는 방법에 대해 설명합니다.
ssh
또는 TLS 및 SSL을 사용하여 가상 게스트를 원격 관리하는 방법에 대해 설명합니다.
libvirt
관리 연결 보안 터널을 사용합니다. SSH 공개키 암호화 방식 및 로컬 SSH 에이전트에 의한 암호 또는 암호 문구를 사용하여 모든 인증을 처리합니다. 각각의 게스트 가상 장치에 대해 VNC 콘솔은 SSH를 통해 터널링됩니다.
ssh
는 디폴트로 설정되므로 SSH 키가 이미 설정되어 있어 관리 서비스 또는 VNC 콘솔에 액세스하기 위해 추가로 방화벽 규칙을 설정할 필요가 없습니다.
virt-manager
virt-manager
must run as the user who owns the keys to connect to the remote host. That means, if the remote systems are managed by a non-root user virt-manager
must be run in unprivileged mode. If the remote systems are managed by the local root user then the SSH keys must be own and created by root.
virt-manager
.
Optional: Changing user
$ su -
Generating the SSH key pair
virt-manager
is used. This example uses the default key location, in the ~/.ssh/
directory.
$ ssh-keygen -t rsa
Coping the keys to the remote hosts
root@example.com
).
# ssh-copy-id -i ~/.ssh/id_rsa.pub root@example.com root@example.com's password: Now try logging into the machine, with "ssh 'root@example.com'", and check in: .ssh/authorized_keys to make sure we haven't added extra keys that you weren't expecting
Optional: Add the passphrase to the ssh-agent
ssh-agent
, if required. On the local host, use the following command to add the passphrase (if there was one) to enable password-less login.
# ssh-add ~/.ssh/id_rsa.pub
libvirt
데몬 (libvirtd
) libvirt
daemon provide an interface for managing virtual machines. You must have the libvirtd
daemon installed and running on every remote host that needs managing.
$ ssh root@somehost
# chkconfig libvirtd on
# service libvirtd start
libvirtd
및 SSH가 설정된 후 원격으로 액세스하여 가상 장치를 관리할 수 있어야 합니다. 이 때 VNC
를 사용하여 게스트를 액세스할 수 도 있어야 합니다.
libvirt
management connection opens a TCP port for incoming connections, which is securely encrypted and authenticated based on x509 certificates. In addition the VNC console for each guest virtual machine will be setup to use TLS with x509 certificate authentication.
libvirt
서버 설정 /etc/xen/xend-config.sxp
설정 파일을 편집하여 TLS를 활성화할 수 있습니다. 설정 파일에서 (vnc-tls 1)
설정 파라미터에 있는 주석을 삭제합니다.
/etc/xen/vnc
directory needs the following 3 files:
ca-cert.pem
- The CA certificate
server-cert.pem
- The Server certificate signed by the CA
server-key.pem
- The server private key
(vnc-x509-verify 1)
parameter.
virt-manager
및 virsh
클라이언트 설정 libvirt
관리 API를 활성화하려면 CA 및 클라이언트 인증서가 반드시 /etc/pki
에 위치해 있어야 합니다. 보다 자세한 내용은 http://libvirt.org/remote.html에서 참조하시기 바랍니다.
virt-manager
user interface, use the ' ' transport mechanism option when connecting to a host.
virsh
의 경우 URI는 다음과 같은 형식으로 되어 있습니다:
qemu://hostname.guestname/system
xen://hostname.guestname/
$HOME/.pki
에 위치해 있어야 합니, 즉 다음의 세 개의 파일이 이에 해당합니다:
ca-cert.pem
- CA 인증서
libvirt-vnc
또는 clientcert.pem
- CA에 의해 인증된 클라이언트 인증서
libvirt-vnc
또는 clientkey.pem
- 클라이언트 개인키
libvirt
는 다음과 같은 전송 모드를 지원합니다:
/var/run/libvirt/libvirt-sock
및 /var/run/libvirt/libvirt-sock-ro
입니다. (읽기 전용 연결의 경우)
libvirtd
)은 원격 장치 상에서 실행해야 합니다. 포트 22는 SSH 액세스에 대해 열려야 합니다. 일부 ssh 키 관리 종류를 사용 (예: ssh-agent
유틸리티)하거나 또는 암호를 입력하라는 메세지가 나타나게 됩니다.
ext
파라미터는 libvirt 범위 밖의 수단으로 원격 장치에 연결할 수 있는 외부 프로그램에 대해 사용됩니다. 이러한 파라미터는 지원되지 않습니다.
virsh
및 libvirt
에 의해 사용됩니다. URI는 원격 호스트에서 단일 명령이나 이전을 실행하기 위해 virsh
명령에 대해 --connect
파라미터와 함께 사용될 수 있습니다.
driver[+transport]://[username@][hostname][:port]/[path][?extraparameters]
ccurran
을 사용하여 towada
라는 호스트 상의 원격 Xen 하이퍼바이저로 연결합니다.
xen+ssh://ccurran@towada/
towada
라는 호스트 이름에서 원격 Xen 하이퍼바이저로 연결합니다.
xen://towada/
towada
using TLS. The no_verify=1
tells libvirt not to verify the server's certificate.
xen://towada/?no_verify=1
towada
호스트에 있는 원격 KVM 하이퍼바이저로 연결합니다.
qemu+ssh://towada/system
qemu+unix:///system?socket=/opt/libvirt/run/libvirt/libvirt-sock
test+tcp://10.1.1.10:5000/default
이름 | 전송 모드 | 설명 | 사용 예제 |
---|---|---|---|
이름 | 모든 모드 | 이름은 원격 virConnectOpen 함수에 전달됩니다. 주로 원격 URI에서 전송, 호스트 이름, 포트 번호, 사용자 이름, 추가 파라미터를 제거하여 이름이 형성되지만 특정한 경우 명시적으로 이름을 제공하는 것이 더 나을 수 있습니다. | name=qemu:///system |
명령 | ssh 및 ext | 외부 명령. ext 전송의 경우 필요합니다. ssh의 경우 기본값은 ssh입니다. 경로(PATH)는 명령으로 검색됩니다. | command=/opt/openssh/bin/ssh |
소켓 | unix 및 ssh | 기본값을 덮어쓰기하는 UNIX 도메인 소켓으로의 경로. ssh 전송의 경우, 이는 원격 netcat 명령으로 전달됩니다 (netcat 참조). | socket=/opt/libvirt/run/libvirt/libvirt-sock |
netcat | ssh |
netcat 명령을 사용하여 원격 시스템으로 연결할 수 있습니다. 기본 netcat 파라미터는 nc 명령을 사용합니다. SSH 전송의 경우, libvirt는 아래의 형식을 사용하여 SSH 명령을 구성합니다:
port , username , hostname 파라미터는 원격 URI의 부분으로 지정될 수 있습니다. command , netcat , socket 은 기타 다른 추가 파라미터에서 비롯됩니다.
| netcat=/opt/netcat/bin/nc |
no_verify | tls | If set to a non-zero value, this disables client checks of the server's certificate. Note that to disable server checks of the client's certificate or IP address you must change the libvirtd configuration. | no_verify=1 |
no_tty | ssh | 0이 아닌 값으로 설정되어 있을 경우, 자동으로 원격 장치에 로그인(ssh-agent 또는 이와 유사하게 사용)할 수 없으면 이는 암호를 요청하는 ssh를 중지하게 됩니다. | no_tty=1 |
차례
vmstat
iostat
lsof
# lsof -i :5900 xen-vncfb 10635 root 5u IPv4 218738 TCP grumble.boston.redhat.com:5900 (LISTEN)
qemu-img
systemTap
crash
xen-gdbserver
sysrq
sysrq t
sysrq w
sysrq c
brtcl
# brctl show bridge name bridge id STP enabled interfaces xenbr0 8000.feffffffffff no vif13.0 pdummy0 vif0.0
# brctl showmacs xenbr0 port no mac addr is local? aging timer 1 fe:ff:ff:ff:ff:ff yes 0.00
# brctl showstp xenbr0 xenbr0 bridge id 8000.feffffffffff designated root 8000.feffffffffff root port 0 path cost 0 max age 20.00 bridge max age 20.00 hello time 2.00 bridge hello time 2.00 forward delay 0.00 bridge forward delay 0.00 aging time 300.01 hello timer 1.43 tcn timer 0.00 topology change timer 0.00 gc timer 0.02 flags vif13.0 (3) port id 8003 state forwarding designated root 8000.feffffffffff path cost 100 designated bridge 8000.feffffffffff message age timer 0.00 designated port 8003 forward delay timer 0.00 designated cost 0 hold timer 0.43 flags pdummy0 (2) port id 8002 state forwarding designated root 8000.feffffffffff path cost 100 designated bridge 8000.feffffffffff message age timer 0.00 designated port 8002 forward delay timer 0.00 designated cost 0 hold timer 0.43 flags vif0.0 (1) port id 8001 state forwarding designated root 8000.feffffffffff path cost 100 designated bridge 8000.feffffffffff message age timer 0.00 designated port 8001 forward delay timer 0.00 designated cost 0 hold timer 0.43 flags
ifconfig
tcpdump
ps
pstree
top
kvmtrace
kvm_stat
xentop
xm dmesg
xm log
virsh
는 게스트 및 하이퍼바이저 관리를 위한 명령행 인터페이스 도구입니다.
virsh
도구는 libvirt
관리 API에 작성되며 xm 또는 그래픽형식 게스트 관리자 (virt-manager
)를 대체하는 도구로서 사용됩니다. virsh
는 비권한 사용자에 의해 읽기 전용 모드로 사용될 수 있습니다. virsh
를 사용하여 게스트 장치에 대한 스크립트를 실행할 수 있습니다.
명령 | 설명 |
---|---|
help
| 기본적인 도움말 정보를 출력합니다. |
list
| 모든 게스트를 나열합니다. |
dumpxml
| 게스트 용 XML 설정 파일을 출력합니다. |
create
| XML 설정 파일에서 게스트를 생성하고 새 게스트를 시작합니다. |
start
| 비활성화 게스트를 시작합니다. |
destroy
| 중지하기 위해 게스트를 강제합니다. |
define
| 게스트 용 XML 설정 파일을 출력합니다. |
domid
| Displays the guest's ID. |
domuuid
| Displays the guest's UUID. |
dominfo
| 게스트 정보를 보여줍니다. |
domname
| Displays the guest's name. |
domstate
| 게스트 상태를 보여줍니다. |
quit
| 상호 대화식 터미널을 종료합니다. |
reboot
| 게스트를 재부팅합니다. |
restore
| 파일에 복구된 이전에 저장한 게스트를 다시 복구합니다. |
resume
| 일시 중지된 게스트를 다시 시작합니다. |
save
| 게스트의 현재 상태를 파일에 저장합니다. |
shutdown
| 게스트를 종료합니다. |
suspend
| 게스트를 일시 중지합니다. |
undefine
| 게스트와 관련된 모든 파일을 삭제합니다. |
migrate
| 게스트를 다른 호스트로 이전합니다. |
virsh
명령 옵션을 사용하여 게스트 및 하이퍼바이저 리소스를 관리합니다:
명령 | 설명 |
---|---|
setmem
| 게스트에 대해 할당된 메모리를 설정합니다. |
setmaxmem
| 하이퍼바이저에 대해 최대 메모리 한계를 설정합니다. |
setvcpus
| 게스트에 할당된 가상 CPU 수를 변경합니다. |
vcpuinfo
| 게스트에 관한 가상 CPU 정보를 보여줍니다. |
vcpupin
| 게스트의 가상 CPU 친화력을 제어합니다. |
domblkstat
| 실행 중인 게스트에 대해 블록 장치 통계를 보여줍니다. |
domifstat
| 실행 중인 게스트에 대해 네트워크 인터페이스 통계를 보여줍니다. |
attach-device
| XML 파일에 있는 장치 정의를 사용하여 게스트에 장치를 부착합니다. |
attach-disk
| 게스트에 새 디스크 장치를 부착합니다. |
attach-interface
| 게스트에 새 네트워크 인터페이스를 부착합니다. |
detach-device
|
게스트에서 장치를 분리하고, attach-device 명령으로 동일한 종류의 XML 설명을 얻습니다.
|
detach-disk
| 게스트에서 디스크 장치를 분리합니다. |
detach-interface
| 게스트에서 네트워크 인터페이스를 분리합니다. |
virsh
옵션은 다음과 같습니다:
명령 | 설명 |
---|---|
version
|
virsh 버전 보기
|
nodeinfo
| 하이퍼바이저에 관한 정보 출력 |
virsh
로 하이퍼바이저 세션 연결:
# virsh connect {hostname OR URL}
<name>
은 하이퍼바이저의 장치 이름입니다. 읽기-전용 연결을 시작하려면, 위 명령에 -readonly
를 추가합니다.
virsh
:
# virsh dumpxml {domain-id, domain-name or domain-uuid}
stdout
). You can save the data by piping the output to a file. An example of piping the output to a file called guest.xml
:
# virsh dumpxmlThis fileGuestID
>guest.xml
guest.xml
can recreate the guest (refer to Editing a guest's configuration file. You can edit this XML configuration file to configure additional devices or to deploy additional guests. Refer to 33.1절. “virsh로 XML 설정 파일 사용 ” for more information on modifying files created with virsh dumpxml
.
virsh dumpxml
명령 출력 결과의 예는 다음과 같습니다:
# virsh dumpxml r5b2-mySQL01 <domain type='xen' id='13'> <name>r5b2-mySQL01</name> <uuid>4a4c59a7ee3fc78196e4288f2862f011</uuid> <bootloader>/usr/bin/pygrub</bootloader> <os> <type>linux</type> <kernel>/var/lib/libvirt/vmlinuz.2dgnU_</kernel> <initrd>/var/lib/libvirt/initrd.UQafMw</initrd> <cmdline>ro root=/dev/VolGroup00/LogVol00 rhgb quiet</cmdline> </os> <memory>512000</memory> <vcpu>1</vcpu> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <interface type='bridge'> <source bridge='xenbr0'/> <mac address='00:16:3e:49:1d:11'/> <script path='vif-bridge'/> </interface> <graphics type='vnc' port='5900'/> <console tty='/dev/pts/4'/> </devices> </domain>
dumpxml
option (refer to 가상 장치 XML 덤프 (설정 파일) 생성 ). To create a guest with virsh
from an XML file:
# virsh create configuration_file.xml
dumpxml
option (refer to 가상 장치 XML 덤프 (설정 파일) 생성 ) guests can be edited either while they run or while they are offline. The virsh edit
command provides this functionality. For example, to edit the guest named softwaretesting
:
# virsh edit softwaretesting
$EDITOR
쉘 파라미터입니다. (기본값으로 vi
로 설정)
virsh
를 사용하여 게스트 일시 중지:
# virsh suspend {domain-id, domain-name or domain-uuid}
resume
(게스트 재시작 ) option.
resume
옵션을 사용하여 virsh
로 일시 중지 상태의 게스트를 복구하려면 다음을 실행합니다:
# virsh resume {domain-id, domain-name or domain-uuid}
suspend
와 resume
실행에서 보존됩니다.
virsh
명령을 사용하여 현재 게스트 상태를 파일에 저장하려면 다음을 실행합니다:
# virsh save {domain-name, domain-id or domain-uuid} filename
restore
(게스트 복구 ) option. Save is similar to pause, instead of just pausing a guest the present state of the guest is saved.
# virsh restore filename
virsh
명령을 사용하여 게스트를 종료하려면 다음을 실행합니다:
# virsh shutdown {domain-id, domain-name or domain-uuid}
on_shutdown
parameter in the guest's configuration file.
virsh
명령을 사용하여 게스트를 재부팅하려면 다음을 실행합니다:
#virsh reboot {domain-id, domain-name or domain-uuid}
on_reboot
element in the guest's configuration file.
virsh
명령을 사용하여 게스트를 강제 종료하려면 다음을 실행합니다:
# virsh destroy {domain-id, domain-name or domain-uuid}
virsh destroy
can corrupt guest file systems . Use the destroy
option only when the guest is unresponsive. For para-virtualized guests, use the shutdown
option(게스트 종료 ) instead.
# virsh domid {domain-name or domain-uuid}
# virsh domname {domain-id or domain-uuid}
# virsh domuuid {domain-id or domain-name}
virsh domuuid
명령 출력 결과의 예입니다:
# virsh domuuid r5b2-mySQL01 4a4c59a7-ee3f-c781-96e4-288f2862f011
virsh
with the guest's domain ID, domain name or UUID you can display information on the specified guest:
# virsh dominfo {domain-id, domain-name or domain-uuid}
virsh dominfo
명령 출력 결과의 예입니다:
# virsh dominfo r5b2-mySQL01 id: 13 name: r5b2-mysql01 uuid: 4a4c59a7-ee3f-c781-96e4-288f2862f011 os type: linux state: blocked cpu(s): 1 cpu time: 11.0s max memory: 512000 kb used memory: 512000 kb
# virsh nodeinfo
virsh nodeinfo
명령 출력 결과의 예:
# virsh nodeinfo CPU model x86_64 CPU (s) 8 CPU frequency 2895 Mhz CPU socket(s) 2 Core(s) per socket 2 Threads per core: 2 Numa cell(s) 1 Memory size: 1046528 kb
virsh
를 사용하여 게스트 목록 및 게스트의 현재 상태를 보려면 다음을 실행합니다:
# virsh list
--inactive
옵션은 비활성화 게스트를 나열합니다 (즉, 정의되어 있으나 현재 활성화되지 않은 게스트)
--all
옵션은 모든 게스트를 나열합니다. 예:
# virsh list --all Id Name State ---------------------------------- 0 Domain-0 running 1 Domain202 paused 2 Domain010 inactive 3 Domain9600 crashed
virsh list
로 부터의 출력 결과는 여섯 가지 상태 중 하나로 구분됩니다. (아래 나열됨).
running
상태는 현재 CPU 상에서 활성화되어 있는 게스트를 의미합니다.
blocked
로 나열된 게스트는 차단되어 실행되지 않거나 또는 실행될 수 없습니다. 이는 게스트가 I/O에서 대기하고 (전형적인 대기 상태) 있거나 게스트가 절전 모드에 있기 때문입니다.
paused
상태는 일시 중지된 도메인을 나열합니다. 이는 관리자가 virt-manager
, xm pause
, virsh suspend
에서 pause 버튼을 사용할 경우 발생합니다. 게스트가 일시 중지되면, 이는 메모리 및 기타 자원을 사용하지만 하이퍼바이저에서 스케줄링 및 CPU 자원을 사용할 수 없습니다.
shutdown
상태는 종료 단계에 있는 게스트를 말합니다. 게스트가 종료 신호를 전송하면 실행을 중지해야 합니다. 이는 모든 운영 체제에서 작동하지 않을 수 있으며, 일부 운영 체제는 이러한 신호에 응답하지 않을 수 있습니다.
dying
상태에 있는 도메인은 프로세서가 종료되어 가는 과정으로 도메인이 완전히 종료되거나 손상된 상태를 말합니다.
virsh vcpuinfo
게스트가 실패하여 더이상 실행되지 않습니다. 게스트가 크래시에서 다시 시작하지 않도록 설정되었을 경우 이러한 상태가 발생할 수 있습니다.
virsh
를 사용하여 게스트에서 가상 CPU 정보를 보려면 다음을 실행합니다:
# virsh vcpuinfo {domain-id, domain-name or domain-uuid}
virsh vcpuinfo
명령 출력 결과의 예:
# virsh vcpuinfo r5b2-mySQL01 VCPU: 0 CPU: 0 State: blocked CPU time: 0.0s CPU Affinity: yy
# virsh vcpupin domain-id vcpu cpulist
domain-id
parameter is the guest's ID number or name.
vcpu
파라미터는 게스트에 할당된 가상 CPU 수를 나타냅니다. vcpu
파라미터는 반드시 제공되어야 합니다.
cpulist
파라미터는 콤마로 구분된 실제 CPU 식별 번호 목록입니다. cpulist
파라미터는 VCPU가 실행할 수 있는 실제 CPU를 지정합니다.
virsh
로 게스트에 할당된 CPU 수를 수정하려면 다음을 실행합니다:
# virsh setvcpus {domain-name, domain-id or domain-uuid} count
count
값은 게스트를 생성할 때 지정했던 수를 초과할 수 없습니다.
virsh
:
# virsh setmem {domain-id or domain-name} count
virsh domblkstat
명령을 사용하여 실행 중인 게스트에 대한 블럭 장치 상태를 표시합니다.
# virsh domblkstat GuestName block-device
virsh domifstat
명령을 사용합니다.
# virsh domifstat GuestName interface-device
virsh
명령으로 게스트는 다른 호스트로 이전할 수 있습니다. 도메인을 다른 호스트로 이전합니다. 실시간 이전의 경우 --live를 추가합니다. migrate
명령은 다음 형식의 파라미터를 허용합니다:
# virsh migrate --live GuestName DestinationURL
--live
파라미터는 옵션 사항입니다. 실시간 이전의 경우 --live
파라미터를 추가합니다.
GuestName
파라미터는 이전하고자 하는 게스트 이름을 나타냅니다.
DestinationURL
파라미터는 대상 시스템의 URL 또는 호스트 이름을 나타냅니다. 대상 시스템에는 다음과 같은 사항이 필요합니다:
libvirt
서비스를 실행하고 있어야 함
virsh
명령을 사용하여 가상 네트워크를 관리하는 방법에 대해 설명합니다. 가상 네트워크 목록을 나열하려면 다음을 실행합니다:
# virsh net-list
# virsh net-list Name State Autostart ----------------------------------------- default active yes vnet1 active yes vnet2 active yes
# virsh net-dumpxml NetworkName
# virsh net-dumpxml vnet1 <network> <name>vnet1</name> <uuid>98361b46-1581-acb7-1643-85a412626e70</uuid> <forward dev='eth0'/> <bridge name='vnet0' stp='on' forwardDelay='0' /> <ip address='192.168.100.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.100.128' end='192.168.100.254' /> </dhcp> </ip> </network>
virsh
명령에는 다음과 같은 것이 있습니다:
virsh net-autostart network-name
— network-name
으로 지정된 네트워크 자동 시작
virsh net-create XMLfile
— 기존 XML 파일을 사용하여 새 네트워크 생성 및 시작
virsh net-define XMLfile
— XML 파일을 시작하지 않고 기존 XML 파일에서 새 네트워크 장치 생성
virsh net-destroy network-name
— network-name
으로 지정된 네트워크 강제 종료
virsh net-name networkUUID
— 특정 networkUUID
를 네트워크 이름으로 변환
virsh net-uuid network-name
— 특정 network-name
을 네트워크 UUID로 변환
virsh net-start nameOfInactiveNetwork
— 비활성화 네트워크 시작
virsh net-undefine nameOfInactiveNetwork
— 비활성화 네트워크 정의 삭제
virt-manager
) 창, 대화 상자, 다양한 GUI 제어에 대해 설명합니다.
virt-manager
는 시스템 및 원격 장치에 있는 게스트와 하이퍼바이저의 그래픽 보기를 제공합니다. virt-manager
를 사용하여 반가상화 및 완전 가상화 게스트를 지정할 수 있습니다. virt-manager
는 다음과 같은 가상화 관리 작업을 수행합니다:
virt-manager
. The UUID field displays the globally unique identifier for the virtual machines.
dom0
)'s loopback address (127.0.0.1
). This ensures only those with shell privileges on the host can access virt-manager and the virtual machine through VNC.
virt-manager
sticky key capability to send these sequences. To use this capability, you must press any modifier key (Ctrl or Alt) 3 times and the key you specify gets treated as active until the next non-modifier key is pressed. You can then send Ctrl-Alt-F11 to the guest by entering the key sequence 'Ctrl Ctrl Ctrl Alt+F1'.
virt-manager
, it is not possible to use this sticky key feature to send a Sysrq key combination to a guest.
virt-manager
세션을 시작하려면, 메뉴에서 를 클릭하고 (virt-manager
)를 선택합니다.
virt-manager
메인 화면이 나타납니다.
virt-manager
시작 virt-manager
can be started remotely using ssh as demonstrated in the following command:
ssh -X host's address
[remotehost]# virt-manager
Using ssh
to manage virtual machines and hosts is discussed further in 22.1절. “SSH를 통한 원격 관리 ”.
virt-manager
's preferences window.
DHCP
범위 선택 xm
명령은 Xen 하이퍼바이저를 관리할 수 있습니다. 대부분의 작업은 libvirt 도구, virt-manager 어플리케이션 또는 virsh
명령으로 실행될 수 있습니다. xm
명령에는 libvirt 도구의 오류 확인 기능이 없으며 libvirt 도구가 지원하는 작업에 대해 사용될 수 없습니다.
xm
명령의 기타 다른 Xen 구현에 해당하는 일부 옵션은 Red Hat Enterprise Linux 5에서 작동하지 않습니다. 아래 목록은 사용 가능 및 사용 가능하지 않은 명령 옵션에 대한 개요입니다.
xm
대신에 virsh
또는 virt-manager
를 사용할 것을 권장합니다. xm
명령은 오류 확인이나 설정 파일 오류를 잘 처리할 수 없으며 실수로 시스템이 불안정하게 되거나 가상 장치에 오류를 발생하게 할 수 있습니다. 수동으로 Xen 설정 파일을 편집하는 것은 위험하므로 하지 말아야 합니다. 위험을 감수하시고 다음 부분을 사용하십시오.
xm
명령입니다:
xm help [--long]
: 사용 가능한 옵션 및 도움말 텍스트 보기
xm list
명령을 사용하여 활성 도메인 목록 나열:
$ xm list Name ID Mem(MiB) VCPUs State Time(s) Domain-0 0 520 2 r----- 1275.5 r5b2-mySQL01 13 500 1 -b---- 16.1
xm create [-c] DomainName/ID
: start a virtual machine. If the -c option is used, the start up process will attach to the guest's console.
xm console DomainName/ID
: attach to a virtual machine's console.
xm destroy DomainName/ID
: 가상 장치 종료, 전원 끄기와 유사함
xm reboot DomainName/ID
: 가상 장치 재부팅, 정상적인 시스템 종료 실행 후 프로세스 시작
xm shutdown DomainName/ID
: 가상 장치 종료, 정상적인 시스템 종료 절차 실행
xm pause
xm unpause
xm save
xm restore
xm migrate
xm
명령을 사용하여 리소스를 관리합니다:
xm mem-set
xm vcpu-list
명령을 사용하여 가상 CPU 친화성 나열:
$ xm vcpu-list Name ID VCPUs CPU State Time(s) CPU Affinity Domain-0 0 0 0 r-- 708.9 any cpu Domain-0 0 1 1 -b- 572.1 any cpu r5b2-mySQL01 13 0 1 -b- 16.1 any cpu
xm vcpu-pin
xm vcpu-set
xm sched-credit
명령을 사용하여 주어진 도메인에 대한 스케줄러 매개 변수 보기:
$ xm sched-credit -d 0 {'cap': 0, 'weight': 256} $ xm sched-credit -d 13 {'cap': 25, 'weight': 256}
xm
명령을 사용하여 모니터링 및 문제를 해결합니다:
xm top
xm dmesg
xm info
xm log
xm uptime
명령을 사용하여 게스트 및 호스트 가동 시간 보기:
$ xm uptime Name ID Uptime Domain-0 0 3:42:18 r5b2-mySQL01 13 0:06:27
xm sysrq
xm dump-core
xm rename
xm domid
xm domname
xm vnet-list
는 지원되지 않습니다.
/boot/grub/grub.conf
에 위치)은 GRUB 메뉴 인터페이스에서 시작할 수 있는 운영 체제의 목록을 만드는데 사용됩니다. kernel-xen
RPM을 설치할 때, 스크립트는 GRUB 설정 파일에 kernel-xen
항목을 추가하여 기본값으로 kernel-xen
을 시작합니다. grub.conf
파일을 편집하여 기본값 커널을 수정하거나 커널 파라미터를 추가할 수 있습니다.
title Red Hat Enterprise Linux Server (2.6.18-3.el5xen) root (hd0,0) kernel /xen.gz.-2.6.18-3.el5 module /vmlinuz-2.6..18-3.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet module /initrd-2.6.18-3. el5xenxen.img
initrd
이미지)와 Linux 커널을 읽어옵니다. 이 커널 항목이 다른 항목보다 위에 있으므로 이 커널이 먼저 메모리에 상주하게 됩니다. 부트로더는 하이퍼바이저와 Linux 커널로 또는 하이퍼바이저와 Linux 커널에서 명령행 인수를 보내거나 받습니다. 다음 예제 항목은 어떻게 Dom0 리눅스 커널 메모리를 800MB로 제한하는지를 보여줍니다.
title Red Hat Enterprise Linux Server (2.6.18-3.el5xen) root (hd0,0) kernel /xen.gz.-2.6.18-3.el5 dom0_mem=800M module /vmlinuz-2.6..18-3.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet module /initrd-2.6.18-3. el5xenxen.img
mem
com1=115200, 8n1
dom0_mem
dom0_max_vcpus
acpi
/* **** Linux config options: propagated to domain0 ****/ /* "acpi=off": Disables both ACPI table parsing and interpreter. */ /* "acpi=force": Overrides the disable blacklist. */ /* "acpi=strict": Disables out-of-spec workarounds. */ /* "acpi=ht": Limits ACPI from boot-time to enable HT. */ /* "acpi=noirq": Disables ACPI interrupt routing. */
noacpi
/etc/elilo.conf
로 심볼릭 링크된 ELILO 설정 파일에는 글로벌 옵션 및 이미지 모음 목록이 들어있습니다. kernel-xen
RPM을 설치하면, 사후 설치 스크립트는 해당 이미지 모음을 elilo.conf
파일에 추가합니다.
image=vmlinuz-2.6.18-92.el5xen vmm=xen.gz-2.6.18-92.el5 label=linux initrd=initrd-2.6.18-92.el5xen.img read-only root=/dev/VolGroup00/rhel5_2 append="-- rhgb quiet"
image
parameter indicates the following lines apply to a single boot selection. This stanza defines a hypervisor (vmm
), initrd
, and command line arguments (read-only
, root
and append
) to the hypervisor and kernel. When ELILO is loaded during the boot sequence, the image is labeled linux
.
initscripts
가 읽기-쓰기 전용으로 root 드라이브를 마운트할 때 까지 root 파일 시스템이 읽기 전용 (read-only)에 마운트되게 하는 커널 명령행 옵션 ro
에서 read-only
만을 해석합니다. ELILO는 "root
" 행을 커널 명령행에 복사합니다. 이는 완전한 명령행을 작성하기 위해 "append
" 행으로 통합됩니다:
"-- root=/dev/VolGroup00/rhel5_2 ro rhgb quiet"
--
구분 기호를 사용하여 하이퍼바이저 및 커널 인수를 구분합니다. 하이퍼바이저 인수가 먼저 오고, 그 후 --
구분 기호, 그 다음으로 커널 인수가 옵니다. 주로 하이퍼바이저는 어떠한 인수도 갖지 않습니다.
--
전에 파라미터를 삽입합니다. 커널 용 하이퍼바이저 메모리(mem
) 파라미터 및 quiet
파라미터의 예는 다음과 같습니다:
append="dom0_mem=2G -- quiet"
파라미터 | 설명 |
---|---|
mem= | mem 파라미터는 하이퍼바이저 최대 RAM 사용량을 정의합니다. 시스템에서 추가된 RAM은 무시하게 됩니다. 파라미터는 B, K, M, G 접미사로 지정되며 이는 각각 바이트, 킬로바이트, 메가바이트, 기가바이트를 나타냅니다. 접미사가 지정되지 않을 경우 디폴트 단위는 킬로바이터가 됩니다. |
dom0_mem= | dom0_mem= 은 dom0로의 RAM 할당량을 설정합니다. 동일한 접미사는 위의 mem 파라미터로 취급됩니다. Itanium® 상의 Red Hat Enterprise Linux 5.2에서 디폴트 값은 4G입니다. |
dom0_max_vcpus= | dom0_max_vcpus= 은 하이퍼이저로의 CPU 할당 수를 설정합니다. Itanium® 상의 Red Hat Enterprise Linux 5.2에서 디폴트 값은 4입니다. |
com1= | com1= 은 첫번째 직렬행의 파라미터를 설정합니다. 예: com1=9600,8n1,0x408,5 . io_base 및 irq 옵션을 생략하여 이를 표준 디폴트 값으로 둘 수 있습니다. baud 파라미터는 auto 로 설정하여 부트로더 설정이 보존되어야 함을 나타낼 수 있습니다. 직렬 파라미터가 ELILO 또는 EFI 설정에서 글로벌 옵션으로 설정되어 있을 경우 com1 을 생략할 수 있습니다. |
com2= | 두번째 직렬행의 파라미터를 설정합니다. 위의 com1 파라미터에 대한 설명을 참조하시기 바랍니다. |
console= | console 은 콘솔 옵션에 대해 콤마로 구분된 환경 설정 목록입니다. 옵션에는 vga, com1, com2가 있습니다. 이러한 설정은 하이퍼바이저가 EFI 콘솔 설정을 넘겨 받으려 하기 때문에 생략해야 합니다. |
image=vmlinuz-2.6.18-92.el5xen vmm=xen.gz-2.6.18-92.el5 label=linux initrd=initrd-2.6.18-92.el5xen.img read-only root=/dev/VolGroup00/rhel5_2 append="dom0_mem=2G dom0_max_vcpus=2 --"
rhgb quiet
"를 삭제하여 커널 및 initscript
출력 결과를 콘솔에 생성합니다. 이중 대시 부호는 남아 있게 되어 추가된 행이 하이퍼바이저 인수로서 올바르게 해석됨에 유의하시기 바랍니다.
Item | Description |
---|---|
pae
|
Specifies the physical address extension configuration data.
|
apic
|
Specifies the advanced programmable interrupt controller configuration data.
|
memory
|
Specifies the memory size in megabytes.
|
vcpus
|
Specifies the numbers of virtual CPUs.
|
console
|
Specifies the port numbers to export the domain consoles to.
|
nic
|
Specifies the number of virtual network interfaces.
|
vif
|
Lists the randomly-assigned MAC addresses and bridges assigned to use for the domain's network addresses.
|
disk
|
Lists the block devices to export to the domain and exports physical devices to domain with read only access.
|
dhcp
|
Enables networking using DHCP.
|
netmask
|
Specifies the configured IP netmasks.
|
gateway
|
Specifies the configured IP gateways.
|
acpi
|
Specifies the advanced configuration power interface configuration data.
|
libvirt
configuration files for most tasks. Some users may need Xen configuration files which contain the following standard variables. Configuration items within these files must be enclosed in single quotes('). These configuration files reside in the /etc/xen
directory.
xm create --help_config
.
Parameter
|
Description
|
---|---|
vncpasswd =NAME
| HVM 데몬에서 VNC 콘솔 암호 |
vncviewer=no | yes
|
도메인에 vnc 서버 용 vncviewer 목록을 생성합니다. vncviewer 주소는 VNC_SERVER=<host>:<port> 를 사용하여 커널 명령행에서 도메인으로 전달됩니다. vnc에 의해 사용되는 포트는 5500 + DISPLAY입니다. 가능하면 무료 포트를 사용하는 디스플레이 값을 선택합니다. vnc=1일 때에만 유효합니다.
|
vncconsole =no | yes
| Spawn a vncviewer process for the domain's graphical console. Only valid when vnc=1. |
name =NAME
| 도메인 이름. 고유한 이름이어야 합니다. |
bootloader =FILE
| 부트로더 까지의 경로 |
bootargs =NAME
| 부트로더로 전달할 인수 |
bootentry =NAME
|
삭제됨. 부트로더를 통해 부팅할 항목. bootargs 사용.
|
kernel =FILE
| 커널 이미지로의 경로 |
ramdisk =FILE
| ramdisk 까지의 경로 |
features =FEATURES
| 게스트 커널에서 활성화하기 위한 기능 |
builder =FUNCTION
| 도메인 빌드에 사용할 기능 |
memory =MEMORY
| MB 단위의 도메인 메모리 |
maxmem =MEMORY
| MB 단위의 최대 도메인 메모리 |
shadow_memory =MEMORY
| MB 단위의 도메인 셰도우 메모리 |
cpu =CPU
| VCPU0를 호스트하는 CPU |
cpus =CPUS
| 도메인 실행을 위한 CPUS |
pae =PAE
| HVM 도메인의 PAE 활성화 또는 비활성화 |
acpi =ACPI
| HVM 도메인의 ACPI 활성화 또는 비활성화 |
apic =APIC
| HVM 도메인의 APIC 활성화 또는 비활성화 |
vcpus =VCPUs
| 도메인에서의 가상 CPUS 수 |
cpu_weight =WEIGHT
|
Set the new domain's cpu weight. WEIGHT is a float that controls the domain's share of the cpu.
|
restart =onreboot | always | never
|
삭제됨. 대신 on_poweroff, on_reboot , on_crash 사용. 종료 시 도메인 재시작 여부. - onreboot : 종료 시 종료 코드 재부팅과 함께 재시작 - always: 종료 시 항상 재시작, 종료 코드 무시 - never: 종료 시 재시작하지 않음, 종료 코드 무시
|
on_poweroff =destroy | restart | preserve | destroy
|
Behavior when a domain exits with reason 'poweroff '. - destroy: the domain is cleaned up as normal; - restart: a new domain is started in place of the old one; - preserve: no clean-up is done until the domain is manually destroyed (using xm destroy, for example); - rename-restart: the old domain is not cleaned up, but is renamed and a new domain started in its place.
|
on_reboot =destroy | restart | preserve | destroy
| Behavior when a domain exits with reason 'reboot'. - destroy: the domain is cleaned up as normal; - restart: a new domain is started in place of the old one; - preserve: no clean-up is done until the domain is manually destroyed (using xm destroy, for example); - rename-restart: the old domain is not cleaned up, but is renamed and a new domain started in its place. |
on_crash =destroy | restart | preserve | destroy
| Behavior when a domain exits with reason 'crash'. - destroy: the domain is cleaned up as normal; - restart: a new domain is started in place of the old one; - preserve: no clean-up is done until the domain is manually destroyed (using xm destroy, for example); - rename-restart: the old domain is not cleaned up, but is renamed and a new domain started in its place. |
blkif =no | yes
| 도메인을 블록 장치 백엔드되게 합니다. |
netif =no | yes
| 도메인을 네트워크 인터페이스 백엔드되게 합니다. |
tpmif =no | yes
| 도메인을 TPM 인터페이스 백엔드되게 합니다. |
disk =phy:DEV,VDEV,MODE[,DOM]
|
도메인에 디스크 장치를 추가합니다. 물리적 장치는 DEV 로 도메인에 VDEV 로 내보내어 집니다. 디스크의 MODE 가 r 일 경우 읽기 전용이며, MODE 가 w 일 경우 읽기-쓰기 전용이 됩니다. DOM 이 지정되어 있을 경우, 백엔드 드라이버 도메인이 디스크를 사용하도록 정의하게 됩니다. 하나 이상의 디스크를 추가하려면 옵션을 반복하면 됩니다.
|
pci =BUS:DEV.FUNC
|
주어진 파라미터 값 (십육 진수로 됨)을 사용하여 도메인에 PCI 장치를 추가합니다. 예: pci=c0:02.1a . 하나 이상의 pci 장치를 추가하려면 옵션을 반복하면 됩니다.
|
ioports =FROM[-TO]
|
주어진 파라미터 값 (십육 진수로 됨)을 사용하여 도메인에 레거시 I/O 범위를 추가합니다. 예: ioports=02f8-02ff . 하나 이상의 I/O 범위를 추가하려면 옵션을 반복하면 됩니다.
|
irq =IRQ
|
도메인에 IRQ (인터럽트 행)을 추가합니다. 예: irq=7 . 하나 이상의 IRQ를 추가하려면 이 옵션을 반복하면 됩니다.
|
usbport =PATH
| 포트까지 지정된 경로데로 도메인에 물리적 USB 포트를 추가합니다. 하나 이상의 포트를 추가하려면 이 옵션을 반복하면 됩니다. |
vfb=type=
vnclisten=
xauthority=
keymap =KEYMAP
|
Make the domain a framebuffer backend. The backend type should be either sdl or vnc . For type=vnc , connect an external vncviewer. The server will listen on ADDR (default 127.0.0.1) on port N+5900. N defaults to the domain id. If vncunused=1 , the server will try to find an arbitrary unused port above 5900. For type=sdl , a viewer will be started automatically using the given DISPLAY and XAUTHORITY , which default to the current user's ones.
|
vif=type=
script= =NAME
|
주어진 MAC 주소 및 브리지를 사용하여 네트워크 인터페이스를 추가합니다. vif 는 주어진 설정 스크립트를 호출하여 설정됩니다. 유형이 지정되어 있지 않을 경우, ioemu 장치가 아닌 netfront가 디폴트로 됩니다. mac가 지정되어 있지 않을 경우, 임의의 MAC 주소가 사용됩니다. 아무것도 지정되어 있지 않을 경우, 네트워크 백엔드는 자신의 MAC 주소를 선택합니다. 브리지가 지정되어 있지 않을 경우 첫번째로 발견된 브리지가 사용됩니다. 스크립트가 지정되어 있지 않을 경우 디폴트 스크립트가 사용됩니다. 백엔드가 지정되어 있지 않을 경우, 디폴트 백엔드 드라이버 도메인이 사용됩니다. vifname이 지정되어 있지 않을 경우 백엔드 가상 인터페이스는 vifD.N 이름을 갖게 됩니다. 여기서 D는 도메인 id이며 N은 인터페이스 id입니다. 하나 이상의 vif를 추가하려면 이 옵션을 반복합니다. vif를 지정하면 필요한 인터페이스 수가 증가될 수 있습니다.
|
vtpm=instance= INSTANCE ,backend=DOM
|
TPM 인터페이스를 추가합니다. 백엔드에서는 가상 TPM 인스턴스로서 주어진 인스턴스를 사용합니다. 주어진 번호는 단지 선호하는 인스턴스 번호에 불과합니다. 핫플러그 스크립트는 어떤 인스턴스 번호를 도메인에 할당할 지를 결정하게 됩니다. 가상 장치 및 TPM 인스턴스 번호의 연합은 /etc/xen/vtpm.db 에서 찾으실 수 있습니다. 주어진 도메인에서 백엔드를 사용합니다.
|
access_control=policy= POLICY ,label=LABEL
| 보안 레이블 및 이를 정의한 보안 정책 참조를 추가합니다. 도메인을 시작/재시작할 때 로컬 ssid 참조가 계산됩니다. 이때에 활성화된 정책에서 정책을 확인하게 됩니다. 이러한 방식에서 저장/복구를 통한 이전 작업은 복구되고 로컬 레이블은 도메인이 시작/재시작된 위치의 시스템에서 자동으로 생성됩니다. |
nics =NUM
| 삭제됨. 대신 빈 vif 항목을 사용합니다. 네트워크 인터페이스 수를 설정합니다. vif 옵션을 사용하여 인터페이스 파라미터를 정의합니다. 정의하지 않을 경우 디폴트 값이 사용됩니다. vif를 지정하면 필요한 인터페이스 수가 증가됩니다. |
root =DEVICE
|
커널 명령행에 root = 파라미터를 설정합니다. NFS root의 경우 /dev/sda1 , 또는 /dev/nfs 와 같은 장치를 사용합니다.
|
extra =ARGS
| 커널 명령행에 더할 추가 인수를 지정합니다. |
ip =IPADDR
| 커널 IP 인터페이스 주소를 지정합니다. |
gateway =IPADDR
| 커널 IP 게이트웨이 지정합니다. |
netmask =MASK
| 커널 IP 넷마스크를 지정합니다. |
hostname =NAME
| 커널 IP 호스트명을 지정합니다. |
interface =INTF
| 커널 IP 인터페이스명을 지정합니다. |
dhcp =off|dhcp
| 커널 dhcp 옵션을 지정합니다. |
nfs_server =IPADDR
| NFS root에 대한 NFS 서버 주소를 지정합니다. |
nfs_root =PATH
| root NFS 디렉토리 경로를 지정합니다. |
device_model =FILE
| 장치 모델 프로그램 경로 |
fda =FILE
| fda 경로 |
fdb =FILE
| fdb 경로 |
serial =FILE
| 시리얼 또는 pty 또는 vc로의 경로 |
localtime =no | yes
| RTC는 로컬 시간으로 지정되어 있습니까? |
keymap =FILE
| 키보드 레이아웃 지정 |
usb =no | yes
| USB 장치 처럼 사용 |
usbdevice =NAME
|
추가할 USB 장치 이름
|
stdvga =no | yes
|
Use std vga or Cirrus Logic
graphics
|
isa =no | yes
|
ISA 전용 시스템 모의 사용
|
boot =a|b|c|d
| 디폴트 부팅 장치 |
nographic =no | yes
| 장치 모델이 그래픽을 사용해야 합니까? |
soundhw =audiodev
| 장치 모델이 오디오 장치를 사용해야 합니까? |
vnc
| 장치 모델이 VNC를 사용해야 합니까? |
vncdisplay
| 사용할 VNC 보기 |
vnclisten
| 청취할 VNC 서버 용 주소 |
vncunused
| VNC 서버 용으로 사용하지 않을 포트를 찾습니다. vnc=1일 때에만 유효합니다. |
sdl
| 장치 모델이 SDL을 사용해야 합니까? |
display =DISPLAY
| 사용할 X11 보기 |
xauthority =XAUTHORITY
| 사용할 X11 권한 |
uuid
| 사용할 xenstore UUID (universally unique identifier). 이러한 옵션이 설정되어 있지 않을 경우, 가상 네트워크의 MAC 주소와 같이 임의로 생성되게 됩니다. 이는 전체 클러스터에서 고유한 값이어야 합니다. |
구문 분석 기능 | 유효한 인수 |
---|---|
set_bool
|
허용되는 값:
|
set_float
|
Accepts a floating point number with Python's float(). For example:
|
set_int
|
Accepts an integer with Python's int().
|
set_value
|
어떤 Python 값이던지 허용합니다.
|
append_value
|
어떤 Python 값이던지 허용하며, 이를 어레이에 저장된 이전 값에 더합니다.
|
Parameter | 구문 분석 기능 | 디폴트 값 |
---|---|---|
name
|
setter
|
default value
|
vncpasswd
|
set_value
|
None
|
vncviewer
|
set_bool
|
None
|
vncconsole
|
set_bool
|
None
|
name
|
set_value
|
None
|
bootloader
|
set_value
|
None
|
bootargs
|
set_value
|
None
|
bootentry
|
set_value
|
None
|
kernel
|
set_value
|
None
|
ramdisk
|
set_value
|
''
|
features
|
set_value
|
''
|
builder
|
set_value
|
'linux'
|
memory
|
set_int
|
128
|
maxmem
|
set_int
|
None
|
shadow_memory
|
set_int
|
0
|
cpu
|
set_int
|
None
|
cpus
|
set_value
|
None
|
pae
|
set_int
|
0
|
acpi
|
set_int
|
0
|
apic
|
set_int
|
0
|
vcpus
|
set_int
|
1
|
cpu_weight
|
set_float
|
None
|
restart
|
set_value
|
None
|
on_poweroff
|
set_value
|
None
|
on_reboot
|
set_value
|
None
|
on_crash
|
set_value
|
None
|
blkif
|
set_bool
|
0
|
netif
|
set_bool
|
0
|
tpmif
|
append_value
|
0
|
disk
|
append_value
|
[]
|
pci
|
append_value
|
[]
|
ioports
|
append_value
|
[]
|
irq
|
append_value
|
[]
|
usbport
|
append_value
|
[]
|
vfb
|
append_value
|
[]
|
vif
|
append_value
|
[]
|
vtpm
|
append_value
|
[]
|
access_control
|
append_value
|
[]
|
nics
|
set_int
|
-1
|
root
|
set_value
|
''
|
extra
|
set_value
|
''
|
ip
|
set_value
|
''
|
gateway
|
set_value
|
''
|
netmask
|
set_value
|
''
|
hostname
|
set_value
|
''
|
interface
|
set_value
|
"eth0"
|
dhcp
|
set_value
|
'off'
|
nfs_server
|
set_value
|
None
|
nfs_root
|
set_value
|
None
|
device_model
|
set_value
|
''
|
fda
|
set_value
|
''
|
fdb
|
set_value
|
''
|
serial
|
set_value
|
''
|
localtime
|
set_bool
|
0
|
keymap
|
set_value
|
''
|
usb
|
set_bool
|
0
|
usbdevice
|
set_value
|
''
|
stdvga
|
set_bool
|
0
|
isa
|
set_bool
|
0
|
boot
|
set_value
|
'c'
|
nographic
|
set_bool
|
0
|
soundhw
|
set_value
|
''
|
vnc
|
set_value
|
None
|
vncdisplay
|
set_value
|
None
|
vnclisten
|
set_value
|
None
|
vncunused
|
set_bool
|
1
|
sdl
|
set_value
|
None
|
display
|
set_value
|
None
|
xauthority
|
set_value
|
None
|
uuid
|
set_value
|
None
|
차례
ftpd
ftpd
virsh
를 사용하여 TestServer
게스트를 설정하고 호스트 부팅 시 자동으로 시작되게 합니다.
# virsh autostart TestServer
Domain TestServer marked as autostarted
--disable
파라미터를 사용합니다
# virsh autostart --disable TestServer
Domain TestServer unmarked as autostarted
KVM 패키지 설치
# yum install kvm
사용 중인 커널 확인
uname
명령을 사용하여 사용 중인 커널을 확인합니다:
$ uname -r 2.6.18-159.el5xen
2.6.18-159.el5xen
" 커널을 시스템에서 사용하고 있습니다. 기본값 커널 "2.6.18-159.el5
"를 사용하고 있을 경우 하부 절차를 생략할 수 있습니다.
Xen 커널을 기본값 커널로 변경
grub.conf
파일은 어떤 커널을 부팅할지를 결정합니다. 기본값 커널을 변경하려면 아래에서와 같이 /boot/grub/grub.conf
파일을 편집합니다.
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-159.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-159.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-159.el5.img
title Red Hat Enterprise Linux Server (2.6.18-159.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-159.el5
module /vmlinuz-2.6.18-159.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
module /initrd-2.6.18-159.el5xen.img
0
(또는 기본값 커널 번호) 으로 변경합니다.
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-159.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-159.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-159.el5.img
title Red Hat Enterprise Linux Server (2.6.18-159.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-159.el5
module /vmlinuz-2.6.18-159.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
module /initrd-2.6.18-159.el5xen.img
새 커널을 불러오기 위해 재부팅
$ lsmod | grep kvm kvm_intel 85992 1 kvm 222368 2 ksm,kvm_intel
kvm
모듈 및 kvm_intel
모듈 또는 kvm_amd
모듈이 나타나게 됩니다.
Xen 패키지 설치
# yum install kernel-xen xen
사용 중인 커널 확인
uname
명령을 사용하여 어떤 커널을 실행할 지를 결정합니다.
$ uname -r 2.6.18-159.el5
2.6.18-159.el5
" 커널이 실행되고 있습니다. 이는 기본값 커널입니다. 커널 마지막에 xen
이 있고 (예: 2.6.18-159.el5xen
) Xen 커널이 실행되고 있을 경우 하부 절차를 생략할 수 있습니다.
기본값 커널에서 Xen 커널로 변경
grub.conf
파일은 어떤 커널을 부팅할지를 결정합니다. 기본값 커널을 변경하려면 아래에서와 같이 /boot/grub/grub.conf
파일을 편집합니다.
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-159.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-159.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-159.el5.img
title Red Hat Enterprise Linux Server (2.6.18-159.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-159.el5
module /vmlinuz-2.6.18-159.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
module /initrd-2.6.18-159.el5xen.img
1
(또는 Xen 커널 번호)로 변경합니다.
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-159.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-159.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-159.el5.img
title Red Hat Enterprise Linux Server (2.6.18-159.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-159.el5
module /vmlinuz-2.6.18-159.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
module /initrd-2.6.18-159.el5xen.img
새 커널을 불러오기 위해 재부팅
uname
명령을 사용하여 확인합니다:
$ uname -r 2.6.18-159.el5xen
xen
이 있을 경우 Xen 커널은 실행되고 있는 것입니다.
qemu-img
명령행 도구는 Xen 및 KVM에 의해 사용되는 다양한 파일 시스템을 포맷하는데 사용됩니다. qemu-img
는 가상 게스트 이미지, 추가 저장 장치 및 네트워크 저장 장치를 포맷하기 위해 사용됩니다. qemu-img
옵션 및 사용법은 다음과 같습니다.
size
및 포맷format
을 생성합니다.
# qemu-img create [-6] [-e] [-b base_image] [-f format] filename [size]
convert
옵션은 인식된 포맷을 다른 이미지 포맷으로 변환하는데 사용됩니다.
# qemu-img convert [-c] [-e] [-f format]filename
[-Ooutput_format
]output_filename
output_format
포맷을 사용하여 디스크 이미지 filename
을 디스크 이미지 output_filename
으로 변환합니다. 디스크 이미지는 옵션 사항으로 -e
옵션을 사용하여 암호화하거나 -c
옵션을 사용하여 압축할 수 있습니다.
qcow
" 포맷만이 암호화 또는 압축을 지원합니다. 압축은 읽기 전용으로 압축된 부분이 다시 작성되어야 할 경우 이는 압축되지 않은 데이터로 다시 작성되어야 함을 의미합니다.
qcow
또는 cow
와 같이 증가할 수 있는 포맷을 사용할 때 크기가 적은 이미지를 갖기 위해 이미지 변환이 유용합니다. 대상 이미지에서 빈 섹터가 감지되어 억제됩니다.
info
파라미터는 디스크 이미지에 관한 정보를 표시합니다. info
옵션의 포맷은 다음과 같습니다:
# qemu-img info [-f format] filename
raw
qemu-img info
명령을 사용하여 Unix/Linux 상에서 이미지 또는 ls -ls
명령에 의해 사용되는 실제 크기를 알 수 있습니다.
qcow2
qcow
cow
cow
포맷은 이전 버전과의 호환을 위해 포함되어 있습니다. 이는 Windows와 작동하지 않습니다.
vmdk
cloop
(0.5 * RAM) + (overcommit ratio * RAM) = Recommended swap size
/etc/grub.conf
file to use the virtualization kernel. You must use the xen
kernel to use the Xen hypervisor. Copy your existing xen
kernel entry make sure you copy all of the important lines or your system will panic upon boot (initrd
will have a length of '0
'). If you require xen
hypervisor specific values you must append them to the xen
line of your grub entry.
grub.conf
항목의 예입니다. 시스템 상의 grub.conf
는 다를 수 있습니다. 아래의 예에서 중요한 부분은 title
행에서 다음의 새로운 행 까지입니다.
#boot=/dev/sda default=0 timeout=15 #splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1 terminal --timeout=10 serial console title Red Hat Enterprise Linux Server (2.6.17-1.2519.4.21.el5xen) root (hd0,0) kernel /xen.gz-2.6.17-1.2519.4.21.el5 com1=115200,8n1 module /vmlinuz-2.6.17-1.2519.4.21.el5xen ro root=/dev/VolGroup00/LogVol00 module /initrd-2.6.17-1.2519.4.21.el5xen.img
grub.conf
수정 관련 중요 사항 grub.conf
could look very different if it has been manually edited before or copied from an example. Read 28장. Xen 커널 부트 파라미터 설정 for more information on using virtualization and grub.
dom0_mem=256M
을 grub.conf
에 있는 xen
행에 추가해야 합니다. 이전 예에서 grub 설정 파일의 수정된 버전은 다음과 같습니다:
#boot=/dev/sda default=0 timeout=15 #splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1 terminal --timeout=10 serial console title Red Hat Enterprise Linux Server (2.6.17-1.2519.4.21.el5xen) root (hd0,0) kernel /xen.gz-2.6.17-1.2519.4.21.el5 com1=115200,8n1 dom0_mem=256MB module /vmlinuz-2.6.17-1.2519.4.21.el5xen ro root=/dev/VolGroup00/LogVol00 module /initrd-2.6.17-1.2519.4.21.el5xen.img
$ grep -E 'svm|vmx' /proc/cpuinfo
vmx
항목이 들어 있습니다:
flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm
svm
항목이 들어 있습니다:
flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8legacy ts fid vid ttp tm stc
flags:
" 내용은 시스템에 있는 각각의 하이퍼스레드, 코어 또는 CPU에 대해 여러번 나타날 수 있습니다.
For users of the KVM hypervisor
kvm
modules are loaded in the kernel:
# lsmod | grep kvm
kvm_intel
or kvm_amd
then the kvm
hardware virtualization modules are loaded and your system meets requirements. sudo
virsh
command can output a full list of virtualization system capabilities. Run virsh capabilities
as root to receive the complete list.
kpartx
tool, covered by this section, to mount the guest file system as a loop device which can then be accessed.
kpartx
command creates device maps from partition tables. Each guest storage image has a partition table embedded in the file.
# yum install kpartx
guest1.img
.
# kpartx -l /var/lib/libvirt/images/guest1.img
loop0p1 : 0 409600 /dev/loop0 63
loop0p2 : 0 10064717 /dev/loop0 409663
guest1
is a Linux guest. The first partition is the boot partition and the second partition is an EXT3 containing the root partition.
/dev/mapper/
.
# kpartx -a /var/lib/libvirt/images/guest1.img
# ls /dev/mapper/ loop0p1 loop0p2
loopXpY
.
/mnt/guest1
for mounting the partition.
# mkdir /mnt/guest1
# mount /dev/mapper/loop0p1
/mnt/guest1 -o loop,ro
/mnt/guest1
directory. Read or copy the files.
# umount /mnt/tmp
# kpartx -d /var/lib/libvirt/images/guest1.img
guest1.img
to the recognized devices in the /dev/mapper/
directory.
# kpartx -a /var/lib/libvirt/images/guest1.img
vgscan
command to find the new volume groups.
# vgscan Reading all physical volumes . This may take a while... Found volume group "VolGroup00" using metadata type lvm2
VolGroup00
by default) with the vgchange -ay
command.
# vgchange -ay VolGroup00 2 logical volumes in volume group VolGroup00 now active.
lvs
command to display information about the new volumes. The volume names (the LV
column) are required to mount the volumes.
# lvs LV VG Attr Lsize Origin Snap% Move Log Copy% LogVol00 VolGroup00 -wi-a- 5.06G LogVol01 VolGroup00 -wi-a- 800.00M
/dev/VolGroup00/LogVol00
in the /mnt/guestboot/
directory.
# mount /dev/VolGroup00/LogVol00 /mnt/guestboot
/mnt/guestboot
directory. Read or copy the files.
# umount /mnt/
VolGroup00
# vgchange -an VolGroup00
# kpartx -d /var/lib/libvirt/images/guest1.img
virsh nodeinfo
command provides information about how many sockets, cores and hyperthreads there are attached a host.
# virsh nodeinfo CPU model: x86_64 CPU(s): 8 CPU frequency: 1000 MHz CPU socket(s): 2 Core(s) per socket: 4 Thread(s) per core: 1 NUMA cell(s): 1 Memory size: 8179176 kB
virsh capabilities
to get additional output data on the CPU configuration.
# virsh capabilities
<capabilities>
<host>
<cpu>
<arch>x86_64</arch>
</cpu>
<migration_features>
<live/>
<uri_transports>
<uri_transport>tcp</uri_transport>
</uri_transports>
</migration_features>
<topology>
<cells num='2'>
<cell id='0'>
<cpus num='4'>
<cpu id='0'/>
<cpu id='1'/>
<cpu id='2'/>
<cpu id='3'/>
</cpus>
</cell>
<cell id='1'>
<cpus num='4'>
<cpu id='4'/>
<cpu id='5'/>
<cpu id='6'/>
<cpu id='7'/>
</cpus>
</cell>
</cells>
</topology>
<secmodel>
<model>selinux</model>
<doi>0</doi>
</secmodel>
</host>
[ Additional XML removed ]
</capabilities>
virsh freecell
command to display the free memory on all NUMA nodes.
# virsh freecell 0: 2203620 kB 1: 3354784 kB
virsh capabilities
command) about NUMA topology.
virsh capabilities
output.
<topology> <cells num='2'> <cell id='0'> <cpus num='4'> <cpu id='0'/> <cpu id='1'/> <cpu id='2'/> <cpu id='3'/> </cpus> </cell> <cell id='1'> <cpus num='4'> <cpu id='4'/> <cpu id='5'/> <cpu id='6'/> <cpu id='7'/> </cpus> </cell> </cells> </topology>
<cell id='1'>
, has physical CPUs 4 to 7.
cpuset
attribute to the configuration file.
virsh edit
.
vcpus
element.
<vcpus>4</vcpus>
cpuset
attribute with the CPU numbers for the relevant NUMA cell.
<vcpus cpuset='4-7'>4</vcpus>
virt-install
provisioning tool provides a simple way to automatically apply a 'best fit' NUMA policy when guests are created.
cpuset
option for virt-install
can use a CPU set of processors or the parameter auto
. The auto
parameter automatically determines the optimal CPU locking using the available NUMA data.
--cpuset=auto
with the virt-install
command when creating new guests.
virsh vcpuinfo
and virsh vcpupin
commands can perform CPU affinity changes on running guests.
virsh vcpuinfo
command gives up to date information about where each virtual CPU is running.
guest1
is a guest with four virtual CPUs is running on a KVM host.
# virsh vcpuinfo guest1
VCPU: 0
CPU: 3
State: running
CPU time: 0.5s
CPU Affinity: yyyyyyyy
VCPU: 1
CPU: 1
State: running
CPU Affinity: yyyyyyyy
VCPU: 2
CPU: 1
State: running
CPU Affinity: yyyyyyyy
VCPU: 3
CPU: 2
State: running
CPU Affinity: yyyyyyyy
virsh vcpuinfo
output (the yyyyyyyy
value of CPU Affinity
) shows that the guest can presently run on any CPU.
# virsh vcpupinguest1
0 4 # virsh vcpupinguest1
1 5 # virsh vcpupinguest1
2 6 # virsh vcpupinguest1
3 7
virsh vcpuinfo
command confirms the change in affinity.
# virsh vcpuinfo guest1
VCPU: 0
CPU: 4
State: running
CPU time: 32.2s
CPU Affinity: ----y---
VCPU: 1
CPU: 5
State: running
CPU time: 16.9s
CPU Affinity: -----y--
VCPU: 2
CPU: 6
State: running
CPU time: 11.9s
CPU Affinity: ------y-
VCPU: 3
CPU: 7
State: running
CPU time: 14.6s
CPU Affinity: -------y
macgen.py
. Now from that directory you can run the script using ./macgen.py
and it will generate a new MAC address. A sample output would look like the following:
$ ./macgen.py 00:16:3e:20:b0:11 #!/usr/bin/python # macgen.py script to generate a MAC address for virtualized guests on Xen # import random # def randomMAC(): mac = [ 0x00, 0x16, 0x3e, random.randint(0x00, 0x7f), random.randint(0x00, 0xff), random.randint(0x00, 0xff) ] return ':'.join(map(lambda x: "%02x" % x, mac)) # print randomMAC()
python-virtinst
의 내장 모듈을 사용하여 게스트 설정 파일에서 사용할 새 MAC 주소 및 UUID
를 생성할 수 있습니다:
# echo 'import virtinst.util ; print\ virtinst.util.uuidToString(virtinst.util.randomUUID())' | python # echo 'import virtinst.util ; print virtinst.util.randomMAC()' | python
#!/usr/bin/env python # -*- mode: python; -*- print "" print "New UUID:" import virtinst.util ; print virtinst.util.uuidToString(virtinst.util.randomUUID()) print "New MAC:" import virtinst.util ; print virtinst.util.randomMAC() print ""
rate
” parameter part of the VIF
entries can throttle virtualized guests.
rate
rate=
option can be added to the VIF=
entry in a virtual machine configuration file to limit a virtual machine's network bandwidth or specify a specific time interval for a time window.
rate=
옵션에서 옵션 사항입니다:
rate
파라미터 값 및 사용 예시
rate=10Mb/s
rate=250KB/s
rate=10MB/s@50ms
VIF
항목은 다음과 같이 나타납니다:
vif = [ 'rate=10MB/s , mac=00:16:3e:7a:55:1c, bridge=xenbr1']
rate
entry would limit the virtual machine's interface to 10MB/s for outgoing traffic
virsh
또는 virt-manager
명령을 사용하여 설정할 수 있습니다:
virsh
refer to 가상 CPU 친화력 설정 for more information.
virt-manager
refer to 26.11절. “가상 CPU 보기 ” for more information.
/boot/grub/grub.conf
. Managing several or more hosts configuration files quickly becomes difficult. System administrators often prefer to use the 'cut and paste' method for editing multiple grub.conf
files. If you do this, ensure you include all five lines in the Virtualization entry (or this will create system errors). Hypervisor specific values are all found on the 'xen
' line. This example represents a correct grub.conf
virtualization entry:
# boot=/dev/sda/ default=0 timeout=15 #splashimage=(hd0, 0)/grub/splash.xpm.gz hiddenmenu serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1 terminal --timeout=10 serial console title Red Hat Enterprise Linux Server (2.6.17-1.2519.4.21. el5xen) root (hd0, 0) kernel /xen.gz-2.6.17-1.2519.4.21.el5 com1=115200,8n1 module /vmlinuz-2.6.17-1.2519.4.21el5xen ro root=/dev/VolGroup00/LogVol00 module /initrd-2.6.17-1.2519.4.21.el5xen.img
'dom0_mem=256M'
. This example is the grub.conf
with the hypervisor's memory entry modified.
# boot=/dev/sda
default=0
timeout=15
#splashimage=(hd0,0)/grubs/splash.xpm.gz
hiddenmenu
serial --unit=0 --speed =115200 --word=8 --parity=no --stop=1
terminal --timeout=10 serial console
title Red Hat Enterprise Linux Server (2.6.17-1.2519.4.21. el5xen)
root (hd0,0)
kernel /xen.gz-2.6.17-1.2519.4.21.el5 com1=115200,8n1 dom0_mem=256MB
module /vmlinuz-2.6.17-1.2519.4.21.el5xen ro root=/dev/VolGroup00/LogVol00
module /initrd-2.6.17-1.2519.4.21.el5xen.img
ftpd
vsftpd
는 반가상화 게스트 (예: Red Hat Enterprise Linux 5 리포지터리) 또는 기타 다른 데이터에 대한 설치 트리로 액세스할 수 있게 합니다. 서버 설치시 vsftpd
를 설치하지 않은 경우 설치 미디어의 서버
디렉토리에서 RPM 패키지를 가져와서 rpm -ivh vsftpd*.rpm
을 사용하여 이를 설치할 수 있습니다. (RPM 패키지는 현재 디렉토리에 위치하고 있어야 함에 유의하십시오)
vsftpd
, edit /etc/passwd
using vipw
and change the ftp user's home directory to the directory where you are going to keep the installation trees for your para-virtualized guests. An example entry for the FTP user would look like the following:
ftp:x:14:50:FTP User:/xen/pub:/sbin/nologin
chkconfig --list vsftpd
를 사용하여 vsftpd
가 활성화되지 않았는지를 확인합니다:
$ chkconfig --list vsftpd vsftpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
chkconfig --levels 345 vsftpd on
을 실행합니다.
chkconfig --list vsftpd
명령을 사용하여 시스템 부팅 시 vsftpd
데몬을 시작하도록 활성화되어 있는지를 확인합니다:
$ chkconfig --list vsftpd vsftpd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
service vsftpd start vsftpd
를 사용하여 vsftpd 서비스를 시작합니다:
$service vsftpd start vsftpd Starting vsftpd for vsftpd: [ OK ]
udev
를 사용하여 LUN 지속성을 구현할 수 있습니다. 시스템에 LUN 지속성을 구현하기 전에 적절한 UUID를 갖고 있는지 확인하시기 바랍니다. UUID를 갖고 있으면 /etc
디렉토리의 scsi_id
파일을 편집하여 LUN 지속성을 구현할 수 있습니다. 편집 도구를 사용해 파일을 열어서 다음 줄의 주석처리를 해제해야 합니다:
# options=-b
# options=-g
scsi_id
명령을 사용합니다:
# scsi_id -g -s /block/sdc *3600a0b80001327510000015427b625e*
/etc/udev/rules.d
디렉토리에 있는 20-names.rules
파일을 편집합니다. 장치 이름 지정 규칙은 다음 형식을 따릅니다:
# KERNEL="sd*", BUS="scsi", PROGRAM="sbin/scsi_id", RESULT="UUID
", NAME="devicename
"
UUID
및 장치 이름
을 위의 UUID 검색 항목으로 대체하시기 바랍니다. 규칙은 다음과 비슷합니다:
KERNEL="sd*
", BUS="scsi", PROGRAM="sbin/scsi_id", RESULT="3600a0b80001327510000015427b625e
", NAME="mydevicename
"
/dev/sd*
패턴과 일치하는 모든 장치를 활성화합니다. 일치된 장치를 검색했을 때, /dev/devicename
이라는 장치 노드를 생성합니다. 이 예제에서 장치 노드는 /dev/mydevice
입니다. 마지막으로, /etc/rc.local
파일에 다음 경로를 추가해야 합니다:
/sbin/start_udev
/etc/
디렉토리에 있는 multipath.conf
파일을 편집하여 네 가지 장치를 정의해야 합니다:
multipath { wwid 3600a0b80001327510000015427b625e alias oramp1 } multipath { wwid 3600a0b80001327510000015427b6 alias oramp2 } multipath { wwid 3600a0b80001327510000015427b625e alias oramp3 } multipath { wwid 3600a0b80001327510000015427b625e alias oramp4 }
/dev/mpath/oramp1
, /dev/mpath/oramp2
, /dev/mpath/oramp3
, dev/mpath/oramp4
. 이 장치들은 /dev/mpath
디렉토리에 위치하며 LUN 이름은 LUN의 wwid에서 생성된 별칭으로 재부팅후 지속적으로 사용됩니다.
/sbin/service smartd stop /sbin/chkconfig --del smartd
/var/lib/xen
, the usually named vmlinuz.******
and initrd.******
. These files are the initrd and vmlinuz files from virtual machines which either failed to boot or failed for some other reason. These files are temporary files extracted from virtual machine's boot disk during the start up sequence. These files should be automatically removed after the virtual machine is shut down cleanly. Then you can safely delete old and stale copies from this directory.
vino-preferences
명령을 실행할 수 있습니다.
~/.vnc/xstartup
파일을 편집합니다. 처음으로 vncserver 스크립트를 실행할 경우 VNC 세션 용으로 사용할 암호를 묻게 됩니다.
xstartup
파일:
#!/bin/sh # Uncomment the following two lines for normal desktop: # unset SESSION_MANAGER # exec /etc/X11/xinit/xinitrc [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources #xsetroot -solid grey #vncconfig -iconic & #xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & #twm & if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then eval `dbus-launch --sh-syntax –exit-with-session` echo "D-BUS per-session daemon address is: \ $DBUS_SESSION_BUS_ADDRESS" fi exec gnome-session
uuidgen
command. Then for the vif
entries you must define a unique MAC address for each guest (if you are copying a guest configuration from an existing guest, you can create a script to handle it). For the xen bridge information, if you move an existing guest configuration file to a new host, you must update the xenbr
entry to match your local networking configuration. For the Device entries, you must modify the entries in the 'disk='
section to point to the correct guest image.
/etc/sysconfig/network
file to match the new guest's hostname.
ifconfig eth0
파일 출력 결과를 일치시키기 위해 /etc/sysconfig/network-scripts/ifcfg-eth0
파일에 있는 HWADDR
주소를 수정하고, 고정 IP 주소를 사용하려면 IPADDR
항목을 수정해야 합니다.
name
uuid
uuidgen
명령을 사용하여 재생성될 수 있습니다. 예시 UUID 출력 결과는 다음과 같습니다:
$ uuidgen a984a14f-4191-4d14-868e-329906b211e5
vif
xenbr
항목을 조정하였는 지를 확인해야 합니다 (brctl show
명령을 사용하여 브리지 정보를 얻을 수 있습니다).
disk=
부분에 있는 항목이 올바른 게스트 이미지를 가리키도록 조정되었는지를 확인합니다.
/etc/sysconfig/network
HOSTNAME
entry to the guest's new hostname
.
/etc/sysconfig/network-scripts/ifcfg-eth0
HWADDR
주소를 ifconfig eth0
에서의 출력 결과로 수정합니다.
IPADDR
항목을 수정합니다.
libvirt
를 사용하여 보다 간편하게 사용자 설정 스크립트 작성하는 방법에 대해 설명합니다.
libvirt
.
virsh
can handle XML configuration files. You may want to use this to your advantage for scripting large deployments with special options. You can add devices defined in an XML file to a running para-virtualized guest. For example, to add a ISO file as hdc
to a running guest create an XML file:
# cat satelliteiso.xml <disk type="file" device="disk"> <driver name="file"/> <source file="/var/lib/libvirt/images/rhn-satellite-5.0.1-11-redhat-linux-as-i386-4-embedded-oracle.iso"/> <target dev="hdc"/> <readonly/> </disk>Run
virsh attach-device
to attach the ISO as hdc
to a guest called "satellite" :
# virsh attach-device satellite satelliteiso.xml
차례
xentop
xentop
은 호스트 시스템 및 게스트 도메인에 관한 실시간 정보를 보여줍니다.
xm
dmesg
및 log
사용
vmstat
iostat
lsof
iostat
, mpstat
, sar
명령은 모두 sysstat
패키지에 의해 제공됩니다.
XenOprofile
systemtap
crash
sysrq
sysrq t
sysrq w
ifconfig
tcpdump
tcpdump
command 'sniffs' network packets. tcpdump
is useful for finding network abnormalities and problems with network authentication. There is a graphical version of tcpdump
named wireshark
.
brctl
brctl
은 Virtualization 리눅스 커널에서 이더넷 브리지 구성을 검사하고 설정하는 네트워크 도구입니다. 아래 예제 명령을 실행하려면 반드시 루트 권한이 있어야 합니다:
# brctl show bridge-name bridge-id STP enabled interfaces ----------------------------------------------------------------------------- xenbr0 8000.feffffff no vif13.0 xenbr1 8000.ffffefff yes pddummy0 xenbr2 8000.ffffffef no vif0.0 # brctl showmacs xenbr0 port-no mac-addr local? aging timer 1 fe:ff:ff:ff:ff: yes 0.00 2 fe:ff:ff:fe:ff: yes 0.00 # brctl showstp xenbr0 xenbr0 bridge-id 8000.fefffffffff designated-root 8000.fefffffffff root-port 0 path-cost 0 max-age 20.00 bridge-max-age 20.00 hello-time 2.00 bridge-hello-time 2.00 forward-delay 0.00 bridge-forward-delay 0.00 aging-time 300.01 hello-timer 1.43 tcn-timer 0.00 topology-change-timer 0.00 gc-timer 0.02
Server
리포지터리에 있습니다.
yum install vnc
command.
yum install vnc-server
명령을 사용하여 vncserver를 설치합니다.
/etc/xen/
입니다. 이 디렉토리에는 xend
데몬과 다른 가상 장치 설정 파일이 들어 있습니다. 네트워킹 스크립트 파일은 scripts
디렉토리에 있습니다.
/var/log/xen
디렉토리에 저장됩니다.
/var/lib/libvirt/images
디렉토리입니다.
/proc/xen/
디렉토리에 저장됩니다.
xend
데몬과 qemu-dm
프로세스라는 두 가지의 주요 유틸리티가 있으며, 이를 사용하여 /var/log/xen/
디렉토리에 여러 로그 파일을 작성합니다:
xend.log
는 일반적인 시스템 이벤트나 운영자에 의한 작업과 같이 xend
데몬에 의해 수집된 모든 데이터가 들어있는 로그 파일입니다. 모든 가상 장치 운영 작업 (예: 생성, 종료, 강제 종료 등)은 이 로그에 나타납니다. xend.log
는 주로 이벤트나 실행 문제를 추적할 때 가장 먼저 살펴보아야 할 파일입니다. 이는 오류 메세지에 대한 자세한 내용 및 상황이 들어 있습니다.
xend-debug.log
는 xend
및 가상화 하위 시스템 (예: 프레임 버퍼, Python 스크립트 등)에서 이벤트 오류 기록이 들어있는 로그 파일입니다.
xen-hotplug-log
는 핫플러그 이벤트의 데이터가 들어있는 로그 파일입니다. 장치 또는 네트워크 스크립트가 온라인으로 연결되지 않으면, 이벤트는 여기에 나타납니다.
qemu-dm.[PID].log
는 모든 완전 가상화 게스트를 위해 qemu-dm
프로세스에 의해 생성된 로그 파일입니다. 이 로그 파일을 사용할 때, ps
명령을 사용하여 가상 장치의 qemu-dm
프로세스를 분리하도록 프로세스 인수를 확인하여 반드시 주어진 qemu-dm
프로세스 PID를 검색해야 합니다. 반드시 [PID] 기호를 실제 PID qemu-dm
프로세스로 대체해야 하는 것에 주의하시기 바랍니다.
/.virt-manager
디렉토리에 있는 virt-manager.log
파일에 생성된 데이터를 살펴보셔야 합니다. 가상 장치 관리자를 시작할 때 마다, 기존의 로그 파일 내용은 덮어 쓰기 됨에 유의하시기 바랍니다. 따라서, 시스템 오류 발생 시 가상 장치 관리자를 재시작하기 전에 virt-manager.log
파일을 백업해 두시기 바랍니다.
/var/lib/libvirt/images
디렉토리에 위치합니다.
xend
데몬을 재시작하면, /var/lib/xen/xend-db
디렉토리에 위치한 xend-database
를 업데이트합니다.
xm dump-core
명령으로 실행)는 /var/lib/xen/dumps
디렉토리에 위치합니다.
/etc/xen
디렉토리에는 시스템 리소스를 관리하는 데 사용되는 설정 파일이 들어 있습니다. xend
데몬 설정 파일은 /etc/xen/xend-config.sxp
입니다. 이 파일은 전체 시스템 변경 및 네트워킹을 설정하기 위해 편집될 수 있지만 /etc/xen/
폴더에서 파일을 수동으로 편집하는 것은 권장하지 않습니다.
proc
명령은 시스템 정보를 검색할 수 있는 또 다른 리소스입니다. 이 proc 항목은 /proc/xen
디렉토리에 위치합니다:
/proc/xen/capabilities
/proc/xen/balloon
/proc/xen/xenbus/
xend.log
file contains the same basic information as when you run the xm log
command. This log is found in the /var/log/
directory. Here is an example log entry for when you create a domain running a kernel:
[2006-12-27 02:23:02 xend] ERROR (SrvBase: 163) op=create: Error creating domain: (0, 'Error') Traceback (most recent call list) File "/usr/lib/python2.4/site-packages/xen/xend/server/SrvBase.py" line 107 in_perform val = op_method (op,req) File "/usr/lib/python2.4/site-packages/xen/xend/server/SrvDomainDir.py line 71 in op_create raise XendError ("Error creating domain: " + str(ex)) XendError: Error creating domain: (0, 'Error')
xend-debug.log
에는 xend.log
보다 더 자세한 정보가 들어 있어 시스템 관리자에게 매우 유용합니다. 아래 예제에서는 동일한 커널 도메인 생성 시 발생하는 문제에 대한 동일한 오류 데이터를 보여줍니다:
ERROR: Will only load images built for Xen v3.0 ERROR: Actually saw: GUEST_OS=netbsd, GUEST_VER=2.0, XEN_VER=2.0; LOADER=generic, BSD_SYMTAB' ERROR: Error constructing guest OS
grub.conf
file to enable a 38400-bps serial console on com1
/dev/ttyS0
:
title Red Hat Enterprise Linux (2.6.18-8.2080_xen0) root (hd0,2) kernel /xen.gz-2.6.18-8.el5 com1=38400,8n1 module /vmlinuz-2.618-8.el5xen ro root=LABEL=/rhgb quiet console=xvc console=tty xencons=xvc module /initrd-2.6.18-8.el5xen.img
sync_console
은 비동기식 하이퍼바이저 콘솔 출력에서 제어 불능 상태를 가져오는 문제를 해결하도록 도와주며, "pnpacpi=off"
를 사용하면 직렬 콘솔에서 입력을 방해하는 문제를 해결할 수 있습니다. "console=ttyS0"
및 "console=tty"
파라미터는 일반 VGA 콘솔과 직렬 콘솔 모두에서 커널 오류가 로그로 기록되는 것을 의미합니다. ttywatch
를 설치하고 설정하여 표준 널 모뎀 케이블로 연결된 원격 호스트에서 데이터를 캡쳐할 수 있습니다. 예를 들어, 원격 호스트에서 다음을 입력합니다:
ttywatch --name myhost --port /dev/ttyS0
/dev/ttyS0
의 출력을 /var/log/ttywatch/myhost.log
파일로 보냅니다.
# virsh console [guest name, ID or UUID]
virt-manager
to display the virtual text console. In the guest console window, select Serial Console from the View menu.
grub.conf
file, and include the 'console =ttyS0 console=tty0'
parameter. This ensures that the kernel messages are sent to the virtual serial console (and the normal graphical console). To use the guest's serial console, you must edit the libvirt configuration file configuration file. On the host, access the serial console with the following command:
# virsh console
virt-manager
to display the virtual text console. In the guest console window, select Serial Console from the View menu.
xend
서비스를 시작할 때 아무것도 발생하지 않습니다. virsh list
를 입력하면 다음 내용이 출력될 것입니다:
Error: Error connecting to xend: Connection refused. Is xend running?
xend start
를 수동으로 실행하면 다음과 같이 더 많은 오류가 뜰 것입니다:
Error: Could not obtain handle on privileged command interfaces (2 = No such file or directory) Traceback (most recent call last:) File "/usr/sbin/xend/", line 33 in ? from xen.xend.server. import SrvDaemon File "/usr/lib/python2.4/site-packages/xen/xend/server/SrvDaemon.py" , line 26 in ? from xen.xend import XendDomain File "/usr//lib/python2.4/site-packages/xen/xend/XendDomain.py" , line 33, in ? from xen.xend import XendDomainInfo File "/usr/lib/python2.4/site-packages/xen/xend/image.py" , line37, in ? import images File "/usr/lib/python2.4/site-packages/xen/xend/image.py" , line30, in ? xc = xen.lowlevel.xc.xc () RuntimeError: (2, 'No such file or directory' )
kernel-xen
커널이 아닌 커널로 호스트를 재부팅했을 때 발생할 수 있는 상황입니다. 이 문제를 해결하려면, 부팅 시 kernel-xen
커널을 선택합니다. (또는 grub.conf
파일에서 기본값으로 kernel-xen
커널을 설정합니다)
"Invalid argument"
라는 오류 메세지가 나타납니다. 이것은 주로 시작하려는 커널 이미지가 hypervisor와 호환이 안되는 것을 의미하며, PAE 전용 FC6 hypervisor에서 PAE가 아닌 FC5 커널을 실행하려고 할 때 주로 발생합니다.
grub.conf
에서 기본 커널로 Vritualization 커널 대신 완전한 커널로 전환합니다.
/etc/sysconfig/kernel/
directory. You must ensure that kernel-xen
parameter is set as the default option in your grub.conf
file.
/boot/grub/grub.conf
파일을 수정합니다.
com1
에 있을 경우, com1=115200,8n1
, console=tty0
, console=ttyS0,115200
행을 삽입하여 /boot/grub/grub.conf
파일을 수정합니다.
title Red Hat Enterprise Linux 5 i386 Xen (2.6.18-92.el5xen) root (hd0, 8) kernel /boot/xen.gz-2.6.18-92.el5com1=115200,8n1
module /boot/vmlinuz-2.6.18-92.el5xen ro root=LABEL=VG_i386console=tty0
console=ttyS0,115200
module /boot/initrd-2.6.18-92.el5xen.img
com2
에 있을 경우 com2=115200,8n1 console=com2L
, console=tty0
, console=ttyS0,115200
행을 삽입하여 /boot/grub/grub.conf
파일을 수정합니다.
title Red Hat Enterprise Linux 5 i386 Xen (2.6.18-92.el5xen) root (hd0, 8) kernel /boot/xen.gz-2.6.18-92.el5 com2=115200,8n1 console=com2L module /boot/vmlinuz-2.6.18-92.el5xen ro root=LABEL=VG_i386 console=tty0 console=ttyS0,115200 module /boot/initrd-2.6.18-92.el5xen.img
com1
, com2
등)에 직렬 데이터를 출력합니다.
com2
포트를 사용하는 예에서, vmlinuz
행에 있는 console=ttyS0
파라미터가 사용되고 있습니다. console=ttyS0
로 사용되고 있는 모든 포트는 표준 Linux 동작이 아니며 Xen 환경에만 적용됩니다.
virsh console
" 또는 virt-manager
의 "Serial Console" 창을 사용하여 반가상화 게스트로 부터의 직렬 콘솔 출력 결과를 받을 수 있습니다. 이러한 절차를 사용하여 가상 직렬 콘솔을 설정합니다:
/boot/grub/grub.conf
를 편집합니다:
Red Hat Enterprise Linux 5 i386 Xen (2.6.18-92.el5xen) root (hd0, 0) kernel /boot/vmlinuz-2.6.18-92.el5xen ro root=LABEL=VG_i386 console=xvc0 initrd /boot/initrd-2.6.18-92.el5xen.img
xend
)을 설정할 수 있습니다.
xend
를 설정하려면 /etc/sysconfig/xend
를 편집합니다. 다음 항목을 변경합니다:
# Log all guest console output (cf xm console) #XENCONSOLED_LOG_GUESTS=no
# Log all guest console output (cf xm console) XENCONSOLED_LOG_GUESTS=yes
/var/log/xen/console
파일에 저장됩니다.
virsh console
" 명령을 사용하여 볼 수 있습니다.
ttyS0
또는 Windows 상에서는 COM1
이라고 부릅니다.
console=tty0 console=ttys0,115200
" 행을 삽입하여 /boot/grub/grub.conf
파일을 수정합니다.
title Red Hat Enterprise Linux Server (2.6.18-92.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-92.el5 ro root=/dev/volgroup00/logvol00
console=tty0 console=ttys0,115200
initrd /initrd-2.6.18-92.el5.img
virsh console
" 명령을 사용하여 직렬 콘솔 메세지를 확인합니다.
/var/log/xen/console
에 기록되지 않습니다.
virt-manager
or virt-install
tools on Red Hat Enterprise Linux 5, the guests configuration files are created automatically in the /etc/xen
directory.
name = "rhel5vm01" memory = "2048" disk = ['tap:aio:/var/lib/libvirt/images/rhel5vm01.dsk,xvda,w',] vif = ["type=ieomu, mac=00:16:3e:09:f0:12 bridge=xenbr0', "type=ieomu, mac=00:16:3e:09:f0:13 ] vnc = 1 vncunused = 1 uuid = "302bd9ce-4f60-fc67-9e40-7a77d9b4e1ed" bootloader = "/usr/bin/pygrub" vcpus=2 on_reboot = "restart" on_crash = "restart"
serial="pty"
는 구성 파일에 사용되는 디폴트입니다. 아래 예제는 완전 가상화 게스트에 대한 구성 파일을 보여줍니다:
name = "rhel5u5-86_64" builder = "hvm" memory = 500 disk = ['/var/lib/libvirt/images/rhel5u5-x86_64.dsk.hda,w'] vif = [ 'type=ioemu, mac=00:16:3e:09:f0:12, bridge=xenbr0', 'type=ieomu, mac=00:16:3e:09:f0:13, bridge=xenbr1'] uuid = "b10372f9-91d7-ao5f-12ff-372100c99af5' device_model = "/usr/lib64/xen/bin/qemu-dm" kernel = "/usr/lib/xen/boot/hvmloader/" vnc = 1 vncunused = 1 apic = 1 acpi = 1 pae = 1 vcpus =1 serial ="pty" # enable serial console on_boot = 'restart'
virsh dumpxml
및 virsh create
(또는 virsh edit
)를 사용하여 오류 및 안전성을 확인하는 libvirt
설정 파일 (xml 기반)을 편집합니다.
failed domain creation due to memory shortage, unable to balloon domain0
xend.log
파일을 확인해 보시기 바랍니다:
[2006-12-21] 20:33:31 xend 3198] DEBUG (balloon:133) Balloon: 558432 Kib free; 0 to scrub; need 1048576; retries: 20 [2006-12-21] 20:33:31 xend. XendDomainInfo 3198] ERROR (XendDomainInfo: 202 Domain construction failed
xm list domain0
명령을 사용하여 domain0에 의해 사용되고 있는 메모리 양을 확인할 수 있습니다. dom0는 축소되지 않을 경우, 메모리를 확인하기 위해 virsh setmem dom0 NewMemSize
명령을 사용할 수 있습니다.
wrong kernel image: non-PAE kernel on a PAE
# xm create -c va-base Using config file "va-base" Error: (22, 'invalid argument') [2006-12-14 14:55:46 xend.XendDomainInfo 3874] ERRORs (XendDomainInfo:202) Domain construction failed Traceback (most recent call last) File "/usr/lib/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 195 in create vm.initDomain() File " /usr/lib/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 1363 in initDomain raise VmError(str(exn)) VmError: (22, 'Invalid argument') [2006-12-14 14:55:46 xend.XendDomainInfo 3874] DEBUG (XenDomainInfo: 1449] XendDlomainInfo.destroy: domain=1 [2006-12-14 14:55:46 xend.XendDomainInfo 3874] DEBUG (XenDomainInfo: 1457] XendDlomainInfo.destroy:Domain(1)
Unable to open a connection to the Xen hypervisor or daemon
/etc/hosts
구성 파일에 localhost 항목이 없을 때 발생합니다. 파일을 확인하여 localhost 항목이 활성화되어 있는지 확인하시기 바랍니다. 아래 예제는 부정확한 localhost 항목을 보여줍니다:
# Do not remove the following line, or various programs # that require network functionality will fail. localhost.localdomain localhost
# Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost localhost.localdomain. localhost
xen-xend.logfile
파일에서 다음과 같은 오류가 나타날 수 있습니다:
Bridge xenbr1 does not exist!
# xm create mySQL01 Using config file " mySQL01" Going to boot Red Hat Enterprise Linux Server (2.6.18.-1.2747 .el5xen) kernel: /vmlinuz-2.6.18-12747.el5xen initrd: /initrd-2.6.18-1.2747.el5xen.img Error: Device 0 (vif) could not be connected. Hotplug scripts not working.
xend.log
는 다음과 같은 오류를 표시합니다:
[2006-11-14 15:07:08 xend 3875] DEBUG (DevController:143) Waiting for devices vif [2006-11-14 15:07:08 xend 3875] DEBUG (DevController:149) Waiting for 0 [2006-11-14 15:07:08 xend 3875] DEBUG (DevController:464) hotplugStatusCallback /local/domain/0/backend/vif/2/0/hotplug-status [2006-11-14 15:08:09 xend.XendDomainInfo 3875] DEBUG (XendDomainInfo:1449) XendDomainInfo.destroy: domid=2 [2006-11-14 15:08:09 xend.XendDomainInfo 3875] DEBUG (XendDomainInfo:1457) XendDomainInfo.destroyDomain(2) [2006-11-14 15:07:08 xend 3875] DEBUG (DevController:464) hotplugStatusCallback /local/domain/0/backend/vif/2/0/hotplug-status
/etc/xen
directory. For example, editing the guest mySQL01
# vim /etc/xen/mySQL01
Locate the vif
entry. Assuming you are using xenbr0
as the default bridge, the proper entry should resemble the following:
# vif = ['mac=00:16:3e:49:1d:11, bridge=xenbr0',]
# xm shutdown win2k3xen12 # xm create win2k3xen12 Using config file "win2k3xen12". /usr/lib64/python2.4/site-packages/xenxm/opts.py:520: Deprecation Warning: Non ASCII character '\xc0' in file win2k3xen12 on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details execfile (defconfig, globs, locs,) Error: invalid syntax 9win2k3xen12, line1)
/etc/xen/
디렉토리에 들어있는 내용 xend
데몬에 의해 사용된 설정 파일
scripts
디렉토리
/var/log/xen/
/var/lib/libvirt/images/
/proc/xen/
cat /proc/partitions
" 명령을 실행하여 이를 확인할 수 있습니다.
# cat /proc/partitions major minor #blocks name 202 16 104857600 xvdb 3 0 8175688 hda
/etc/inittab
파일에 추가합니다:
1:12345:respawn:/sbin/mingetty xvc0
Xen Virtual Ethernet
네트워크 카드를 인식할 수 없습니다. 다음을 실행하여 (Red Hat Enterprise Linux 4 및 Red Hat Enterprise Linux 5의 경우) 이를 확인합니다:
cat /etc/modprobe.conf
cat /etc/modules.conf
alias eth0 xen-vnif
alias eth0 xen-vnif
)을 추가해야 합니다.
/etc/modprobe.conf
에서 루프장치 수 설정을 조정할 수 있습니다. /etc/modprobe.conf
파일을 편집하고 이 파일에 다음의 행을 추가합니다:
options loop max_loop=64
phy: block device
또는 tap:aio
명령을 사용하시기 바랍니다. 완전 가상화 시스템 용 루프 장치 기반 게스트를 도입하려면 phy: device
또는 file: file
명령을 사용합니다.
dom0
has not ballooned down enough to provide space for a recently created or started guest. In your /var/log/xen/xend.log
, an example error message indicating this has occurred:
[2006-11-21 20:33:31 xend 3198] DEBUG (balloon:133) Balloon: 558432 KiB free; 0 to scrub; need 1048576; retries: 20. [2006-11-21 20:33:52 xend.XendDomainInfo 3198] ERROR (XendDomainInfo:202) Domain construction failedYou can verify the amount of memory currently used by
dom0
with the command “xm list Domain-0
”. If dom0
is not ballooned down you can use the command “xm mem-set Domain-0 NewMemSize
” where NewMemSize
should be a smaller value.
# xm create testVM Using config file "./testVM". Going to boot Red Hat Enterprise Linux Server (2.6.18-1.2839.el5) kernel: /vmlinuz-2.6.18-1.2839.el5 initrd: /initrd-2.6.18-1.2839.el5.img Error: (22, 'Invalid argument')In the above error you can see that the kernel line shows that the system is trying to boot a non kernel-xen kernel. The correct entry in the example is ”
kernel: /vmlinuz-2.6.18-1.2839.el5xen
”.
/etc/grub.conf
설정 파일에서 부팅하기 위해 디폴트 커널로 되어 있는 지를 확인합니다.
kernel-xen
이 설치되어 있을 경우 게스트를 시작할 수 있습니다:
xm create -c GuestName
GuestName
is the name of the guest. The previous command will present you with the GRUB boot loader screen and allow you to select the kernel to boot. You will have to choose the kernel-xen kernel to boot. Once the guest has completed the boot process you can log into the guest and edit /etc/grub.conf
to change the default boot kernel to your kernel-xen. Simply change the line “default=X
” (where X is a number starting at '0
') to correspond to the entry with your kernel-xen line. The numbering starts at '0
' so if your kernel-xen entry is the second entry you would enter '1
' as the default,for example “default=1
”.
# xm create -c va-base Using config file "va-base". Error: (22, 'Invalid argument') [2006-12-14 14:55:46 xend.XendDomainInfo 3874] ERROR (XendDomainInfo:202) Domain construction failed Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 195, in create vm.initDomain() File "/usr/lib/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 1363, in initDomain raise VmError(str(exn)) VmError: (22, 'Invalid argument') [2006-12-14 14:55:46 xend.XendDomainInfo 3874] DEBUG (XendDomainInfo:1449) XendDomainInfo.destroy: domid=1 [2006-12-14 14:55:46 xend.XendDomainInfo 3874] DEBUG (XendDomainInfo:1457) XendDomainInfo.destroyDomain(1)If you need to run a 32 bit or non-PAE kernel you will need to run your guest as a fully-virtualized virtual machine. The rules for hypervisor compatibility are:
Your CPU does not support long mode. Use a 32 bit distribution
. This problem is caused by a missing or incorrect pae
setting. Ensure you have an entry “pae=1
” in your guest's configuration file.
virt-manager
어플리케이션이 시작 실패하여 “Unable to open a connection to the Xen hypervisor/daemon
”과 같은 오류가 나타날 수 도 있습니다. 이는 주로 /etc/hosts
파일에서 localhost
항목이 생략되었기 때문입니다. localhost
항목이 있는 지를 확인하고 /etc/hosts
에서 생략되어 있을 경우 localhost
에 대한 새 항목을 삽입합니다. 잘못된 /etc/hosts
파일은 다음과 유사하게 나타납니다:
# Do not remove the following line, or various programs # that require network functionality will fail. localhost.localdomain localhost
# Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost localhost.localdomain localhost
Applying Intel CPU microcode update: FATAL: Module microcode not found. ERROR: Module microcode does not exist in /proc/modulesAs the virtual machine is running on virtual CPUs there is no point updating the microcode. Disabling the microcode update for your virtual machines will stop this error:
/sbin/service microcode_ctl stop /sbin/chkconfig --del microcode_ctl
xm create
”는 설정 파일에 대한 현재 디렉토리를 살펴보고 /etc/xen
파일을 살펴봅니다.
# xm shutdown win2k3xen12 # xm create win2k3xen12 Using config file "win2k3xen12". /usr/lib64/python2.4/site-packages/xen/xm/opts.py:520: DeprecationWarning: Non-ASCII character '\xc0' in file win2k3xen12 on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details execfile(defconfig, globs, locs) Error: invalid syntax (win2k3xen12, line 1)
Enabling the virtualization extensions in BIOS
cat /proc/cpuinfo | grep vmx svm
을 실행합니다. 명령이 결과를 출력하면 가상화 확장자가 활성화된 것입니다. 시스템에 출력 결과가 없을 경우 가상화 확장자가 없거나 BIOS 설정이 올바르게 활성화되지 않은 것입니다.
virsh
command (where GUEST
is the guest's name):
# virsh edit GUEST
virsh edit
명령은 $EDITOR
쉘 변수를 사용하여 사용할 편집기를 결정합니다.
<interface type='network'>
[output truncated]
<model type='rtl8139' />
</interface>
'rtl8139'
to 'e1000'
. This will change the driver from the rtl8139 driver to the e1000 driver.
<interface type='network'>
[output truncated]
<model type='e1000'
/>
</interface>
# virsh dumpxml GUEST > /tmp/guest.xml
# cp /tmp/guest.xml /tmp/new-guest.xml # vi /tmp/new-guest.xml
<interface type='network'>
[output truncated]
<model type='e1000' />
</interface>
# virsh define /tmp/new-guest.xml # virsh start new-guest
/var/log/xen/
xend
데몬 및 qemu-dm 프로세스에 의해 생성된 모든 로그 파일이 들어 있는 디렉토리입니다.
xend.log
xend-debug.log
xen-hotplug.log
qemu-dm.PID
.log
qemu-dm
프로세스에 의해 생성됩니다.
PID
는 관련된 qemu-dm 프로세스의 PID
로 대체합니다
ps
명령을 사용하여 주어진 qemu-dm
프로세스에 해당하는 PID
를 검색할 수 있으며 프로세스 인수에서 qemu-dm
프로세스가 속한 가상 장치를 확인할 수 있습니다.
.virt-manager
in the user's home
directory whom ran virt-manager. This directory will usually be ~/.virt-manager/virt-manager
.
/var/lib/libvirt/images/
/var/lib/xen/xend-db/
/etc/xen/
/etc/xen/xend-config.sxp
는 xend 데몬에 대한 주요 설정입니다. xend-config.sxp
파일은 libvirt
에 의해 설정되지 않은 기타 다른 기능 및 이전 기능을 활성/비활성합니다. 기타 다른 기능의 경우 libvirt
를 사용합니다.
/var/lib/xen/dump/
xm dump-core
명령을 사용할 때 생성되는 덤프가 있습니다.
/proc/xen/
xen-kernel
정보를 저장합니다:
/proc/xen/capabilities
/proc/xen/privcmd
/proc/xen/balloon
/proc/xen/xenbus
/proc/xen/xsd_port
/proc/xen/xsd_kva
# insmod xen-platform-pci.o Warning: kernel-module version mismatch xen-platform-pci.o was compiled for kernel version 2.4.21-52.EL while this kernel is version 2.4.21-50.EL xen-platform-pci.o: unresolved symbol __ioremap_R9eac042a xen-platform-pci.o: unresolved symbol flush_signals_R50973be2 xen-platform-pci.o: unresolved symbol pci_read_config_byte_R0e425a9e xen-platform-pci.o: unresolved symbol __get_free_pages_R9016dd82 [...]The solution is to use the correct RPM package for your hardware architecture for the para-virtualized drivers.
Warning: kernel-module version mismatch xen-platform-pci.o was compiled for kernel version 2.4.21-52.EL while this kernel is version 2.4.21-50.EL Warning: loading xen-platform-pci.o will taint the kernel: forced load See http://www.tux.org/lkml/#export-tainted for information about tainted modules Module xen-platform-pci loaded, with warnings
# cd /lib/modules/`uname -r`/ # find . -name 'xen_*.ko' -print
# insmod \ /lib/modules/'uname -r'/{LocationofPV-drivers}/xen_platform_pci.ko # insmod /lib/modules/'uname -r'/{LocationofPV-drivers}/xen_balloon.ko # insmod /lib/modules/'uname -r'/{LocationofPV-drivers}/xen_vnif.ko # insmod /lib/modules/'uname -r'/{LocationofPV-drivers}/xen_vbd.ko
/var/log/messages
# grep -E "vif|vbd|xen" /var/log/messages xen_mem: Initialising balloon driver vif vif-0: 2 parsing device/vif/0/mac vbd vbd-768: 19 xlvbd_add at /local/domain/0/backend/vbd/21/76 vbd vbd-768: 19 xlvbd_add at /local/domain/0/backend/vbd/21/76 xen-vbd: registered block device major 202You can also use the
lsmod
command to list the loaded para-virtualized drivers. It should output a list containing the xen_vnif
, xen_vbd
, xen_platform_pci
and xen_balloon
modules.
# lsmod|grep xen xen_vbd 19168 1 xen_vnif 28416 0 xen_balloon 15256 1 xen_vnif xen_platform_pci 98520 3 xen_vbd,xen_vnif,xen_balloon,[permanent]
type=ioemu
' part of 'vif
=' line in your guest's configuration file.
domU
refers to the guest operating systems which run on the host system (the dom0 domain).
/dev/VolGroup00/LogVol02
),
/dev/sda5
), and
/dev/sda
).
tap:aio
tap:aio
parameter sets the Xen hypervisor to use an advanced access mode designed for safety and performance. File-based, are accessed using a kernel thread and a user-space process. The tap:aio
method respects guest flush requests which makes it safer than the file
driver. The virtualization tools use tap:aio
by default for accessing file-based guest disks on the Xen Hypervisor.
ext2
및 ext3
파일 시스템 식별자, RAID 장치 식별자, iSCSI 및 LUN 장치 식별자, MAC 주소와 가상 장치 식별자가 있습니다.
libvirt
가상화 API의 공식 웹사이트입니다.
/usr/share/doc/xen-<version-number>
/
는 디렉토리로 Xen 반 가상화 하이퍼바이저와 관리 도구에 대한 내용을 다루고 있으며, 다양한 구성 예제, 하드웨어 전용 정보, 현재 Xen 업스트림 사용자 문서 자료가 들어 있습니다.
man virsh
및 /usr/share/doc/libvirt-<version-number>
— virsh
가상 장치 관리 유틸리티에 대한 하위 명령과 옵션 및 libvirt
가상화 라이브러리 API에 관한 종합적인 정보를 다룹니다.
/usr/share/doc/gnome-applet-vm-<version-number>
— 내부에서 실행 중인 가상 장치를 감시하고 관리하는 GNOME 그래픽형식 패널 애플릿에 대한 문서자료입니다.
/usr/share/doc/libvirt-python-<version-number>
— libvirt
라이브러리에서 Python 바인딩에 대한 상세정보를 제공합니다. Python 개발자는 libvirt-python
패키지를 사용하여 libvirt
가상화 관리 라이브러리와 연동하는 프로그램을 생성할 수 있습니다.
/usr/share/doc/python-virtinst-<version-number>
— 가상 장치안에서 Fedora와 Red Hat Enterprise Linux 관련 배포판 설치를 시작하도록 도와주는 virt-install
명령에 대한 문서 자료를 제공합니다.
/usr/share/doc/virt-manager-<version-number>
— 가상 장치를 관리하기 위한 그래픽형식 도구를 제공하는 가상 장치 관리자에 대한 문서 자료를 제공합니다.