A backstore is used to back a LUN using a physical device. Backstores supported by the LIO iSCSI target are fileio, block, passthrough, and ramdisk. In this video, create a fileio backstore as an example.
- [Professor] In Enterprise Linux 6 the term backing store was used for mappings created in the target. These are now called storage objects. In Enterprise Linux 7, we use the term backstore to reference different types of backing devices such as block devices and logical volumes. Backstore supported by the LIO iSCSI target include FILEIO, BLOCK, PSCSI, and memory copy RAMdisks. FILEIO backstores are Linux file-backed storage. FILEIO can be either write back or write through.
Using write back enables the Linux file system cache which can improve performance. However, it also increases the likelihood of data loss, so a write through is recommended. To create a FILEIO backstore, we'd use the /backstores/fileio path with a create sub-command. We can disable write back by adding the write_back=false option for the device. BLOCK backstores can be any device that exists in /sys/block. This includes physical devices such as hard disks, solid-state disks, optical drives like CDs and DVDs, as well as RAID and LVM volumes.
To create a BLOCK backstore we'd use the /backstores/block path with the create sub-command. In this example we're using the /dev/sdb block device to backage. In PSCSI, devices are SCSI devices that are passed through. Any storage device that supports direct passthrough of SCSI without emulation and also has a device that exits in /procs/scsi/scsi can be used for this backstore. To create a PSCSI back store for our DVD drive, we use the /backstores/pscsi path and specify the backend device of /dev/sr0.
Due to the complexities with passing through SCSI commands through a device, it is recommended to use a BLOCK backstore if possible. In some cases, the complexity of SCSI passthrough is warrented. We can also create memory backed RAMDISK backstores. These are images in RAM which are usually not persistent across reboots but are very fast. This allows us to have RAMDisks with full SCSI emulation which is good for very fast volatile mass storage when high IOs are needed. To create a memory backed RAMDISK backstore, we'd use the /backstore/ramdisk path and specify the size.
To see how backstores work, let's create a file IO backstore. Be sure that your RA chose one BMs booted and you're logged in. In a terminal, run target CLI by typing in sudo, space, targetcli and hit enter. Type in your password if prompted. We'll start by listing all existing objects by typing in ls. We can see that we have no backstores, storage objects, or targets. To create the file IO backstore, type in /backstores/fileio space create space file1, that's the name of it, space, /tmp/disk1.img, this is the file on the drive that's gonna back this backstore.
Space, 200 capital M, that's the size. Space, write, underscore back equals false. And hit enter. In this case, we've turned off write back which is recommended. To view our backstore, type in ls and hit enter. Now we can see that we have a file IO backstore named file1 that exists at /tmp/disk1.img. In the rest of this chapter, we'll create the other components as necessary.
- What is iSCSI?
- Creating iSCSI backstores
- Configuring ACL and firewall credentials
- Configuring targets and initiators
- Partitioning and mounting drives
- Creating iSCSI LUNs