WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: missing disk block devices in virtual machine  (Read 3418 times)

Offline rmrichesjr

  • Newbie
  • *
  • Posts: 19
missing disk block devices in virtual machine
« on: May 01, 2012, 10:55:07 AM »
I'm running a remastered Tiny Core 4.2.1 in a virtual machine (KVM/libvirt/qemu-type) via direct kernel boot, mostly using virtio-type virtual disks.  Somewhere between 10% and 50% of the time I boot a VM, one of the virtual disks is missing from /dev, though most if not all of the time it shows up in /proc/partitions.  For example, on a recent test run, the VM was supposed to have four virtio disks: vda, vdb, vdc, and vdd.  /proc/partitions listed all four, with reasonable-looking major and minor device numbers.  However, in /dev, vdc was entirely missing.

Any suggestions for how to find the root cause of this problem?  I would guess it's udev that is supposed to create the device nodes.

It would appear that for a workaround I could simply create the block device using the major and minor node numbers from /proc/partitions.  Any ideas on whether that would work?

Thanks,

Robert

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: missing disk block devices in virtual machine
« Reply #1 on: May 01, 2012, 11:29:20 AM »
Try adding a 'waitusb=5' boot option.
This will cause core to wait 5 second before scanning for disks.
This may give more time for the virtual drives to be ready.

Offline rmrichesjr

  • Newbie
  • *
  • Posts: 19
Re: missing disk block devices in virtual machine
« Reply #2 on: May 01, 2012, 12:42:07 PM »
Thank you for the suggestion to try waitusb=5.  That seemed to reduce the percentage of VM boots that show the problematic symptoms.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: missing disk block devices in virtual machine
« Reply #3 on: May 01, 2012, 12:48:51 PM »
Then you might want to experiment with increasing this value.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: missing disk block devices in virtual machine
« Reply #4 on: May 02, 2012, 05:11:32 AM »
I'm curious about a VM that might be slow, since they are running as fast as the host, right?   On average I use 20 to 30 VMs across many hosts all with frugal installs, though  none have the usbwait option and none have shown this trait.

May I ask which VM ??

Offline rmrichesjr

  • Newbie
  • *
  • Posts: 19
Re: missing disk block devices in virtual machine
« Reply #5 on: May 02, 2012, 10:30:15 AM »
Which VM?  Any/all virtual machines I create--on a sporadic basis.

The virtual machines are running under KVM/libvirt/qemu, if that was the intent of the question.

So far, in essentially all observed cases where the block device nodes were missing from /dev, /proc/partitions had the info about the disk.  Since udev (or whatever should create the nodes) seems to be slacking, one workaround is to manually create them based on the major and minor numbers in /proc/partitions.  As an experiment, I waited up to 60 seconds, and the device nodes did not appear, so it's not simply that udev is a little slow.

It appears increasing the waitusb number would likely reduce the frequency of missing devices.  However, with non-deterministic network and disk I/O delays, it does not appear any practical waitusb number would completely eliminate the issue--there would always be a tail of the distribution just beyond the number I would use.

Thanks for all the responses.  The workaround of manually creating the devices appears to be working reasonably well, so far.