7.6 How does Cloning Work?

Cloning a virtual machine or template enables you to create multiple virtual machines or templates based on the original. There are two methods of cloning; a simple clone, and an advanced clone. A simple clone sets up the clone with the same configuration information as the original. An advanced clone enables you to create and use a clone customizer with differing configuration from the original. For example, you can use a clone customizer to have the clone deploy to a different server pool or repository, with changed memory, virtual CPU number, network settings, and so on. Figure Figure 7.1, “Cloning a virtual machine or template” shows the process of creating a clone of a virtual machine or template.

Figure 7.1 Cloning a virtual machine or template

This figure shows the process of creating a clone of a virtual machine or template.

To modify the clone parameters, such as virtual disks, network, memory, and so on, you should create a clone customizer, and use that clone customizer to perform cloning. You can create a clone customizer to set up the clone parameters, such as networking, and the virtual disk, and ISO resources. A clone customizer is also used when moving a virtual machine or template. See Manage Clone Customizers in the Oracle VM Manager User's Guide to see an example of how you are able to create a clone customizer to use during cloning.

A cold clone is a clone created from a stopped virtual machine. A cold clone performs a clone of the virtual machine, with safe and consistent virtual disk status. This is useful for creating a virtual machine or template from the original virtual machine.

A hot clone is created from a running virtual machine. A hot clone is only available on OCFS2-based file systems, so you must use either iSCSI- or fibre channel-based storage for the source and target repositories. Additionally, Oracle VM Manager allows you to create hot clones for virtual machines only if the clone type for the virtual disk is a thin clone.

Note

A hot clone creates a clone with inconsistent disk status, and should only be used as a snapshot or back up of a virtual machine, perhaps on a virtual machine that requires 100% uptime and cannot be shut down. If you want to use the hot-cloned virtual machine, you should first repair any virtual disks, using a disk repair utility such as fsck. Do not use hot cloning for virtual machines running an Oracle Database. Instead, you should use an Oracle Database backup strategy, such as the rman utility.

A thin clone only copies the required virtual machine files and ignores empty disk space, so the cloning process is able to complete much more quickly. This process makes use of the reflinking capability within the OCFS2 file system, allowing for a rapid cloning method. As a result, thin cloning can only be used when cloning from and to the same OCFS2-based repository, and when the storage used for the storage repository is non-generic (for example, a Sun 7000 or NetApp Storage Connect plug in). Thin cloning is the fastest and most efficient cloning method.

Note

Thin provisioning of physical disks on generic storage is not supported.

A clone can also be performed using two other file copy methods: sparse copy, and non-sparse copy. These two cloning methods can be used when cloning from and to different repositories, and when the storage used for the storage repository uses a generic Storage Connect plug in. These cloning methods are slower than thin cloning, but more versatile.

Sparse copy only takes up the amount of disk space actually used, not the full specified disk space. This process only copies used blocks and ignores unused blocks on the disk. This makes it quicker than a non-sparse copy and is efficient in its initial use of disk space, however the process is not as fast as thin cloning. Since sparse copy does not allocate all required disk space immediately, it is important to plan for the possibility that disk sizes may ultimately exceed the repository size where the the virtual machine is running and cause I/O errors on all of the running virtual machines in the same repositories. Therefore, when using sparse copy, you should ensure that the repository size is adequate to handle the potential disk space requirements of all of the virtual machines hosted on it.

Non-sparse copy performs a block-level copy of a disk, so that even unused blocks are cloned. This means that the virtual machine disk is fully allocated at the time that the virtual machine is cloned, whether the disk blocks are used or not. The advantage of this type of clone is that you can always be certain of the amount of disk space required for a virtual machine and cannot exceed the disk space available in a repository by hosting it there.