# Patent

## Title
Non-disruptive file migration

## Abstract

A non-distruptive migration of a native volume from a source server to a destination server performed by a file switch involves converting the source native volume to a native with metadata volume. The native with metadata volume is converted to a mirrored native with metadata volume including the source server and the destination server. The destination server includes a mirror copy of the native with metadata volume. The source server is removed from the mirrored native with metadata volume. The mirror copy of the native with metadata volume on the destination server is converted to a destination native volume on the destination server.

## Background
CROSS-REFERENCE TO RELATED APPLICATIONS
This patent application claims priority from U.S. Provisional Patent Application No. 60/987,206 entitled NON-DISRUPTIVE FILE MIGRATION filed Nov. 12, 2007.
This patent application also may be related to one or more of the following patent applications:
U.S. Provisional Patent Application No. 60/923,765 entitled NETWORK FILE MANAGEMENT SYSTEMS, APPARATUS, AND METHODS filed on Apr. 16, 2007.
U.S. Provisional Patent Application No. 60/940,104 entitled REMOTE FILE VIRTUALIZATION filed on May 25, 2007.
U.S. Provisional Patent Application No. 60/987,161 entitled REMOTE FILE VIRTUALIZATION METADATA MIRRORING filed Nov. 12, 2007.
U.S. Provisional Patent Application No. 60/987,165 entitled REMOTE FILE VIRTUALIZATION DATA MIRRORING filed Nov. 12, 2007.
U.S. Provisional Patent Application No. 60/987,170 entitled REMOTE FILE VIRTUALIZATION WITH NO EDGE SERVERS filed Nov. 12, 2007.
U.S. Provisional Patent Application No. 60/987,174 entitled LOAD SHARING CLUSTER FILE SYSTEM filed Nov. 12, 2007.
U.S. Provisional Patent Application No. 60/987,197 entitled HOTSPOT MITIGATION IN LOAD SHARING CLUSTER FILE SYSTEMS filed Nov. 12, 2007.
U.S. Provisional Patent Application No. 60/987,194 entitled ON DEMAND FILE VIRTUALIZATION FOR SERVER CONFIGURATION MANAGEMENT WITH LIMITED INTERRUPTION filed Nov. 12, 2007.
U.S. Provisional Patent Application No. 60/987,181 entitled FILE DEDUPLICATION USING STORAGE TIERS filed Nov. 12, 2007.
U.S. patent application Ser. No. 12/104,197 entitled FILE AGGREGATION IN A SWITCHED FILE SYSTEM filed Apr. 16, 2008.
U.S. patent application Ser. No. 12/103,989 entitled FILE AGGREGATION IN A SWITCHED FILE SYSTEM filed Apr. 16, 2008.
U.S. patent application Ser. No. 12/126,129 entitled REMOTE FILE VIRTUALIZATION IN A SWITCHED FILE SYSTEM filed May 23, 2008.
All of the above-referenced patent applications are hereby incorporated herein by reference in their entireties.


FIELD OF THE INVENTION
This invention relates generally to storage networks and, more specifically, to a method for migrating file data from one storage server to another in a non-disruptive manner.
BACKGROUND OF THE INVENTION
In a computer network, NAS (Network Attached Storage) file servers provide file services for clients connected in a computer network using networking protocols like CIFS or any other stateful protocol (e.g., NFS-v4). Usually, when a file, directory, or a server share is migrated from one server to another, the administrator takes the server offline, copies the files to the destination server, and finally brings the destination server online. The larger the amount of data been migrated, the longer the clients must wait for the migration to complete, which leads to longer server down-time.
In today's information age of exponentially growing server capacity and clients spread all over the globe, the amount of down-time an administrator can afford is constantly shrinking. It becomes almost impossible to migrate files from one server to another. This forces storage administrators to buy servers with significantly greater capacity (i.e., overprovision) in order to avoid/delay the need of migrating server data to a newer, higher capacity model.
A common approach to migrate files is to start migrating files while the source server is continued to be accessed and gradually copy all files to the destination server. On the subsequent passes only the newly modified files and directories (since the last pass) are copied and so on. This process is repeated until all files are migrated to the destination server. At this point, the source server is taken offline and replaced with the destination server, thus lowering the amount of time needed to migrate from one server to another. Although this solution lowers the down time it does not completely solve the problem with files that are constantly accessed or held open in exclusive mode. For those files, the user still suffers a visible access interruption and will have to invalidate all of its open handles and suffer service interruption during the migration of those files.
SUMMARY OF THE INVENTION
File Virtualization is a very powerful server management tool that normally is used for mirroring and load balancing for virtualized systems. Native Volume with Metadata is the only known way to bring File Virtualization to places where preserving the user's native directory structure is a must. Using File mirroring over Native Volume with Metadata is an excellent way to provide non-disruptive migration for storage servers.
In accordance with one aspect of the invention there is provided a method and file switch for non-disruptive migration of a native mode volume from a source server to a destination server. Such non-disruptive migration involves converting, by the file switch, the source native volume to a native with metadata volume using a local file system managed by the file switch; converting, by the file switch, the native with metadata volume to a mirrored native with metadata volume including the source server and the destination server, the destination server including a mirror copy of the native with metadata volume; removing, by the file switch, the source server from the mirrored native with metadata volume; and converting, by the file switch, the mirror copy of the native with metadata volume on the destination server to a destination native volume on the destination server.
In various alternative embodiments, converting the source native volume to the native with metadata volume may involve for each source directory in the source native volume, creating a corresponding local directory in the local file system including metadata associated with the source directory copied from the source native volume; and for each source file in the source native volume, creating a corresponding local sparse file in the local file system including file attributes copied from the source native volume but excluding the file contents associated with the source file. The metadata associated with the source directory copied from the source native volume may include directory security descriptors. Creating a local directory for a source directory may involve opening the source directory in the source native volume; placing a lock on the source directory; and creating the local directory and its metadata. Converting the native with metadata volume to the mirrored native with metadata volume may involve for each local directory, creating a corresponding destination directory in the destination server and maintaining a mapping of the local directory to a source directory pathname for the corresponding source directory in the source server and to a destination directory pathname for the corresponding destination directory in the destination server; and for each local file, creating a corresponding destination file in the destination server including file data copied from the source native volume and maintaining a mapping of the local file to a source file pathname for the corresponding source file in the source server and to a destination file pathname for the corresponding destination file in the destination server. Each mapping may include an indicator of the number of servers associated with the mirrored native with metadata volume. Removing the source server from the mirrored native with metadata volume may involve disabling usage of the source destination pathnames and the source file pathnames. Converting the mirror copy of the native with metadata volume on the destination server to a destination native volume may involve replicating state information for the destination directories and the destination files from the source native volume; disabling usage of the local directories and local files; and advertising the destination directories and destination files as a native volume. Converting the mirror copy of the native with metadata volume on the destination server to a destination native volume further may involve deleting unneeded metadata associated with the mirror copy of the native with metadata volume from the destination server.



