|
|
Dynamic LUN expansion and Thin Provisioning support in COMSTARThin Provisioning means that if you want to create a LUN of say 100 Gigabyte in size, you dont have to right away allocate 100 Gigabytes from you backend storage pool for this LUN. In fact you dont have to allocate any space at all to begin with. You just define the size during initialization of the LUN so that the target mode software knows what to tell the initiators when they ask about the size of the LUN. But the actual space for the LUN's backend storage is only allocated when the initiator(s) write any data to that space. Dynamic LUN expansion allows you to not even bother about defining the size you will need over the life of the LUN. You can just define what you need today (or in near future) and then grow the size of the LUN as the demand for the space goes up. This is also useful in the case where you dont want to create very large Thin provisioned LUNs in the beginning. COMSTAR supports both of these features as shown in the examples below. Creating a thin provisioned SCSI logical unitCreate a zero byte file. Initialize it to be 1Terabyte in size and register it with the framework. Also expose it to all the initiators.
But the size on the disk is …
The 8K is due to some metadata which gets written to the file as a part of initialization. Now lets initialize it from the initiator side. In case of solaris, this will be like running format and labeling the disk. After thats done, lets look at the file size again.
…So it took 1 terabytes of space ? Not really. Lets look at the real space used.
So it only took 208 disk blocks or in other words 104 Kilobytes. So this is basically a file with a "hole". Most filesystems (ufs, zfs etc.) support files with holes in them. In reality what happened was that the initiator wrote to the beginning of the LUN and then it lseek(2) to the end and wrote a backup label there. The remaining space in the middle which was never written did not use any disk blocks on the back end storage. But the backend usage will grow as the initiator will write more and more data in the middle. Couple of things to note are:
Growing the LUN dynamicallysbd supports modify-lu option to modify the size of a LU dynamically. Lets try changing the size of the LU we just created.
Lets look at the size again.
When the size of the LU is modified, the initiators accessing this LU get notified via a 'SCSI check condition' that 'CAPACITY HAS CHANGED'. Of course the initiators and the filesystems on the initiators must be capable of handling this notification and adjust the size accordingly. |