Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

20.23. KVM 게스트 가상 머신에 멀티 기능 PCI 장치 추가

KVM 게스트 가상 머신에 다중 기능 PCI 장치를 추가하려면 다음을 수행합니다.
  1. virsh edit guestname 명령을 실행하여 게스트 가상 시스템의 XML 구성 파일을 편집합니다.
  2. <address> 요소에서 multifunction='on' 속성을 추가합니다. 이를 통해 특정 다중 함수 PCI 장치에 다른 기능을 사용할 수 있습니다.
    <disk type='file' device='disk'>
    <driver name='qemu' type='raw' cache='none'/>
    <source file='/var/lib/libvirt/images/rhel62-1.img'/>
    <target dev='vda' bus='virtio'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
    </disk>
    
    두 함수가 있는 PCI 장치의 경우 XML 구성 파일을 수정하여 첫 번째 장치와 동일한 슬롯 번호와 동일한 두 번째 장치 및 function='0x1 과 다른 함수 번호를 포함합니다. 예를 들면 다음과 같습니다.
    <disk type='file' device='disk'>
    <driver name='qemu' type='raw' cache='none'/>
    <source file='/var/lib/libvirt/images/rhel62-1.img'/>
    <target dev='vda' bus='virtio'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
    </disk>
    <disk type='file' device='disk'>
    <driver name='qemu' type='raw' cache='none'/>
    <source file='/var/lib/libvirt/images/rhel62-2.img'/>
    <target dev='vdb' bus='virtio'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
    </disk>
    
  3. lspci 명령을 실행합니다. KVM 게스트 가상 시스템의 출력에는 virtio 블록 장치가 표시됩니다.
    $ lspci
    
    00:05.0 SCSI storage controller: Red Hat, Inc Virtio block device
    00:05.1 SCSI storage controller: Red Hat, Inc Virtio block device
    
    참고
    serialBIOS 애플리케이션은 BIOS 인터페이스와의 호환성을 위해 실제 모드에서 실행됩니다. 이렇게 하면 사용 가능한 메모리 양이 제한됩니다. 결과적으로 foBIOS는 제한된 수의 디스크 만 처리 할 수 ​​있습니다. 현재 지원되는 디스크 수는 다음과 같습니다.
    • virtio-scsi — 64
    • virtio-blk - 4
    • AHCI/sata - 24 (4개의 포트가 모두 연결된 컨트롤러)
    • usb-storage — 4
    이 문제에 대한 해결 방법으로 많은 수의 디스크를 가상 머신에 연결할 때 시스템 디스크에 작은 pci 슬롯 번호가 있는지 확인하십시오. 따라서 screenBIOS는 pci 버스를 스캔할 때 먼저 확인합니다. 디스크당 메모리 오버헤드가 작기 때문에 virtio-blk 대신 virtio-scsi 장치를 사용하는 것도 좋습니다.