BRIEF DESCRIPTION OF THE DRAWINGS
The foregoing and advantages of the invention will be appreciated more fully from the following further description thereof with reference to the accompanying drawings wherein:
FIG. 1 is a schematic block diagram of a two server system demonstrating file access from multiple clients;
FIG. 2 is a schematic block diagram of a two server system where one of the servers is taken off the grid for migration;
FIG. 3 is a schematic block diagram of a two server system where one of the servers was replaced by the new server after all files were copied from the old one;
FIG. 4 depicts the process sequence of server migration with minimal interruption;
FIG. 5 depicts the process sequence of non-disruptive server migration;
FIG. 6 is a practical example of a sample global namespace including the metadata information and how the global name-space is used to calculate the target path;
FIG. 7 is a practical example of a sample global namespace including the metadata information and how the global name-space is used to calculate the target paths; and
FIG. 8 is a logic flow diagram for non-disruptive file migration by a file switch in accordance with an exemplary embodiment of the present invention.



Unless the context suggests otherwise, like reference numerals do not necessarily represent like elements.
DETAILED DESCRIPTION OF SPECIFIC EMBODIMENTS
Definitions. As used in this description and related claims, the following terms shall have the meanings indicated, unless the context otherwise requires:
Aggregator. An “aggregator” is a file switch that performs the function of directory, data, or namespace aggregation of a client data file over a file array.
File Switch. A “file switch” is a device (or group of devices) that performs file aggregation, transaction aggregation, and directory aggregation functions, and is physically or logically positioned between a client and a set of file servers. To client devices, the file switch appears to be a file server having enormous storage capabilities and high throughput. To the file servers, the file switch appears to be a client. The file switch directs the storage of individual user files over multiple file servers, using mirroring to improve fault tolerance as well as throughput. The aggregation functions of the file switch are done in a manner that is transparent to client devices. The file switch preferably communicates with the clients and with the file servers using standard file protocols, such as CIFS or NFS. The file switch preferably provides full virtualization of the file system such that data can be moved without changing path names and preferably also allows expansion/contraction/replacement without affecting clients or changing pathnames. Attune System's Maestro File Manager (MFM), which is represented in FIG. 5, is an example of a file switch.
Switched File System. A “switched file system” is defined as a network including one or more file switches and one or more file servers. The switched file system is a file system since it exposes files as a method for sharing disk storage. The switched file system is a network file system, since it provides network file system services through a network file protocol—the file switches act as network file servers and the group of file switches may appear to the client computers as a single file server.
Native File System. A “native file system” is defined as the native file system exposed by the back-end servers.
Native mode. A “native mode” of operation is a mode of operation where the backend file system is exposed to the clients through the file switch such that the file switch completely preserves the directory structure and other metadata of the back end server. Each file server (share) represents a single mount point in the global namespace exposed by the file switch.
File. A file is the main component of a file system. A file is a collection of information that is used by a computer. There are many different types of files that are used for many different purposes, mostly for storing vast amounts of data (i.e., database files, music files, MPEGs, videos). There are also types of files that contain applications and programs used by computer operators as well as specific file formats used by different applications. Files range in size from a few bytes to many gigabytes and may contain any type of data. Formally, a file is a called a stream of bytes (or a data stream) residing on a file system. A file is always referred to by its name within a file system.
User File. A “user file” is the file or file object that a client computer works with (e.g., read, write, etc.), and in some contexts may also be referred to as an “aggregated file.” A user file may be mirrored and stored in multiple file servers and/or data files within a switched file system.
File/Directory Metadata. A “file/directory metadata,” also referred to as the “the metadata,” is a data structure that contains information about the position of a specific file or directory including, but not limited to, the position and placement of the file/directory mirrors and their rank. In embodiments of the present invention, ordinary clients are typically not permitted to directly read or write the content of “the metadata”, the clients still have indirect access to ordinary directory information and other metadata, such as file layout information, file length, etc. In fact, in embodiments of the invention, the existence of “the metadata” is transparent to the clients, who need not have any knowledge of “the metadata” and its storage.
Mirror. A “mirror” is a copy of a file. When a file is configured to have two mirrors, that means there are two copies of the file.
Oplock. An oplock, also called an “opportunistic lock” is a mechanism for allowing the data in a file to be cached, typically by the user (or client) of the file. Unlike a regular lock on a file, an oplock on behalf of a first client is automatically broken whenever a second client attempts to access the file in a manner inconsistent with the oplock obtained by the first client. Thus, an oplock does not actually provide exclusive access to a file; rather it provides a mechanism for detecting when access to a file changes from exclusive to shared, and for writing cached data back to the file (if necessary) before enabling shared access to the file.
This provisional patent application relates generally to migrating file data from one storage server to another in a non-disruptive manner using a stateful network file protocol such as CIFS.
Regular Migration
FIGS. 1-3 demonstrate how the standard (non-optimized) file migration is done. FIG. 1 is a schematic block diagram of network file system before the beginning of the migration. Client11 to Client1m are regular clients that connect to the two back-end servers (Server11 and Server12) through a regular IP switch over a standard network file system protocol CIFS and/or NFS. When the administrator takes the server offline, he connects it directly to the destination server and begins direct file copy from source (Server21) to the destination (Server23) as depicted in FIG. 2. When all files are copied, the administrator renames the destination server to the name of the source server and finally the administrator connects the destination server in place of the source server as shown in FIG. 3.
Migration with Minimal Interruption
FIG. 4 depicts the minimal disruption migration. All accessible files are migrated from Server41 to Server43. Since the process can take a long time, some of the files may get changed during migration. In the second step, those files are migrated (again). Step two is repeated until all files are migrated or until the amount of data remaining to be migrated falls under a predetermined amount. Finally, the migration is completed in a way similar to the regular migration: in Step n+1 Server41 and Server43 are taken offline. In step n+2, the remaining files are copied to the destination. In the final step (n+3), the server is renamed to the name of the source server and the destination server is brought on-line (n+4).
Non-Disruptive Migration
For stateful file system protocols, there are two major obstacles for providing non-disruptive migration: files that are constantly been updated and files kept open continuously.
Generally speaking, when a file is constantly updated, the file migration is constantly going to be triggered. If the file is relatively large the migration process will have to start keeping track of the modified regions. Otherwise, the algorithm is never going to be able to catch up with the modifications.
If a file is held open, its sharing mode may not allow the file to be opened by the migration process which will prevent copying the file to the destination server. Normally these limitations can only be overcome by taking the server down while these files are been migrated. For the duration of this migration, the clients suffer a disruption in their ability to access those files.
Embodiments of the present invention described below utilize file virtualization in order to provide non-disruptive file/server migration. As shown in FIG. 8, non-disruptive file migration can be summarized in four general steps:
1) Convert the source server from a Native volume to a Native with metadata volume (block 802).
2) Convert the native with metadata volume to a mirrored native with metadata volume, where the second mirror resides on the destination server (block 804).
3) Convert back to a native with metadata volume by removing the source server from the volume (block 806).
4) Finally, the native volume with metadata is converted to a simple native volume (block 808).
Native Volume
A native volume is a basic virtualized representation of a share from the back-end server. Its content (directories and files) are completely managed by the hosting file server. Clients can access the virtualized volume through the global namespace or directly by accessing the back-end server.
Native Volume with Metadata
A native volume with metadata is a natural extension of the native volume mode with the ability to keep additional metadata information for each file/directory. “The metadata” will keep at least the following information: the number of mirrors and a list of the destinations where the file/directory mirror is placed.
One embodiment of this is where a local NTFS directory is used for storing all information about the native volume. In this case, the whole remote namespace (without the file data) is replicated inside this directory. All file attributes (including security, EA, file size, etc) are preserved on all mirrors as well as in the file switch namespace.
To calculate the actual path of a file, the system replaces the top level file prefix with the one specified in the metadata and leaves the rest of the path unchanged. This operation is very similar to the DFS/MUP operation. FIG. 6 is a practical example of a sample global namespace including the metadata information and how the global name-space is used to calculate the target path.
Mirrored Native Volume with Metadata
“Mirrored Native Volume with Metadata” is similar to the “Native Volume with Metadata” except there are two or more copies of the data. For the purpose of this embodiment, only two copies are used. FIG. 7 is a practical example of a sample global namespace including the metadata information and how the global name-space is used to calculate the target paths.
Basic Operations for (Mirrored) Native Volume with Metadata
CREATE NEW FILE/DIRECTORY—When create operation comes, the operation is performed initially over the file in the Local NTFS drive. If it succeeds, a file metadata is created as well and associated with the file/directory (e.g., stored inside an alternate data stream) and than the operation is forwarded to all mirrors in parallel. When all mirrors complete the operation, the operation is completed back to the client.
OPEN EXISTING FILE/DIRECTORY—When an open operation comes, the operation is performed initially over the local NTFS file. This allows the file security permissions to be evaluated locally and force evaluation of the sharing mode. If it succeeds, the metadata is read, to get the file placement and mirrors after which the open operation is forwarded simultaneously to all mirrors. When all mirrors complete the open, the open operation is completed back to the client.
READ/WRITE OPERATIONS—Data operations are submitted simultaneously to all mirrors with the operation sent to the mirrors in their rank order. When all of them complete the operation is acknowledged to the client. No read/write data is stored on the local disk so there is no need to send data operations to it. RANGE-LOCK OPERATIONS—Advisory range-locks or mandatory range-locks may be implemented. If advisory range-locks are supported, than the range-lock requests are sent only to the local NTFS volume. For mandatory range-locks, the range-lock requests are sent to the local file and after it succeeds it is sent to all mirrors. In this case the local file acts as an arbiter for resolving range-lock conflicts and deadlocks.
OPPORTUNISTIC LOCK (OP-LOCK) OPERATIONS—Oplock operations are submitted to local file and all mirrors in parallel. When (any) oplock breaks, the original client request is completed, although nothing is completed if the oplock level was already lowered. To produce the correct result, an exemplary embodiment starts (initially) with an uninitialized level which is the highest oplock level. From there on, the oplock level can only go down. Please note that it is possible the oplock level on mirror 1 to be broken to level 2 and while we are processing it, the level can be broken to level 0 on mirror 2. If the user acknowledges the break to level 2, it is failed immediately without sending anything to the mirrors. It should be noted that oplock break operations are the only operations that treats status pending as an acknowledgement that the operation completed successfully (i.e., processing it in a work item or from a different thread is unacceptable).
DIRECTORY ENUMERATION—All directory operations are served by the local name space. Since the local directory is a copy of the native directory structure, everything that the client requires is stored there.
DELETE AND RENAME OPERATIONS—The delete/rename operations are sent to the local directory first and after it succeeds it is sent to all file/directory mirrors (in parallel). The operation is completed when all mirrors completes it.
DIRECTORY CHANGE NOTIFICATIONS—Directory operations are submitted to all mirrors. Pass back the response when it comes. If there is no request to be completed, MFM saves the responses in their arrival order. When a new dir-change-notification request comes, it will pick the first pending response and complete it to the client, the next one will pick the next pending and so on. It is possible for the client to receive more than one break notification for the same change—one for the local metadata and one for each of the mirrors. This behavior is acceptable since the directory notifications are advisory and not time sensitive. The worst that can happen is the client will have to reread the state of the affected files. If there is no pending completion, than we submit directory change notification request to all mirrors that have no pending directory notification.
Converting from Native Volume to Native with Metadata Volume
In order to convert the Native Volume to a Native with metadata, all access to the back end server that is being converted will go through the file switch, i.e., the file switch is an in-band device. There should be no file access that does not go through it. A data corruption is possible in case files are been modified/accessed not through the file switch. The file switch cannot not enforce that the access to the backend servers is done only through the file switch.
Conversion from native to extended native is done by walking down the source directory tree and converting the volume directory by directory. Each directory operation usually is run by a single execution thread.
The execution thread opens the source directory, places a batch oplock on the source directory, so it can be notified in case someone changes it. In case the batch oplock is broken, the thread re-adds directory to the end of the list of directories to be processed, releases any resources it has acquired and exits.
Then the corresponding local directory and its metadata are created. The directory is enumerated and for each of the files found a sparse file is created in the local file system. The sparse file size corresponds to the actual file size. All other file attributes (time, attributes, security descriptors and EAs) are copied as well. The creation of “the metadata” for the file completes the conversion of the file.
After file enumeration completes, all directories are enumerated and for each directory found a new work item is created. The work items are added to the list of directories to be converted as a batch when the enumeration is completed. This would ensure that the sub-directory conversion will start only after the parent directory conversion is completed and avoid any nasty concurrency problems. At some point later when the same directory is scheduled again, any files and/or directories that have already been converted (by the previous attempts) would be skipped. This approach, although slow, can guarantee that there would be no missed entities.
The directory oplock break status is checked after processing each directory entity (file and/or directory). The status of the oplock break is not checked during the batch adding of the sub-directories to the directory processing queue since this operation is entirely local and is executed almost instantaneously.
All security descriptors are copied verbatim (without looking into it) except for the top level directory. The root directory security descriptor is converted to effective security descriptor and than set in the local NTFS directory. This would allow the sub-entities to properly inherit their security attributes from their parents.
This process repeats until there are no more entries in the directory list. The number of simultaneously processed directories can be limited to a predefined number to avoid slowing the system down due to over-parallelism. While converting the volume, the in memory structures of the currently opened files and directories maintained by the file switch (FIG. 5) needs to be modified to comply with the requirements of the native with metadata volume structure.
To provide atomicity, some operations may require a temporal suspension of all operations over the affected entity (file or directory). In this case the access to the file/directory is suspended, the system waits for all outstanding operations (except range-locks with timeout) to complete and than it performs the required operation. When the operation completes, with success or a failure, the access to the entity is restored.
Usually, the temporary access suspension is at most several hundreds of milliseconds long, which is comparable to the network latency, and thus would not affect the applications using those files even if they are actively using the opened file.
Operations during Conversion to Native Volume with Metadata
If the file/directory does not have metadata (i.e., it is not converted yet), the operation is forwarded to the native volume otherwise the operations are served way it is described in “Basic Operations for (Mirrored) Native Volume with Metadata” with the following exceptions.
CREATE NEW FILE/DIRECTORY—This operation is performed in the local namespace. If it succeeds, it is processed as described in “Basic Operations for (Mirrored) Native Volume with Metadata.” If it fails, the operation is submitted to the native volume and if it succeeds, this is an indication that the local directory has not been created/converted yet. It will be created eventually so there really is nothing to do here.
CONVERTING THE IN-MEMORY RANGE-LOCK STRUCTURES—The range-lock requests can be handled in one of two possible ways: as advisory locks or as mandatory locks (Windows default). If advisory range-locks are supported, access to the file is suspended temporarily, and all range-lock requests are submitted to the local NTFS volume on the File Switch after which all pending requests on the source file are cancelled. Once cancelled access to the file is restored. If mandatory range-locks are supported, access to the file is suspended, and all range-lock requests are submitted to local NTFS volume first, followed by the range-lock requests being submitted to the other file mirrors. After the range-locks are granted, access to the file is restored. While the migration is running, open file and/or directory requests should be submitted in parallel to the local NTFS file system metadata and to the native volume. If the request succeeds on the backend server but fails on the local volume, this is an indication that the file/directory has not been converted yet. In this case, all parent directories inside the Local NTFS volume need to be recreated before the operation is acknowledged to the client.
CONVERTING OPPORTUNISTIC LOCK (OP-LOCK) OPERATIONS—Converting opportunistic lock operations from Native to Native Volume with metadata involves submitting an oplock to the local NTFS volume in order to make it compliant with the expected model.
CONVERTING ACTIVE DIRECTORY ENUMERATION—Since directory operation is a relatively short operation, there really is nothing special that needs to be done here. The operation would be completed eventually and then served the proper way.
RENAME OPERATIONS—There are four different rename operation combinations based on the file conversion state and the destination directory conversion state: both are converted, both are not converted; only the source is converted, and only the destination is converted. Nothing special is needed if both are converted. If the source is converted but the destination directory does not exist in the local NTFS volume, the destination directory is created in the local volume and the rename/move operation is performed on the native volume and on the NTFS volume. If the destination directory is converted, but the local file is not, the file is converted after the rename operation completes. If the destination directory is converted, but the local directory is not, the directory name is added to the list of directories that require conversion. If the source and the destination are not converted, the rename operation is executed over the native volume only. After the operation completed, the destination directory is checked one more time and in case the destination directory suddenly becomes converted, and the entity is a file, metadata is created for it; if the entity is a directory, it is added to the list of directories that require conversion. This behavior is done to ensure that an entity conversion will not be missed.
CONVERTING DIRECTORY CHANGE NOTIFICATIONS—Converting the directory change notifications from Native to Native Volume with metadata involves submitting a directory change notification to the local NTFS volume in order to make it compliant with the expected model.
Creating/Rebuilding Data Mirrors for Native Mode with Metadata Volume
The directory operations and walking the tree is very similar to converting the volume to extended-native mode. For each directory found, a new destination directory is created and all directory attributes are copied there as well.
When the source file is opened for reading, a filter oplock is placed on the local NTFS file (filter oplocks are not supported across the network). If this filter oplock gets broken because someone opened the file, the mirroring process is stopped, the uncompleted mirrors are deleted, and the file is put on a list for later attempts to mirror.
If a file/directory open fails with a sharing violation error, this file/directory is added to list to be processed at some time later when the file is closed or opened with more appropriate sharing mode.
Periodically the list of files with postponed mirroring is checked and the mirroring attempt is repeated.
After several unsuccessful attempts to mirror file data, an open file mirroring is performed. The process starts by creating an empty file where the new mirrors are placed and begins to copy file data. The file data is read sequentially from the beginning of the file until the end of the file and is written to all of the mirrors (please note that no file size increase is allowed during this phase). In addition, all client write (and file size change) requests are replicated and sent to all mirrors. To avoid data corruption, reading the data from the source and writing it to the mirror(s) is performed while user access to this file is suspended. The suspension is once again performed for a relatively small interval so as not be noticed by the user (or application).
When the file is mirrored, the file handle state is propagated to the new mirror as well. This state includes but is not limited to: mirror file handle, range-locks and oplocks. Range-locks are replicated to all mirrors only if mandatory range-locks are supported; otherwise, there is nothing more that needs to be done if only advisory locks are supported.
When a directory is mirrored, any directory change notifications request needs to be resubmitted to the new mirror as well.
Removing the Source Server from the Mirrored Volume
Convert back to a native with metadata volume is done atomically by programmatically setting the source server state to “force-removed”, changing a global state to removing a mirror and logging off from the server. All operations pending on this server would be completed by the backend server and the file switch will silently “eat” them without sending any of them to the client.
After this, the source server references can be removed from “the metadata”: the directory operations and walking the tree is very similar to the way the data mirrors are rebuild described at “Creating/rebuilding data mirrors for Native mode with Metadata Volume”. Only the metadata structure is updated by removing the source server references from “the metadata”. Finally, the in-memory data handle structures are updated to remove any references to the source server. All those operations can be performed with no client and/or application disruption.
Converting from Native with Metadata to a Native Volume
Converting starts by going through all currently opened handles and replicating the opened state (e.g. range locks directory notifications, oplocks, etc.) over the native volume.
When done, ALL access to the specified server set is temporarily suspended and all open files/directories on the local NTFS directory are closed (any operations failed/completed due to the close are ignored). The global state of the volume is set to a pure native volume so all new open/creates should go to the native volume only.
Finally, access to the volume is restored.
At this point, the metadata directory can be moved to a separate NTFS directory where all files and directories containing “the metadata” can be deleted and associated resources can be freed.
All those operations are performed with no client and/or application disruption.
It should be noted that terms such as “client,” “server,” “switch,” and “node” may be used herein to describe devices that may be used in certain embodiments of the present invention and should not be construed to limit the present invention to any particular device type unless the context otherwise requires. Thus, a device may include, without limitation, a bridge, router, bridge-router (brouter), switch, node, server, computer, appliance, or other type of device. Such devices typically include one or more network interfaces for communicating over a communication network and a processor (e.g., a microprocessor with memory and other peripherals and/or application-specific hardware) configured accordingly to perform device functions. Communication networks generally may include public and/or private networks; may include local-area, wide-area, metropolitan-area, storage, and/or other types of networks; and may employ communication technologies including, but in no way limited to, analog technologies, digital technologies, optical technologies, wireless technologies (e.g., Bluetooth), networking technologies, and internetworking technologies.
It should also be noted that devices may use communication protocols and messages (e.g., messages created, transmitted, received, stored, and/or processed by the device), and such messages may be conveyed by a communication network or medium. Unless the context otherwise requires, the present invention should not be construed as being limited to any particular communication message type, communication message format, or communication protocol. Thus, a communication message generally may include, without limitation, a frame, packet, datagram, user datagram, cell, or other type of communication message.
It should also be noted that logic flows may be described herein to demonstrate various aspects of the invention, and should not be construed to limit the present invention to any particular logic flow or logic implementation. The described logic may be partitioned into different logic blocks (e.g., programs, modules, functions, or subroutines) without changing the overall results or otherwise departing from the true scope of the invention. Often times, logic elements may be added, modified, omitted, performed in a different order, or implemented using different logic constructs (e.g., logic gates, looping primitives, conditional logic, and other logic constructs) without changing the overall results or otherwise departing from the true scope of the invention.
The present invention may be embodied in many different forms, including, but in no way limited to, computer program logic for use with a processor (e.g., a microprocessor, microcontroller, digital signal processor, or general purpose computer), programmable logic for use with a programmable logic device (e.g., a Field Programmable Gate Array (FPGA) or other PLD), discrete components, integrated circuitry (e.g., an Application Specific Integrated Circuit (ASIC)), or any other means including any combination thereof. In a typical embodiment of the present invention, predominantly all of the described logic is implemented as a set of computer program instructions that is converted into a computer executable form, stored as such in a computer readable medium, and executed by a microprocessor under the control of an operating system.
Computer program logic implementing all or part of the functionality previously described herein may be embodied in various forms, including, but in no way limited to, a source code form, a computer executable form, and various intermediate forms (e.g., forms generated by an assembler, compiler, linker, or locator). Source code may include a series of computer program instructions implemented in any of various programming languages (e.g., an object code, an assembly language, or a high-level language such as Fortran, C, C++, JAVA, or HTML) for use with various operating systems or operating environments. The source code may define and use various data structures and communication messages. The source code may be in a computer executable form (e.g., via an interpreter), or the source code may be converted (e.g., via a translator, assembler, or compiler) into a computer executable form.
The computer program may be fixed in any form (e.g., source code form, computer executable form, or an intermediate form) either permanently or transitorily in a tangible storage medium, such as a semiconductor memory device (e.g., a RAM, ROM, PROM, EEPROM, or Flash-Programmable RAM), a magnetic memory device (e.g., a diskette or fixed disk), an optical memory device (e.g., a CD-ROM), a PC card (e.g., PCMCIA card), or other memory device. The computer program may be fixed in any form in a signal that is transmittable to a computer using any of various communication technologies, including, but in no way limited to, analog technologies, digital technologies, optical technologies, wireless technologies (e.g., Bluetooth), networking technologies, and internetworking technologies. The computer program may be distributed in any form as a removable storage medium with accompanying printed or electronic documentation (e.g., shrink wrapped software), preloaded with a computer system (e.g., on system ROM or fixed disk), or distributed from a server or electronic bulletin board over the communication system (e.g., the Internet or World Wide Web).
Hardware logic (including programmable logic for use with a programmable logic device) implementing all or part of the functionality previously described herein may be designed using traditional manual methods, or may be designed, captured, simulated, or documented electronically using various tools, such as Computer Aided Design (CAD), a hardware description language (e.g., VHDL or AHDL), or a PLD programming language (e.g., PALASM, ABEL, or CUPL).
Programmable logic may be fixed either permanently or transitorily in a tangible storage medium, such as a semiconductor memory device (e.g., a RAM, ROM, PROM, EEPROM, or Flash-Programmable RAM), a magnetic memory device (e.g., a diskette or fixed disk), an optical memory device (e.g., a CD-ROM), or other memory device. The programmable logic may be fixed in a signal that is transmittable to a computer using any of various communication technologies, including, but in no way limited to, analog technologies, digital technologies, optical technologies, wireless technologies (e.g., Bluetooth), networking technologies, and internetworking technologies. The programmable logic may be distributed as a removable storage medium with accompanying printed or electronic documentation (e.g., shrink wrapped software), preloaded with a computer system (e.g., on system ROM or fixed disk), or distributed from a server or electronic bulletin board over the communication system (e.g., the Internet or World Wide Web).
The present invention may be embodied in other specific forms without departing from the true scope of the invention. Any references to the “invention” are intended to refer to exemplary embodiments of the invention and should not be construed to refer to all embodiments of the invention unless the context otherwise requires. The described embodiments are to be considered in all respects only as illustrative and not restrictive.

