This article is the third installment of Back to Basics, a series of articles that discusses the fundamentals of popular NetApp technologies.
In the IT world, there are countless situations in which it is desirable to create a copy of a dataset: Application development and test (dev/test) and the provisioning of new virtual machines are common examples. Unfortunately, traditional copies don’t come free. They consume significant storage capacity, server and network resources, and valuable administrator time and energy. As a result, your operation probably makes do with fewer, less up-to-date copies than you really need.
This is exactly the problem that NetApp FlexClone® technology was designed to solve. FlexClone was introduced in Data ONTAP® 7G to allow you to make fast, space-efficient copies of flexible volumes (FlexVol® volumes) and LUNs. A previous Tech OnTap® article describes how one IT team used the NetApp rapid cloning capability built on FlexClone technology (now incorporated as part of the NetApp Virtual Storage Console, or VSC) to deploy a 9,000-seat virtual desktop environment with flexible, fast reprovisioning and using a fraction of the storage that would normally be required. NetApp uses the same approach for server provisioning in its own data centers.
Figure 1) FlexClone technology versus the traditional approach to data copies.
Using FlexClone technology instead of traditional copies offers significant advantages. It is:
Most Tech OnTap readers probably know about the use of FlexClone for cloning volumes. What’s less well known is that, starting with Data ONTAP 7.3.1, NetApp also gave FlexClone the ability to clone individual files and improved the capability for cloning LUNs.
This chapter of Back to Basics explores how NetApp FlexClone technology is implemented, the most common use cases, best practices for implementing FlexClone, and more.
How FlexClone Is Implemented in Data ONTAP
FlexClone volumes have all the capabilities of any other FlexVol volume, including the ability to grow, shrink, and be the source of a Snapshot® copy or even another FlexClone volume. The technology that makes this all possible is integral to how Data ONTAP manages storage. NetApp storage systems use the Write Anywhere File Layout (WAFL®) to manage disk storage. Any new data that gets written to the volume doesn’t need to go to a specific spot on the disk; it can be written anywhere. WAFL just updates the metadata to integrate the newly written data.
Snapshot copies simply make a copy of the metadata associated with a volume. As data is changed in the parent FlexVol volume, the original data blocks stay associated with the Snapshot copy rather than getting marked for reuse. All metadata updates that occur are just pointer changes.
You can think of a FlexClone volume as a transparent writable layer in front of a Snapshot copy. Because a FlexClone volume is writable, it needs physical space to store data that is written to the clone. A Snapshot copy simply links to existing data that was overwritten in the parent volume; a FlexClone volume stores the data written to it on disk (using WAFL) and then links to the new data as well. The disk space associated with the Snapshot copy and the FlexClone volume is accounted for separately from the data in the parent FlexVol volume.
Figure 2) Volume-level cloning.
When a FlexClone volume is created, it needs to know the parent FlexVol volume and also needs a Snapshot copy of the parent to use as a base. The Snapshot copy can already exist, or it can be created automatically. The FlexClone volume gets a copy of the Snapshot metadata and then updates its metadata as the clone volume is created. Creating the FlexClone volume takes just a few moments because the copied metadata is very small compared to the actual data.
The parent FlexVol volume can change independent of the FlexClone volume, because the Snapshot copy is there to keep track of the changes and prevent the original parent’s blocks from being released while the Snapshot copy exists. The Snapshot copy is read-only and can be reused as the base for multiple FlexClone volumes. Space is used very efficiently, since the only new disk space used is associated either with the small amounts of metadata or updates and/or additions to either the parent FlexVol volume or the FlexClone volume.
This approach for cloning volumes can be used to clone volumes that contain LUNs as well. Typically, you need to make sure that the target LUN or LUNs within the volume are in a consistent state before cloning. This and much more is described in detail in NetApp TR-3347: A Thorough Introduction to FlexClone Volumes. However, the volume-level cloning approach has been largely superseded for LUN cloning by the approach described next.
File and LUN Cloning
Starting with Data ONTAP 7.3.1, you can create a clone of a file in a FlexVol volume in a NAS environment or clone a LUN in a SAN environment without the need for a backing Snapshot copy.
Similar to volume-level cloning, cloning of files and LUNs is highly space efficient, since the cloned copies share the same physical space with the source and the space occupied by the initial metadata is negligible. Cloned files or LUNs occupy additional space only as data is overwritten or added to the source or the clone. Clone creation is a fast and time-efficient process since no physical data copying is required.
Figure 3) File- or LUN-level cloning. (Requires Data ONTAP 7.3.1 or later.)
The process of creating a clone of an existing file or LUN has no impact on client access, either during the creation process or after the cloning is done. Clients can write to the source file or LUN while the cloning process is in progress. Once the cloning process is complete, the clone files or LUNs can be accessed from a client and treated like any other file or LUN. Source files and source LUNs and clone files and clone LUNs can be deleted with no ill effect.
These new abilities, combined with the volume-level cloning capability described above, provide a space- and time-efficient solution for many data center problems that require multiple copies of the same dataset. FlexClone at the volume, file, and LUN levels can be combined to create a powerful time- and space-efficient solution to store redundant datasets, since all the redundant files or LUNs share the same underlying physical storage.
FlexClone can also be used to clone individual files inside a LUN in a SAN environment. Data ONTAP provides an API to enable this capability. However, host-side support is needed to integrate the clone file into the host file system and to make the clone file usable by the client. You can read more about this process and all aspects of file and LUN cloning in TR-3742: Using FlexClone to Clone Files and LUNs.
You can make use of FlexClone technology in almost any situation in which you need a copy of a file, LUN, or volume. Some even use FlexClone technology successfully in their production environments by using FlexShare® to manage the latency of clones. If you have large databases, you may find FlexClone particularly useful in conjunction with data warehouse operations as well as dev/test.
In this section, I talk about the two most popular use cases:
Because making clones has zero impact, you can refresh the cloned production data you use for your development work more often, so that you always test against current rather than stale data. Most shops refresh only once every 90 days.
Also, instead of having all your developers and testers share one or two copies of a test database, you can create a gold copy and clone it multiple times so that each person has his or her own clones to work with. You can do destructive testing without affecting anything outside the clone. When the testing is finished, you simply delete the clone, and you can create a new, clean clone image in a matter of minutes. This approach is described in a recent Tech OnTap article on development for Oracle11g™ that also describes how you can integrate data masking (to eliminate confidential user data) into your development process.
You may have a DR environment that sits more or less idle most of the time. With FlexClone technology, you can clone the DR volumes that correspond to your production environment and put that infrastructure to work. Replication to clone source volumes continues unimpeded while your dev/test team works on clones of production data.
The net result is significant improvements in development and test capabilities that can lead to improvements in application quality and faster application delivery as well as reduced costs. For example, dev/test for a 100GB production database usually starts with a full mirror and then several copies for developers and several for testers. If we conservatively assume that three of each type are needed, the total storage requirement (including the production database) is 800GB. Retaining the full mirror (to avoid any impact on production storage) and using FlexClone for the dev/test copies reduces the total storage requirement to just 260GB—a 67% reduction in storage required. (This assumes that the average change rate in dev/test volumes is about 10%.) Rapid creation and cleanup of clones also means that users waste less time waiting for copies and more time working.
Provisioning for Virtual Environments
Provisioning in virtual server and desktop environments can also benefit from FlexClone technology. Traditional provisioning requires a full copy, and the full process takes 20 to 30 minutes to complete for a typically sized VM. Provisioning with FlexClone reduces that time to about 3 minutes, start to finish.
For VMware® environments, file-level cloning can be used to create clones of VMDK files stored in VMware datastores accessed via NFS. LUN-level cloning can be used when VMDK files are stored inside a VMFS datastore in a LUN that is accessed over either FCP or iSCSI. This capability can be accessed from VMware vCenter™ using the rapid cloning utility integrated into the NetApp Virtual Storage Console. VSC not only handles cloning, it also provides proper configuration and registration with vCenter. VSC also supports redeploying existing virtual machines to bring them up to date with the latest patches or other changes. You can learn more about provisioning and other management tasks in VMware environments with NetApp storage in a recent Tech OnTap article.
To integrate cloning in Microsoft® Hyper-V™ environments, NetApp provides ApplianceWatch PRO for Microsoft System Center. Cloning integration with XenServer is provided by the codeveloped Citrix StorageLink Adapter for NetApp Data ONTAP.
Using FlexClone Technology
A few best practices can help you succeed with FlexClone technology. For full details refer to NetApp TR-3347: A Thorough Introduction to FlexClone Volumes and TR-3742: Using FlexClone to Clone Files and LUNs. A few best practices are summarized here.
For volume-level cloning:
For file- and LUN-level cloning:
Combining volume-level and file/LUN-level cloning:
FlexClone with Other NetApp Technologies
When it comes to integration with other NetApp products, NetApp FlexClone technology shares many similarities with NetApp deduplication. This is because both technologies reduce storage use by allowing a single block of storage to have many pointers to it. Here’s how FlexClone works in conjunction with deduplication and a few other NetApp technologies:
In some instances, the space-efficient volume clones will contain critical data that warrants replication. Before Data ONTAP 8.0.1 (7-Mode), when a FlexClone volume is replicated using volume SnapMirror, space savings are lost. The FlexClone volume on the target requires capacity equal to the size of the parent volume. Starting with Data ONTAP 8.0.1, when operating in 7-Mode, FlexClone volumes can be replicated using volume SnapMirror without the need for additional capacity on the destination system as long as the parent of the FlexClone volume is also replicated. See TR-3446: SnapMirror Best Practices for more details.
NetApp FlexClone technology is an important storage efficiency tool that can be used alone or in conjunction with other solutions such as NetApp Flash Cache, deduplication, and others. To learn more about NetApp FlexClone, refer to NetApp TR-3347: A Thorough Introduction to FlexClone Volumes and TR-3742: Using FlexClone to Clone Files and LUNs.
Got opinions about FlexCone?
Ask questions, exchange ideas, and share your thoughts online in NetApp Communities.