Library Table of Contents Index Previous Page (Alt-p) Next Page (Alt-n) Comments

Reallocating LUN and volume layout

Reasons to use reallocation scans  Top

You use reallocation scans to ensure that blocks in a LUN, large file, or volume are laid out sequentially. If a LUN, large file, or volume is not laid out in sequential blocks, sequential read commands take longer to complete because each command might require an additional disk seek operation. Sequential block layout improves the read/write performance of host applications that access data on the storage system.

What a reallocation scan is  Top

A reallocation scan evaluates how the blocks are laid out in a LUN, file, or volume. Data ONTAP performs the scan as a background task, so applications can rewrite blocks in the LUN or volume during the scan. Repeated layout checks during a scan ensure that the sequential block layout is maintained during the current scan.

A reallocation scan does not necessarily rewrite every block in the LUN. Rather, it rewrites whatever is required to optimize the layout of the LUN.

How a reallocation scan works  Top

Data ONTAP performs a reallocation scan in the following steps:

  1. Scans the current block layout of the LUN.
  2. Determines the level of optimization of the current layout on a scale of 3 (moderately optimal) to 10 (not optimal).
  3. Performs one of the following tasks, depending on the optimization level of the current block layout:
  4. Scans the new block layout.
  5. Repeats steps 2 and 3 until the layout is optimal.

The rate at which the reallocation scan runs (the blocks reallocated per second) depends on CPU and disk loads. For example, if you have a high CPU load, the reallocation scan will run at a slower rate, so as not to impact system performance.

Reallocation scans and LUN availability  Top

You can perform reallocation scans on LUNs when they are online. You do not have to take them offline. You also do not have to perform any host-side procedures when you perform reallocation scans.

How you manage reallocation scans  Top

You manage reallocation scans by performing the following tasks:

You can define only one reallocation scan for a single LUN.

You can also initiate scans at any time, force Data ONTAP to reallocate blocks sequentially regardless of the optimization level of the LUN layout, and monitor and control the progress of scans.

If you delete a LUN, you do not delete the reallocation scan defined for it. If you take the LUN offline, delete it, and then reconstruct it, you still have the reallocation scan in place. However, if you delete a LUN that has a reallocation scan defined and you do not restore the LUN, the storage system console displays an error message the next time the scan is scheduled to run.

Enabling reallocation scans  Top

Reallocation scans are disabled by default. You must enable reallocation scans globally on the storage system before you run a scan or schedule regular scans.

To enable reallocation scans, complete the following step.

Step

Action

1

On the storage system's command line, enter the following command:

reallocate on

Defining a reallocation scan  Top

To define a reallocation scan for a LUN, complete the following step.

Step

Action

1

On the storage system's command line, enter the following command:

reallocate start [-t threshold] [-n] [-i interval] 
lun_path

-t threshold is a number between 3 (layout is moderately optimal) and 10 (layout is not optimal). The default is 4.

A scan checks the block layout of a LUN before reallocating blocks. If the current layout is below the threshold, the scan does not reallocate blocks in the LUN. If the current layout is equal to or above the threshold, the scan reallocates blocks in the LUN.

-n reallocates blocks in the LUN without checking its layout.

-i interval is the interval, in hours, minutes, or days, at which the scan is performed. The default interval is 24 hours. Specify the interval as follows:

[m | h | d]

For example, 30m is a 30-minute interval.

The countdown to the next scan begins only after the first scan is complete. For example, if the interval is 24 hours and a scan starts at midnight and lasts for an hour, the next scan begins at 1:00 a.m. the next day--24 hours after the first scan is completed.

Examples

The following example creates a new LUN and a normal reallocation scan that runs every 24 hours.

lun create -s 100g /vol/vol2/lun0
reallocate start /vol/vol2/lun0
2

If...

Then...

You want to run the reallocation scan according to a schedule

Proceed to Creating a reallocation scan schedule.

You do not want to define a schedule

Proceed to Tasks for managing reallocation scans.

Creating a reallocation scan schedule  Top

You can run reallocation scans according to a schedule. The schedule you create replaces any interval you specified when you entered the reallocate start command.

To create a reallocation scan schedule, complete the following step.

Step

Action

1

Enter the following command:

reallocate schedule [-s schedule] lun_path

-s schedule is a string with the following fields:

"minute hour day_of_month day_of_week"
  • minute is a value from 0 to 59.
  • hour is a value from 0 (midnight) to 23 (11:00 p.m.).
  • day_of_month is a value from 1 to 31.
  • day_of_week is a value from 0 (Sunday) to 6 (Saturday).

A wildcard character (*) indicates every value for that field. For example, a * in the day_of_month field means every day of the month. You cannot use the wildcard character in the minute field.