## Claims

1. In a switched file system having a file switch in communication with a plurality of file servers including at least a source server and a destination server, where the source server manages a source native volume, a method for non-disruptive migration of the native volume from the source server to the destination server, the method comprising:
converting, by the file switch, the source native volume to a native with metadata volume using a local file system managed by the file switch;
converting, by the file switch, the native with metadata volume to a mirrored native with metadata volume, wherein the converting takes place in both the source server and the destination server, the destination server including a mirror copy of the native with metadata volume;
removing, by the file switch, the source server from the mirrored native with metadata volume, wherein the removing includes physically deleting and disconnecting the source server from the mirrored native with metadata volume; and
converting, by the file switch, the mirror copy of the native with metadata volume on the destination server to a destination native volume on the destination server.

2. A method according to claim 1, wherein converting the source native volume to the native with metadata volume comprises:
for each source directory in the source native volume, creating a corresponding local directory in the local file system including metadata associated with the source directory copied from the source native volume; and
for each source file in the source native volume, creating a corresponding local sparse file in the local file system including file attributes copied from the source native volume but excluding the file contents associated with the source file.

3. A method according to claim 2, wherein the metadata associated with the source directory copied from the source native volume comprises directory security descriptors.

4. A method according to claim 2, wherein creating a local directory for a source directory comprises:
opening the source directory in the source native volume;
placing a lock on the source directory; and
creating the local directory and its metadata.

