저는 kvm을 사용하여 가상 머신을 실행하여 네트워크 스위치를 시뮬레이션하고 있습니다. 많은 링크를 시뮬레이션해야 하므로 모두 PCI 연결을 사용합니다. 27개 이상의 인터페이스를 연결하면 오류가 발생합니다.
이것은 컴퓨터를 시작하는 데 사용하는 명령입니다.
/usr/libexec/qemu-kvm -m 2048 -name vm1 -device e1000,netdev=net0,mac=DE:AD:BE:EF:8D:11 -netdev tap,id=net0,script=sonic-if-mgmt-script -device e1000,netdev=net1,mac=DE:AD:BE:EF:8D:12 -netdev tap,id=net1,script=sonic-if-data-script -device e1000,netdev=net2,mac=DE:AD:BE:EF:8D:13 -netdev tap,id=net2,script=sonic-if-data-script -device e1000,netdev=net3,mac=DE:AD:BE:EF:8D:14 -netdev tap,id=net3,script=sonic-if-data-script -device e1000,netdev=net4,mac=DE:AD:BE:EF:8D:15 -netdev tap,id=net4,script=sonic-if-data-script -device e1000,netdev=net5,mac=DE:AD:BE:EF:8D:16 -netdev tap,id=net5,script=sonic-if-data-script -device e1000,netdev=net6,mac=DE:AD:BE:EF:8D:17 -netdev tap,id=net6,script=sonic-if-data-script -device e1000,netdev=net7,mac=DE:AD:BE:EF:8D:18 -netdev tap,id=net7,script=sonic-if-data-script -device e1000,netdev=net8,mac=DE:AD:BE:EF:8D:19 -netdev tap,id=net8,script=sonic-if-data-script -device e1000,netdev=net9,mac=DE:AD:BE:EF:8D:1A -netdev tap,id=net9,script=sonic-if-data-script -device e1000,netdev=net10,mac=DE:AD:BE:EF:8D:1B -netdev tap,id=net10,script=sonic-if-data-script -device e1000,netdev=net11,mac=DE:AD:BE:EF:8D:1C -netdev tap,id=net11,script=sonic-if-data-script -device e1000,netdev=net12,mac=DE:AD:BE:EF:8D:1D -netdev tap,id=net12,script=sonic-if-data-script -device e1000,netdev=net13,mac=DE:AD:BE:EF:8D:1E -netdev tap,id=net13,script=sonic-if-data-script -device e1000,netdev=net14,mac=DE:AD:BE:EF:8D:1F -netdev tap,id=net14,script=sonic-if-data-script -device e1000,netdev=net15,mac=DE:AD:BE:EF:8D:20 -netdev tap,id=net15,script=sonic-if-data-script -device e1000,netdev=net16,mac=DE:AD:BE:EF:8D:21 -netdev tap,id=net16,script=sonic-if-data-script -device e1000,netdev=net17,mac=DE:AD:BE:EF:8D:22 -netdev tap,id=net17,script=sonic-if-data-script -device e1000,netdev=net18,mac=DE:AD:BE:EF:8D:23 -netdev tap,id=net18,script=sonic-if-data-script -device e1000,netdev=net19,mac=DE:AD:BE:EF:8D:24 -netdev tap,id=net19,script=sonic-if-data-script -device e1000,netdev=net20,mac=DE:AD:BE:EF:8D:25 -netdev tap,id=net20,script=sonic-if-data-script -device e1000,netdev=net21,mac=DE:AD:BE:EF:8D:26 -netdev tap,id=net21,script=sonic-if-data-script -device e1000,netdev=net22,mac=DE:AD:BE:EF:8D:27 -netdev tap,id=net22,script=sonic-if-data-script -device e1000,netdev=net23,mac=DE:AD:BE:EF:8D:28 -netdev tap,id=net23,script=sonic-if-data-script -device e1000,netdev=net24,mac=DE:AD:BE:EF:8D:29 -netdev tap,id=net24,script=sonic-if-data-script -device e1000,netdev=net25,mac=DE:AD:BE:EF:8D:2A -netdev tap,id=net25,script=sonic-if-data-script -device e1000,netdev=net26,mac=DE:AD:BE:EF:8D:2B -netdev tap,id=net26,script=sonic-if-data-script -device e1000,netdev=net27,mac=DE:AD:BE:EF:8D:2C -netdev tap,id=net27,script=sonic-if-data-script -device e1000,netdev=net28,mac=DE:AD:BE:EF:8D:2D -netdev tap,id=net28,script=sonic-if-data-script -vnc 0.0.0.0:9095 -vga std -drive file=vm1.img,media=disk,if=virtio,index=0 -serial telnet:127.0.0.1:9095,server
내가 얻는 오류는 다음과 같습니다.
kvm: -drive file=vm1.img,media=disk,if=virtio,index=0: PCI: no slot/function available for virtio-blk-pci, all in use
kvm: -drive file=vm1.img,media=disk,if=virtio,index=0: Device initialization failed.
kvm: -drive file=vm1.img,media=disk,if=virtio,index=0: Device 'virtio-blk-pci' could not be initialized
이 질문은 다음 질문과 유사합니다.
libvirtd: 더 이상 사용 가능한 PCI 슬롯이 없습니다
아니면 이거:
https://www.suse.com/support/kb/doc/?id=000019383
하지만 내 경우에는 virsh를 사용하지 않기 때문에 이 기능을 어떻게 복제할 수 있는지 잘 모르겠습니다.
감사해요