help needed: legacy linux and virtio block - howto to map vdX to target sdX for guest

p3x-749

Active Member
Jan 19, 2010
103
0
36
Hi Folks,

sorry if this has been asked before but I couldn't find a solution as of today.

For a legacy app, based on slackware linux, I was able to produce a
custom kernel with kvm & virtio support, to be used in a guest-VM.


However the legacy Application to be run
requires the namespace for block devices to follow the scsi model (/dev/sdX).
I'd like to use the virtio block drivers instead of the scsi drivers.
Since I cannot change the application, I wonder if it is possible to change
the target naming for virtio devices from /dev(vdX into /dev/sdX in the guest.

my first thoughts:
- change udev rules in guest ?
- patch kvm / virtio modules in guest ?
- configure VM config on host ?
- wait until virtio_scsi in qemu has been made available/stable ?
- any other ideas ?

TIA,
p3x-749
 
Re: help needed: legacy linux and virtio block - howto to map vdX to target sdX for g

Hi,

that is a good question which I want to have an answer, too.

I want to migrate linux-kvm´s from ide to virtio and from scsi to virtio.

TIA,
macday
 
Re: help needed: legacy linux and virtio block - howto to map vdX to target sdX for g

Have you tried symlinking the devices? They should work.

Yes, I tried that but it did not work....thought it was caused by different major-minor numbers from vdX in comparison to that of sdX in the devices.
But thinking of it, I might have done something wrong or rather incomplete before testing that.
I just learned that the App is also relying on some symlinks created by udev (/dev/disk-by/....) entries.

...will re-test.
 
Re: help needed: legacy linux and virtio block - howto to map vdX to target sdX for g

OK, I solved it for my legacy App.

My solution might be specific to my situation.
The general approach could be creating symlinks named sdX for each vdX device.
If your Application can address it, the virtio block device should be fine.

My Application relies heavily on population of the drives in /dev/disks/by-* directories.
Currently there seems to be a problem with passing/creating a serial-ID for a virtio-blk device.
This results in an incomplete population of the virtio devices by udevd into the /dev/disks/by-* directories.

My solution:
1) I created a patch of the udev ruleset (60-persistant-storage.rules) that creates appropriate symlinks
2) I patched my legacy Application to accept vdX devices

...another problem solved by the helpdesk from hell :D
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!