5. A method according to claim 1, wherein converting the native with metadata volume to the mirrored native with metadata volume comprises:
for each local directory, creating a corresponding destination directory in the destination server and maintaining a mapping of the local directory to a source directory pathname for the corresponding source directory in the source server and to a destination directory pathname for the corresponding destination directory in the destination server;
for each local file, creating a corresponding destination file in the destination server including file data copied from the source native volume and maintaining a mapping of the local file to a source file pathname for the corresponding source file in the source server and to a destination file pathname for the corresponding destination file in the destination server.

6. A method according to claim 5, wherein each mapping includes an indicator of the number of servers associated with the mirrored native with metadata volume.

7. A method according to claim 5, wherein removing the source server from the mirrored native with metadata volume comprises:
disabling usage of the source destination pathnames and the source file pathnames.

8. A method according to claim 5, wherein converting the mirror copy of the native with metadata volume on the destination server to a destination native volume comprises:
replicating state information for the destination directories and the destination files from the source native volume;
disabling usage of the local directories and local files; and
advertising the destination directories and destination files as a native volume.

9. A method according to claim 8, wherein converting the mirror copy of the native with metadata volume on the destination server to a destination native volume further comprises:
deleting unneeded metadata associated with the mirror copy of the native with metadata volume from the destination server.