You can enter a number, a range, or a comma-separated list of values for a field. For example, entering "0,1" in the day_of_week field means Sundays and Mondays. You can also define a range of values. For example, "0-3" in the day_of_week field means Sunday through Wednesday.

Examples

The following example schedules a reallocation scan for every Saturday at 11:00 PM.

reallocate schedule -s "0 23 * 6" /vol/myvol/lun1

Deleting a reallocation scan schedule  Top

You can delete an existing reallocation scan schedule that is defined for a LUN. If you delete a schedule, the scan runs according to the interval that you specified when you initially defined the scan using the reallocate start command.

A reallocation scan is not automatically deleted if you delete its corresponding LUN. However, if you destroy a volume, all reallocation scans defined for LUNs in that volume are deleted.

To delete a reallocation scan schedule, complete the following step.

Step

Action

1

Enter the following command:

reallocate schedule -d lun_path

Example

reallocate schedule -d /vol/myvol/lun1

Tasks for managing reallocation scans  Top

You perform the following tasks to manage reallocation scans:

Starting a one-time reallocation scan  Top

You can perform a one-time reallocation scan on a LUN. This type of scan is useful if you do not want to schedule regular scans for a particular LUN.

To start a one-time reallocation scan, complete the following step.

Step

Action

1

Enter the following command:

reallocate start -o -n lun_path

-o performs the scan only once.

-n performs the scan without checking the LUN's layout.

Performing a full reallocation scan of a LUN or volume  Top

You can perform a scan that reallocates every block in a LUN or a volume regardless of the current layout by using the -f option of the reallocate start command. A full reallocation optimizes layout more aggressively than a normal reallocation scan. A normal reallocation scan moves blocks only if the move improves LUN layout. A full reallocation scan always moves blocks, unless the move makes the LUN layout even worse.

Using the -f option of the reallocate start command implies the -o and -n options. This means that the full reallocation scan is performed only once, without checking the LUN's layout first.

You might want to perform this type of scan if you add a new RAID group to a volume and you want to ensure that blocks are laid out sequentially throughout the volume or LUN.

Caution
You should not perform a full reallocation on an entire volume that has Snapshot copies. In this case, a full reallocation might result in using significantly more space in the volume, because the old, unoptimized blocks are still present in the Snapshot copy after the scan. For individual LUNs or files, try to avoid transferring large amounts of data from the Snapshot copy to the active filesystem unless absolutely necessary. The greater the differences between the LUN or file and the Snapshot copy, the more likely the full reallocation will be successful.

To perform a full reallocation scan, complete the following step.

Step

Action

1

Enter the following command:

reallocate start -f lun_path | volume-path

Quiescing a reallocation scan  Top

You can quiesce a reallocation scan that is in progress and restart it later. The scan restarts from the beginning of the reallocation process. For example, if you want to back up a LUN, but a scan is already in progress, you can quiesce the scan.

To quiesce a reallocation scan, complete the following step.

Step

Action

1

Enter the following command:

reallocate quiesce lun_path

Restarting a reallocation scan  Top

You might restart a scan for the following reasons:

To restart a scan, complete the following step.

Step

Action

1

Enter the following command:

reallocate restart lun_path

Result

The command restarts a quiesced scan. If there is a scheduled scan that is idle, the reallocate restart command runs the scan.

Viewing the status of a scan  Top

To view the status of a scan, complete the following step.

Step

Action

1

Enter the following command:

reallocate status [-v] lun_path

-v provides verbose output

lun_path is the path to the LUN for which you want to see reallocation scan status. If you do not specify a value for lun_path, then the status for all scans is displayed.

Result

The reallocate status command displays the following information:

  • State--whether the scan is in progress or idle.
  • Schedule--schedule information about the scan. If there is no schedule, then the reallocate status command displays n/a.
  • Interval--intervals at which the scan runs, if there is no schedule defined.
  • Optimization--information about the LUN layout.

Deleting a reallocation scan  Top

You use the reallocate stop command to permanently delete a scan you defined for a LUN. The reallocate stop command also stops any scan that is in progress on the LUN.

To delete a scan, complete the following step.

Step

Action

1

Enter the following command:

reallocate stop lun_path

Result

The reallocate stop command stops and deletes any scan on the LUN, including a scan in progress, a scheduled scan that is not running, or a scan that is quiesced.

Disabling reallocation scans  Top

You use the reallocate off command to disable reallocation on the storage system. When you disable reallocation scans, you cannot start or restart any new scans. Any scans that are in progress are stopped. If you want to re-enable reallocation scans at a later date, use the reallocate on command.

To disable reallocation scans, complete the following step.

Step

Action

1

On the storage system's command line, enter the following command:

reallocate off

Best practice recommendations  Top

The following best practices are recommended for using reallocation scans:

Library Table of Contents Index Previous Page (Alt-p) Next Page (Alt-n) Comments