How to Create a Thin-Provisioned SCSI Logical Unit

How to Create a Thin-Provisioned SCSI Logical Unit

Thin-provisioning enables you to create a logical unit of a specific size, for example, 100 gigabytes, without allocating any storage space right away. You define the allotted size so that the target mode software can communicate that information to initiators when prompted for the size of the logical unit. However, the actual space for the logical unit's back-end storage is only allocated when the initiators write data to that space.

Dynamic logical unit expansion enables you to skip defining the allotted size for the logical unit. You can simply define the space that you need today and later grow the size as the demand for space increases. This method is beneficial when you do not want to allocate the space up-front for a large, thin-provisioned logical unit.

Consider the following before creating a thin-provision logical unit:

  • The maximum size supported by COMSTAR for thin-provisioned logical units is 8 exabytes (8192 petabytes). This size might be limited by the constraints of the underlying file system on which the backend storage pool resides. For example, UFS does not support more than 2 terabytes of logical units. However, ZFS allows for up to 8 exabytes of logical units.
  • Without thin-provisioning, the logical unit size is derived from the size of the file or device at the time the logical unit is initialized.
  • Some applications on the initiator side try to write to the entire disk as part of their initialization sequence when formatting the disk. This type of initiator action forces the target to immediately allocate all the space from the back-end storage. To prevent this situation, implement dynamic logical unit expansion as described in How to Dynamically Grow a Thin-Provisioned SCSI Logical Unit.

How to Create a Thin-Provisioned SCSI Logical Unit

This procedure shows you how to initialize a zero-byte file, and establish a 1-Tbyte backing store.

  1. Initialize the file to be used as the logical unit. This example uses a file named lu1.
    # touch /lu1
    
  2. Create a logical unit using a 1-Tbyte backing store.
    # sbdadm create-lu -s 1T /lu1
    
    Created the following LU:
    
    GUID                                DATA SIZE             SOURCE
    -------------------------------- ------------------ --------------------
    6000ae40c5000000000047a22c1c0001    1099511562240           /lu1
    
  3. Verify the creation of the logical unit.
    # sbdadm list -lu
    
  4. View the initial size of the logical unit.
    # ls -l /lu1
    
    -rw-r-r- 1 root root 8192 April 7 11:12 /lu1
    

How to Dynamically Grow a Thin-Provisioned SCSI Logical Unit

Dynamic logical unit expansion enables you to change the size of an existing logical unit dynamically with the modify-lu option (supported by sbd). This example changes the size of a 10-Gbyte logical unit to 1500 Gbytes.

Important Note
When the size of a logical unit is modified, the initiators currently accessing the logical unit are notified, through a SCSI check condition, that CAPACITY HAS CHANGED. The initiators and file systems on the initiators must be capable of handling this notification, and capable of adjusting the size accordingly.
  1. Change the size of the logical unit.
    # sbdadm modify-lu -s 1500 /lu_0_store
    
    LU modified successfully.
    
  2. View the size of the logical unit.
    # sbdadm list-lu
    
    Found 1 LU(s)
    
             GUID                         DATA SIZE           SOURCE
    --------------------------------  -------------------  ----------------
    6000ae4000144f972b2e486291410001     1610612670464      /lu_0_store
    

Where to Go Next

Labels

task task Delete
smallsiteadmin smallsiteadmin Delete
configuring configuring Delete
storage storage Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact