I’ve gotten most of the way though setting up PCI passthrough but stuck at setting up the storage pool for the VM…
This is what I get when trying to create it:
Error creating pool: Could not build storage pool: Storage pool already built: Format of device '/dev/sda' does not match the expected format 'unknown', forced overwrite is necessary
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 88, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/createpool.py", line 446, in _async_pool_create
poolobj = self._pool.install(create=True, meter=meter, build=build)
File "/usr/share/virt-manager/virtinst/storage.py", line 544, in install
raise RuntimeError(errmsg)
RuntimeError: Could not build storage pool: Storage pool already built: Format of device '/dev/sda' does not match the expected format 'unknown', forced overwrite is necessary
I’ve already tried formatting the /dev/sda device to unallocated (no partitions) & cleared/Unknown. I’ve re-created the table as GPT.
I’ve tried running virt-manager with sudo - no luck.
No commands, at least not that I can see. I’m sure something is happening but I’m not aware of how to find out.
I’m using the virt-manager (Virtual Machine Manager) GUI in Ubuntu to try to set up a VM. Part of that process is choosing the storage location/image.
Instead of setting up a raw image on a mounted partition in the host OS, I’d like to just set up the Storage Pool for the VM as a Disk that’s passed directly to the VM. As in /dev/sda in this case.
Tried sudo dd if=/dev/zero of=/dev/sda bs=1GB and it looks like it worked but took longer than expected.
I can create a Volume now with virt-manager but I don’t know what I should fill in. I just want it to use 100% of the drive:
At least from here, it looks like those ought to maybe be set to the same thing? Super ambiguous what each represents… (I went ahead and just maxed them both out)
At this moment, the drive is mounted via virt-manager and fully functional but I’m pretty sure if I reboot, it will fail to re-mount (it has once already anyway).
If possible, I’d like to verify that it will in fact be re-mounting automatically at startup before rebooting the host as I don’t want to have to format the drive and start over.
Storage Pools in Virtual Machine Manager
fdisk -l
Disk /dev/sda: 223.6 GiB, 240057409536 bytes, 468862128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2fb0da7b
Device Boot Start End Sectors Size Id Type
/dev/sda1 63 467668214 467668152 223G 83 Linux
As for the virt-manager config stuff, this is the only info I’ve been able to gather on my own (practically zero experience with command line kvm/qemu stuff):
:/etc/libvirt/storage$ sudo cat SPCC.xml
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
virsh pool-edit SPCC
or other application using the libvirt API.
-->
<pool type='disk'>
<name>SPCC</name>
<uuid>4b793b32-8e87-44d3-bb33-c5a5ba1bf0b6</uuid>
<capacity unit='bytes'>0</capacity>
<allocation unit='bytes'>0</allocation>
<available unit='bytes'>0</available>
<source>
<device path='/dev/sda'/>
<format type='unknown'/>
</source>
<target>
<path>/media/SPCC</path>
</target>
</pool>
Which doesn’t seem to totally line up with the virsh pool-edit SPCC contents:
If you want to pass through a raw disk device, you don’t create a storage pool. Storage pools store images.
In the storage selection step, select “Select or create custom storage”, then type /dev/sda in the entry field. Click Forward.
Actually, it’s better if you don’t use the /dev/sd* entries for this, use the link to the device in the /dev/disk/by-id directory. This way, if the name of the device changes (because you plugged in a usb drive or whatever), it’ll still work.
It is peculiar you say that given that there is a "Physical Disk Device" option:
But since it doesn’t seem fully functional I’m happy to oblige. I did locate the full by-id path: /dev/disk/by-id/ata-SPCC_Solid_State_Disk_0043000140 which I tried adding as described but failed to boot.
Just to test locally I removed the existing vdisk and tried adding it as recommended. I turned off and removed the old storage pool as seen by virt-manager.
All the disk by-id entries
:~$ ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root 9 Jan 31 13:48 ata-Kingston_SHPM2280P2_240G_50026B727200513E -> ../../sdb
lrwxrwxrwx 1 root root 10 Jan 31 13:48 ata-Kingston_SHPM2280P2_240G_50026B727200513E-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Jan 31 13:48 ata-Kingston_SHPM2280P2_240G_50026B727200513E-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Jan 31 13:48 ata-Kingston_SHPM2280P2_240G_50026B727200513E-part3 -> ../../sdb3
lrwxrwxrwx 1 root root 9 Jan 31 13:48 ata-SPCC_Solid_State_Disk_0043000140 -> ../../sda
lrwxrwxrwx 1 root root 10 Feb 2 23:50 ata-SPCC_Solid_State_Disk_0043000140-part1 -> ../../sda1
This one appears to work as described /dev/disk/by-id/ata-SPCC_Solid_State_Disk_0043000140-part1 would be the alternative.
Works locally, going to test rebooting with auto-start of the VM. Works perfectly. Thanks a bunch!
I’m noticing less than bare metal for sure however. Entirely separate issue but on bare metal, the 390x could handle tomb raider maxed out no problem. Can’t quite get there with PCI pass-through.
However trying to install win10.iso -> raw disk will not yield great results… testing now. will update when i install windows to that harddrive on host machine vs VM and see if its a better process
You can try passing through a HDD of the Win10 bare metal install instead. I have a R9 390 passed through with almost bare metal performance. Only when I did my setup like this, did I have close to bare metal performance.
To pass through the HDD using virt manager, just go about creating a VM like normal, creating a qcow2 image to get you through the VM creation process. Once you are able to edit the VM afterwards, delete the qcow2 image then head to add hardware to pass through your HDD, which should work without requiring you to create a storage pool.
*I suggest you install your windows to bare metal while having you other OS drives disconnected do that it doesn’t mess with the boot-loader.