Why does SQL Clone create VHD Size of 2TB for each clone?
andrewgibson
Posts: 7 New member
in SQL Clone
New to SQL Clone and want to understand the technology behind the SQL Clone utilities. I am wondering why a VHD of 2TB is created each time for a cloned DB? Is there a way to change this as some of the cloned DBs I create are very small and do not require 2TB VHDs
Answers
Would highly recommend reading through this documentation to get all the details behind the technology for SQL Clone: https://documentation.red-gate.com/clone/getting-started/how-sql-clone-works
To quickly mention the relevant bits to your inquiry, SQL Clone works via using the standard disk virtualization technologies built into the Windows Operating System. It creates a Virtual Hard Disk (VHD) containing the image, and another one, called a differencing VHD, or just 'diff file', for each clone, which has a connection, via a VHD mount point, to the remote image.
SQL Clone makes no changes to the way this virtualization technology works; it merely 'orchestrates' it. Once it has assembled the various 'players' , SQL Clone steps back and lets them play, although it will try to step in and try to help fix things up, if they go awry.
Using SQL Clone is a two-step process. The first step is creating the image. This is a relatively slow process, roughly equivalent to restoring a database, but this step will be performed relatively infrequently and can be automated, for example so that it runs overnight. The second step is creating one or more clones, from an image. Creating each clone takes only seconds and can also be automated.
Sean Quigley | Product Support Engineer | Redgate Software
Have you visited our Help Center?
I was merely asking about the VHDs and why the 2TB is a pre defined value. I have an instance that has 5 cloned DB images presented to it and in turn this has added 5 2TB VHDs onto the server, none of the Images are anywhere near that size. Is there a way to change the 2TB value to a lower value?
Thanks for the update on your end.
You won't be able to specify the size of the VHD because it's dynamically sized as it needs to expand with changes being made to the clone with additional data added. It may look like it's taking 2TB which is the max size a single VHD is able to take, however the actual size should still be around the database size involved and it might not even be that as it should be the image size plus any additional data added to the clone.
Please let me know if you have any other questions or concerns on this.
Sean Quigley | Product Support Engineer | Redgate Software
Have you visited our Help Center?
SQL Clone creates a virtual hard disk (VHD) with a maximum size of 2TB for each cloned database, even if the database is much smaller. This is due to SQL Clone’s approach to thin provisioning, where the VHD is set to a large fixed size but initially consumes minimal physical storage. As you use the cloned database and make changes, only the differences from the original are stored, gradually increasing storage use as needed. The 2TB limit allows SQL Clone to manage data growth flexibly and maintain performance without needing to resize the VHD constantly. While the large VHD size may seem excessive, it won’t impact storage until the actual data grows, keeping cloning efficient and responsive.