Saturday, November 20, 2010

Passing hard drive to the virtual machine ( when no VT-D pass-through available)

  • We will create vmsk files, one per hard drive. To keep things organized, first create a folder in the regular datastore and cd to it.
  • Find vml symlink pointing to the disk we are adding for pass-through
ls -l /dev/disks

....
lrwxrwxrwx 1 root root 72 Nov 20 10:54 vml.0100000000533248374a31425a39323131323220202020202053414d53554e -> t10.ATA_____SAMSUNG_HD204UI_________________________S2H7J1BZ921122______
...
  • Create vmdk file. Specify vml symlink we just found
# vmkfstools -z /vmfs/devices/disks/vml.0100000000533248374a31425a39323131323220202020202053414d53554e SAMS01.vmdk

  • Now, this file can be added to virtual machine as a pre-existing virtual disk. This will be your whole physical device passed untouched to the virtual machine, with no any intervention from ESXi on data level. ( it does not look like virtual machine can do low-level control of the drive, like SMART or disk spin-downs)

Friday, November 19, 2010

Head down into virtualization

For my new server, I want
  • split the functions into dedicated firewall/router, file server and UNIX development environments
  • I also would like to have a central user directory for my 4 active users and numerous personal and lab machines
  • Of course, I don't want extra boxes raising my electrical bills
So, it's time for virtualization, no doubt. And, if I could virtualize my lab, which I need only sporadically, how great it would be!

Looks like there are VmWare ESX, MS Hypervisor and Xen around which I could use to host my new setup.
I don't know much about Xen, but I feel it's not really of mainstream commercial quality. This should not be a problem for a person fiddling with UNIX for fun, but I want at least the foundation of my new building to be stable.
MS Hypervisor seems to have very good hardware support, as it runs under Windows essentially. But it's very far from being free. And, I don't know how much it loves UNIX guests. I generally feel it is not kosher to bring this thing home.
I had previous experience with VmWare products and they did work. It wasn't fun running virtual machines on my work laptop, but this time I will have a separate rig for this. So let's look at VmWare ESXi first. It is given for free, has a sizable user community but is picky about the hardware.

Home server history

For last 8 years or so my home was served by a UNIX machine running Samba. First, it was a small SUN SparcStation, that would also periodically dial a modem and fetch e-mail. Its array of SCSI drives complemented our electrical heating well, but was counter-productive during the summers.
Then it was a Pentium III hidden in a closet, running some old Fedora. It would act as a router, file/mail server and Tivo.
After moving to the new house, I have separated HTPC and server function. Server was Celeron-D under Fedora. I did not touch it for months. It would freeze a few times a year, and everybody would notice, since it was a router, firewall and parental control filter. Don't know why it would freeze. There was never anything in the log or on the console. I suspect the Gigabyte motherboard bought off e-bay used. Particularly, this board is under-clocking any CPU one puts in it, by some 30%. It is good for power conservation, but there must be something wrong with this board.
I even managed to set up 802.11g access point with this server, using a PCI wireless card lying around, after my first NetGear router died.
So, this machine was pretty OK. I probably could keep ignoring it for a few more years, but I grew uncomfortable about the disks. It had 5 400GB Seagate ATA/SATA drives bought in 2005 and 2006, when Seagate was still a good company. The last drive I bought was a lemon. It took 2 round trips to Seagate (at my expense!) to have it replaced with something that worked, but not trusted anyway...
Seagates are spun down most of the time, to save energy. System drive is one of the first WD Greens. It never failed, but WD made a psychological mistake with it. There is a head parking counter in S.M.A.R.T. As all resource counters there, it started with 200, going down and down and down with time. I tried to slow this process by not letting disk be idle. It helped a bit. Anyway, this counter is at 0 for a while already.