## P4 Flex ### NetApp FlexClone Technology NetApp FlexClone technology enables instant, space-efficient clones of production or test data to be created easily, minimizing storage requirements, because physical disk space for these clones is required only when data blocks are changed. With NetApp FlexClone, each engineer can have his or her own virtual copy of production or test data for use in test and development activities. The foundation of NetApp FlexClone is a writable point-in-time image based on a NetApp Snapshot® of a volume. The cloned volume stores only the data that changes between the source and clone. The Snapshot copy can already exist or it can be created automatically as part of the cloning operation. Creating the FlexClone volume takes just a few moments because the copied metadata is very small compared to the actual data. The parent volume can change independently of the FlexClone volume. It can also be split from its parent to create a new standalone volume. Space is used very efficiently because new disk space is only allocated when there are metadata updates and/or additions to either the parent or the clone volume. While this may sound like magic, this technology has been an integral part of Data ONTAP and deployed for numerous years in productions. [Merge 2016 session replay: 'Accelerating Software Development using NetApp's P4 Flex'](https://www.perforce.com/merge-2016/session/accelerating-software-development-netapp%E2%80%99s-p4flex) [Merge 2016 P4 Flex Demonstration: 'Accelerating Software Developement'](https://swarm.workshop.perforce.com/projects/netapp-p4flex/files/extras/NetApp_p4flex_demo_v5.mp4) [Paper: NetApp 'Storage magic'](http://www.perforce.com/sites/default/files/pdf/storage-magic-netapp-paper.pdf) ## Design ### P4 Flex Workflow Assume a Builder user, and a RegUser (both p4 users) 1. Create, Populate, Mount, and Sync Baseline Volume: Builder user creates and populates a baseline volume, syncs to depot. P4 Flex Commands : p4 flex volume -s 200G basevol 2. Snapshot Baseline Volume: Builder user (or another user) takes a snapshot of the baseline volume with the intent to almost instantaneously replicate the volumes contents. P4 Flex Commands : p4 flex snapshot -V basevol basesnap1 3. Clone Baseline Volume: The RegUser creates a clone of the baseline volume and changes ownership to himself/herself. P4 Flex Commands: p4 flex clone -V basevol -S basesnap1 regvol 4. Update New Workspace : This includes running 'p4 client' and 'p4 flush' from the new volume created. This will set up the new workspace to connect to the original depot. Flex Clone Deletion - p4 flex volume -d regvol Snapshot Deletion - p4 flex snapshot -V basevol -d basesnap1 Build Flow Steps ![Build Flow](images/BuildFlow.jpg)
Developer Flow Steps ![Developer Flow](images/DeveloperFlow.jpg) ### Use Cases Users of P4 Flex will be able to determine multiple fits of this technology to assist with application development. A couple of basic situations are given below: 1. Fast creation of new workspace(s) from existing base workspace via cloning 2. Run bisection workflows easily for error detection based on P4 changelists and corresponding snapshots