10. A file switch for non-disruptive file migration in a switched file system having a plurality of file servers including at least a source server and a destination server, where the source server manages a source native volume, the file switch comprising:
a network interface for communication with the file servers;
a processor coupled to the network interface; and
a memory coupled to the processor, wherein the processor is configured to execute programmed instructions stored in the memory comprising:
converting the source native volume to a native with metadata volume using a local file system managed by the file switch;
converting , the native with metadata volume to a mirrored native with metadata volume, wherein the converting takes place in both the source server and the destination server, the destination server including a mirror copy of the native with metadata volume;
removing the source server from the mirrored native with metadata volume, wherein the removing includes physically deleting and disconnecting the source server from the mirrored native with metadata volume; and
converting the mirror copy of the native with metadata volume on the destination server to a destination native volume on the destination server.

11. A file switch according to claim 10, wherein the processor is further configured to execute program instructions stored in the memory further comprising converting the source native volume to the native with metadata volume by:

creating, for each source directory in the source native volume, a corresponding local directory in the local file system including metadata associated with the source directory copied from the source native volume; and
creating, for each source file in the source native volume, a corresponding local sparse file in the local file system including file attributes copied from the source native volume but excluding the file contents associated with the source file.

12. A file switch according to claim 11, wherein the metadata associated with the source directory copied from the source native volume comprises directory security descriptors.

