The COMSTAR way of creating Solaris iSCSI targets

If you’re used to the streamlined, straightforward method of creating iSCSI targets with Solaris you may have been a little perplexed to see an error something like this:

# cannot set property for ‘tank/iscsi/vol001′: invalid property ‘shareiscsi’

This is because the mechanism for creating and manipulating iSCSI has changed significantly in recent versions of Solaris.  I’m not sure why the original syntax wasn’t retained, but nevertheless, you can still achieve the same result with the following sequence:

  • Install the new COMSTAR package:
# pkg install pkg:/storage-server
  • Create your zfs volume as usual
# zfs create -V 200G tank/iscsi/vol001

This will create a 200Gb volume in the “tank” pool of type ‘volume’ (not ‘filesystem’)

  • Using the new sbdadm(1M) command, create a new logical unit based on the volume you just created:
# sbdadm create-lu /dev/zvol/rdsk/tank/iscsi/v001
Created the following LU:

GUID                              DATA SIZE            SOURCE
--------------------------------  -------------------  ----------------
600144f01cfe070000004e3df8200001  214748364800         /dev/zvol/rdsk/tank/iscsi/v001
  • Using the new stmfadm(1M) command, verify that you now have a logical unit available:
# stmfadm list-lu -v 600144F01CFE070000004E3DF8200001
LU Name: 600144F01CFE070000004E3DF8200001
    Operational Status: Online
    Provider Name     : sbd
    Alias             : /dev/zvol/rdsk/tank/iscsi/v001
    View Entry Count  : 1
    Data File         : /dev/zvol/rdsk/tank/iscsi/v001
    Meta File         : not set
    Size              : 214748364800
    Block Size        : 512
    Management URL    : not set
    Vendor ID         : OI
    Product ID        : COMSTAR
    Serial Num        : not set
    Write Protect     : Disabled
    Writeback Cache   : Enabled
    Access State      : Active
  • Add a view to the newly created object, otherwise we won’t be able to do anything with it :)
# stmfadm add-view 600144F01CFE070000004E3DF8200001
  • Turn on the required service, if you haven’t already.
svcadm enable -r svc:/network/iscsi/target:default
  • FINALLY you can now create the iSCSI target:
# itadm  create-target
Target iqn.1986-03.com.sun:02:1cfef154-fa27-4f03-de2d-946adda9eea4 successfully created

So there you go. Nowhere near as simple as setting a property on a ZFS filesystem, but you can eventually achieve the same result.

Summary:

  • Create volume
  • Create a scsi block device, using the newly-created volume as a backing store.
  • Create a logical unit using the previously created block device
  • Add a ‘view’ to the logical unit (think of this as making it visible to outsiders – giving them a ‘view’)
  • Create an iSCSI target

Simple, eh? :/

Run vanilla Snow Leopard in a VirtualBox VM

Running (vanilla) Snow Leopard in a virtualbox VM is now a piece of cake.

If for some reason this doesn’t work (like, you don’t have a compatible processor) you might try

instead.

What you’re going to need:

  1. An Empire EFI ISO image. Download it from Prasys’ blog.
  2. An ISO image of Snow Leopard. (NOT a .dmg). Take an image of a retail copy, available from your friendly retailer.
  3. VirtualBox 3.2.6, which you can get from the VirtualBox website.

We’re going to set up the virtual machine from the command line once again. You’ll only need a total of 10 commands to get your VM installed and booted.

I’m assuming that your VM will be called “osx“. The base folder will be /vbox, you’ll store your ISO images in /vbox/iso and you’ll create a hard drive image for your virtual machine called “disk01.vdi“. These items are color coded below so you can see where you need to change them to suit your setup.

Virtual Machine initialization:

VBoxManage createvm –name osx –ostype MacOS_64 –register –basefolder /vbox
VBoxManage modifyvm osx –memory 1536
VBoxManage modifyvm osx –accelerate3d on –vram 32
VBoxManage storagectl osx –add sata –controller IntelAHCI –name “SATA Controller”
VBoxManage storagectl osx –add ide –controller PIIX4 –name “IDE Controller”
VBoxManage storagectl osx –name “SATA Controller” –hostiocache on
VBoxManage storagectl osx –name “IDE Controller” –hostiocache on
VBoxManage createhd –filename /vbox/osx/disk01.vdi –size 40960 –variant Split2G –remember
VBoxManage storageattach osx –storagectl “SATA Controller” –type hdd –port 0 –device 0 –medium /vbox/osx/disk01.vdi
VBoxManage storageattach osx –storagectl “IDE Controller” –type dvddrive –port 0 –device 0 –medium /vbox/iso/empireEFI.iso

Snow Leopard installation:

At this point, you can power on your virtual machine:

VBoxManage startvm osx –type vrdp

Note: I use vrdp because I like to run my VMs on servers, You can omit the “–type vrdp” and the reguar GUI will pop up.

At this point, the system will boot from the EmpireEFI image. You’ll see the chameleon logo and an image of a CDROM. Now you need to attach your Snow Leopard ISO to the Virtualbox VM:

VBoxManage storageattach osx –storagectl “IDE Controller” –port 0 –device 0 –type dvddrive –medium /vbox/iso/snowleopard.iso

Once you’ve done that, go back to the VM and hit the F5 key to rescan, Chameleon will pick up the Snow Leopard image. From here you can hit Enter and watch as the system boots into OSX.

At that point you can follow the regular OS X install procedure: Partition your drive, and let the installer run to completion.

Post OS Installation precedure:

Once the installer complete, you’ll see a message “Install Failed”.  Don’t panic, it didn’t really.  We just need to give it a helping hand.

Switch the EmpireEFI image back again:

VBoxManage storageattach osx –storagectl “IDE Controller” –port 0 –device 0 –type dvddrive –medium /vbox/iso/empireEFI.iso

Then reboot:

VBoxManage controlvm osx reset

Once this happens, you’ll see Chameleon come up with two choices to boot from.  Use your arrow key to select the disk you just installed OSX onto, and then type “-v” and hit enter.

OS X should boot (in verbose mode).  You’ll then be able to run through the account setup process, and eventually you’ll get your fresh, shiny OSX desktop.

Once you’re booted, you should run the “MyHack Installer”.  You can find an earlier version on the EmpireEFI CD in the folder “Extra/post-installation”. Since your networking already works, (assuming your host machine has internet connectivity)…

From the Virtual Machine, browse to http://blog.nawcom.com/?p=242 and download the latest, custom version (ready for 10.6.4 upgrade). Install the package and reboot.