an attempt at documentation of my ongoing struggles with solaris and opensolaris on x86. I believe strongly in the (public) documentation of trials, struggles and failures, even more so than in the documentation of success: With a long standing commitment to solaris, looking for answers and just finding "I tried it on distibution 'X' and it worked for me" is not very informative.

Tuesday, March 08, 2011

running virtualbox 4 on a synology iscsi device

quick notes to get vms running on iscsi luns.














1) create a lun on the synology. give it a reasonable name. (see left image)
2) create an iscsi target for it, with a sensible iqn. (see right image)

NOTE: the naming is what works for me. iqn is mostly RFC3721 compliant with exception of the date: I set the date to the general ballpark of when I created the iscsi target. Not when I created my first antoonhuiskens.com domain.

3) I really should set up lun masking.
Though the manual state that virtualbox runs its own initiator, this didn't sink in until I set masking up: I initially mapped the iscsi lun to the microsoft iscsi initiator, but that doesnt work, since the iqn of the vbox adapter is different.

a brief snoop (with wireshark) showed that the iqn is:

iqn.2009-08.com.sun.virtualbox.initiator:01:

as an example: iqn.2009-08.com.sun.virtualbox.initiator:01:192.168.1.104

I expect that the "01" in the iqn serves a function as well, but we'll find that out later I suppose.
4) create the vm on the host.

Needs to be done commandline:

vboxmanage is to be found in:
\program files\oracle\virtualbox

vboxmanage createvm --name dc-utr-01-vmtest --ostype WindowsXP --register

I found that its convenient to register immediately. This means from now on, the vm shows up with "vboxmanage list vms" and also in the gui.
I set the ostype to win xp for no other reason than hoping (yes, hoping) it would set me up with some sensible defaults.

5) add a disk controller to the vm. Choose wisely I'd say. after all ide means only a master and a slave device. scsi, sas etc do not suffer from these limitations. For now, I dont care enough.

vboxmanage storagectl dc-utr01-vmtest --name controller0 --ide

6) attach a port on the controller of the vm to the virtual machine:

vboxmanage storageattach dc-utr01-vmtest \
--storagectl controller0 # as created in step 5
--port 0
--device 0 # Not sure. it works though. prolly related to how I setup the controller in step 5.
--type hdd # goes without saying
--medium iscsi
--server 192.168.1.10
--target iqn.2011-03-com.antoonhuiskens:VBOX-LUNS.dc-utr01-vmtest

Now all you need to do is fumble through the settings in the gui to see if you missed some sensible defaults (video memory for instance is one).

1 comment:

Unknown said...

Thanks for the step-by-step. Was able to get the iscsi disk created and attached but I cannot seem to get vbox to see the new iscsi disk on the network. It just hangs and gives a 'VERR_TIMEOUT' error. It's odd because I am on the same gbit segment as the DS412+ and it's only about 5 feet away. I am going to tinker some more. Maybe it's some firewall weirdness...