13. A file switch according to claim 11, wherein the processor is further configured to execute program instructions stored in the memory further comprising creating a local directory for a source directory by opening the source directory in the source native volume; placing a lock on the source directory; and creating the local directory and its metadata.

14. A file switch according to claim 10, wherein the processor is further configured to execute program instructions stored in the memory further comprising converting the native with metadata volume to the mirrored native with metadata volume by:

creating, for each local directory, a corresponding destination directory in the destination server and maintaining a mapping of the local directory to a source directory pathname for the corresponding source directory in the source server and to a destination directory pathname for the corresponding destination directory in the destination server; and
creating, for each local file, a corresponding destination file in the destination server including file data copied from the source native volume and maintaining a mapping of the local file to a source file pathname for the corresponding source file in the source server and to a destination file pathname for the corresponding destination file in the destination server.

15. A file switch according to claim 14, wherein each mapping includes an indicator of the number of servers associated with the mirrored native with metadata volume.

16. A file switch according to claim 14, wherein the processor is further configured to execute program instructions stored in the memory further comprising removing the source server from the mirrored native with metadata volume by disabling usage of the source destination pathnames and the source file pathnames.

17. A file switch according to claim 14, wherein the processor is further configured to execute program instructions stored in the memory further comprising:

converting the mirror copy of the native with metadata volume on the destination server to a destination native volume by replicating state information for the destination directories and the destination files from the source native volume;
disabling usage of the local directories and local files; and
advertising the destination directories and destination files as a native volume.

