ISCSI Setup

Contents

iSCSI Setup Instructions

Setting up an iSCSI server for storage

Currently oVirt can only use network attached storage for virtual machine storage. Both NFS and iSCSI storage can be used. If you have a dedicated NFS and/or iSCSI server available, you don't need any of the information on this page; go directly to the Quick Tour to find out how to add those storage servers to the oVirt UI. If you need to setup an iSCSI server to use for storage, read on. Note that if you are using the oVirt appliance, you do not need the instructions on this page. The appliance comes with iSCSI and NFS pre-configured.

Terminology

Like any network attached storage, iSCSI has a server side and a client side. The server side is known as the iSCSI "target", while the client side is known as the iSCSI "initiator". oVirt will act as the iSCSI initiator, so this document concerns itself with how to setup a Linux distribution as an iSCSI target.

iSCSI target setup

The iSCSI target can be on any linux machine on your local subnet; below we will assume that you are running a Fedora distribution, but it should work on any modern linux machine.

  1. Create logical volumes to back your iSCSI targets:
    # lvcreate -n iSCSI1 -L +10G /dev/VolGroup00

    Obviously you may call the volume(s) whatever you like, and you can just as easily use a raw partition. LVM is probably the easiest way to go however. Note you will need to replace /dev/VolGroup00 with the name of the volume group you want to use. You may create at one volume/LUN per guest, or you may create one or more large LUNs and divide them up into per-guest LVM volumes via the oVirt WUI. You can also use a disk file instead of a logical volume:

    dd if=/dev/zero of=/fs.iscsi.disk bs=1M count=10240
  2. Start the iSCSI target service and create the target:
    # service tgtd start
    # tgtadm --lld iscsi --op new --mode target --tid 1 -T host:storage
    
    host:storage can be anything you want, it's mostly used as a descriptive name later. You'll need to install the scsi-target-utils package to run the above commands.
  3. Export the target as a LUN:
    # tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /dev/VolGroup00/iSCSI1
    This exports /dev/VolGroup00/iSCSI1 as LUN 1 on the target we made above. If you want, repeat this for additional devices, making sure to increment the LUN for each.
  4. Make the LUNs available:
    # tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL

Finally, if you think this all sounds like a real nuisance, you're right! openfiler is an open-source linux-based project that does iSCSI management among other things. In the future we may include it in the oVirt image, in the meantime we recommend trying it out as it eliminates the configuration above.

MediaWiki