virtualisiertes FreeBSD mit virtio
Friday, March 8. 2013
FreeBSD mit virtio Storages scheint nun auch zu funktionieren- ich habe ein Fedora18 mit 4 SSDs im Raid10 mit BTRFS. Da drauf denn mit KVM ein FreeBSD-STABLE. Im GENERIC-Kernel sind nun folgende Optionen enthalten
# VirtIO support
device virtio # Generic VirtIO bus (required)
device virtio_pci # VirtIO PCI Interface
device vtnet # VirtIO Ethernet device
device virtio_blk # VirtIO Block device
device virtio_scsi # VirtIO SCSI device
device virtio_balloon # VirtIO Memory Balloon device
im dmesg sieht man daraufhin folgende devices:
virtio_pci0: port 0xc0c0-0xc0df mem 0xfc058000-0xfc058fff irq 10 at device 5.0 on pci0
virtio_pci1: port 0xc0e0-0xc0ff irq 10 at device 6.0 on pci0
vtballoon0: on virtio_pci1
virtio_pci1: host features: 0x71000002
virtio_pci1: negotiated features: 0x0
virtio_pci2: port 0xc040-0xc07f mem 0xfc059000-0xfc059fff irq 11 at device 7.0 on pci0
vtblk0: on virtio_pci2
virtio_pci2: host features: 0x710006d4
virtio_pci2: negotiated features: 0x10000254
vtblk0: 2000MB (4096000 512 byte sectors)
nun kann man z.B. mit sade das Device anfassen, mounten und mal drauf schreiben
root@horst:~ # newfs /dev/vtbd0s1
/dev/vtbd0s1: 1999.7MB (4095440 sectors) block size 32768, fragment size 4096
using 4 cylinder groups of 499.94MB, 15998 blks, 64000 inodes.
super-block backups (for fsck_ffs -b #) at:
192, 1024064, 2047936, 3071808
root@horst:~ # mount /dev/vtbd0s1 /virtio
root@horst:~ # dd if=/dev/zero of=/virtio/bla.bin bs=1M count=1k
1024+0 records in
1024+0 records out
1073741824 bytes transferred in 2.458653 secs (436719552 bytes/sec)
root@horst:~ #
# VirtIO support
device virtio # Generic VirtIO bus (required)
device virtio_pci # VirtIO PCI Interface
device vtnet # VirtIO Ethernet device
device virtio_blk # VirtIO Block device
device virtio_scsi # VirtIO SCSI device
device virtio_balloon # VirtIO Memory Balloon device
im dmesg sieht man daraufhin folgende devices:
virtio_pci0:
virtio_pci1:
vtballoon0:
virtio_pci1: host features: 0x71000002
virtio_pci1: negotiated features: 0x0
virtio_pci2:
vtblk0:
virtio_pci2: host features: 0x710006d4
virtio_pci2: negotiated features: 0x10000254
vtblk0: 2000MB (4096000 512 byte sectors)
nun kann man z.B. mit sade das Device anfassen, mounten und mal drauf schreiben
root@horst:~ # newfs /dev/vtbd0s1
/dev/vtbd0s1: 1999.7MB (4095440 sectors) block size 32768, fragment size 4096
using 4 cylinder groups of 499.94MB, 15998 blks, 64000 inodes.
super-block backups (for fsck_ffs -b #) at:
192, 1024064, 2047936, 3071808
root@horst:~ # mount /dev/vtbd0s1 /virtio
root@horst:~ # dd if=/dev/zero of=/virtio/bla.bin bs=1M count=1k
1024+0 records in
1024+0 records out
1073741824 bytes transferred in 2.458653 secs (436719552 bytes/sec)
root@horst:~ #