18. A file switch according to claim 17, wherein the processor is further configured to execute program instructions stored in the memory further comprising converting the mirror copy of the native with metadata volume on the destination server to a destination native volume further by deleting unneeded metadata associated with the mirror copy of the native with metadata volume from the destination server.

19. A non-transitory computer readable medium having stored thereon instructions for non-disruptive file migration in a switched file system having a plurality of file servers, including at least a source server and a destination server, where the source server manages a source native volume, comprising machine executable code which when executed by at least one processor, causes the processor to perform steps comprising:
converting the source native volume to a native with metadata volume using a local file system;
converting the native with metadata volume to a mirrored native with metadata volume, wherein the converting takes place in both the source server and the destination server, the destination server including a mirror copy of the native with metadata volume;
removing the source server from the mirrored native with metadata volume, wherein the removing includes physically deleting and disconnecting the source server from the mirrored native with metadata volume; and
converting the mirror copy of the native with metadata volume on the destination server to a destination native volume on the destination server.

20. A medium according to claim 19, further having stored thereon instructions that when executed by the at least one processor causes the at least one processor to perform steps further comprising:
creating, for each source directory in the source native volume, a corresponding local directory in the local file system including metadata associated with the source directory copied from the source native volume; and
creating, for each source file in the source native volume, a corresponding local sparse file in the local file system including file attributes copied from the source native volume but excluding the file contents associated with the source file.

21. A medium according to claim 20, wherein the metadata associated with the source directory copied from the source native volume comprises directory security descriptors.

22. A medium according to claim 20, further having stored thereon instructions that when executed by the at least one processor causes the at least one processor to perform steps further comprising creating a local directory for a source directory by opening the source directory in the source native volume; placing a lock on the source directory; and creating the local directory and its metadata.

23. A medium according to claim 19, further having stored thereon instructions that when executed by the at least one processor causes the at least one processor to perform steps further comprising converting the native with metadata volume to the mirrored native with metadata volume by:
creating, for each local directory, a corresponding destination directory in the destination server and maintaining a mapping of the local directory to a source directory pathname for the corresponding source directory in the source server and to a destination directory pathname for the corresponding destination directory in the destination server; and
creating, for each local file, a corresponding destination file in the destination server including file data copied from the source native volume and maintaining a mapping of the local file to a source file pathname for the corresponding source file in the source server and to a destination file pathname for the corresponding destination file in the destination server.

24. A medium according to claim 23, wherein each mapping includes an indicator of the number of servers associated with the mirrored native with metadata volume.

25. A medium according to claim 23 further having stored thereon instructions that when executed by the at least one processor causes the at least one processor to perform steps further comprising removing the source server from the mirrored native with metadata volume by disabling usage of the source destination pathnames and the source file pathnames.

26. A medium according to claim 23, further having stored thereon instructions that when executed by the at least one processor causes the at least one processor to perform steps further comprising:
converting the mirror copy of the native with metadata volume on the destination server to a destination native volume by replicating state information for the destination directories and the destination files from the source native volume;
disabling usage of the local directories and local files; and
advertising the destination directories and destination files as a native volume.

27. A medium according to claim 26, further having stored thereon instructions that when executed by the at least one processor causes the at least one processor to perform steps further comprising converting the mirror copy of the native with metadata volume on the destination server to a destination native volume further by deleting unneeded metadata associated with the mirror copy of the native with metadata volume from the destination server.