Description:-
In this article we are going to see step by step Cloning a Volume from one instance to another instance on oracle cloud infrastructure
High Level steps are:-
- Already we have created 2 VM instance India and London
- Create new block volume and attach to India vm instance (Backuptest)
- Create testing file inside the mount point
- Create block volume cloning,which we attached in India instance
- Attach the block volume clone to London instance (clonebv).
- Finally check the testing file is available
We can create a clone from a volume using the Block Volume service. Cloning enables you to make a copy of an existing block volume without needing to go through the backup and restore process.
A cloned volume is a point-in-time direct disk-to-disk deep copy of the source volume, so all the data that is in the source volume when the clone is created is copied to the clone volume. Any subsequent changes to the data on the source volume are not copied to the clone. Since the clone is a copy of the source volume it will be the same size as the source volume unless you specify a larger volume size when you create the clone.
The clone operation occurs immediately, and you can attach and use the cloned volume as a regular volume as soon as the state changes to available. At this point, the volume data is being copied in the background, and can take up to thirty minutes depending on the size of the volume.
There is a single point-in-time reference for a source volume while it is being cloned, so if the source volume is attached when a clone is created, you need to wait for the first clone operation to complete from the source volume before creating additional clones. If the source volume is detached, you can create up to ten clones from the same source volume simultaneously.
You can only create a clone for a volume within the same region, availability domain and tenant. You can create a clone for a volume between compartments as long as you have the required access permissions for the operation.
Let’s Start Demo:-
Step:-1 2 instance details India and London
Source Instance is India
Already Create block volume in India instance and place the file /backup/oracledbwr for testing
Target Instance is London
Step:-2 Block volume is attached to India instance already
Step:-3 We are going to clone the backuptest block volume
Block Storage -> Block Volumes -> Block Volume Details
Step:-4 Provide the below details and create clone
Step:-5 Block volume clone is ready to attach
Target side Configuration for London Instance
Step:-1 Block volume cloned Clonebv is ready to attach London instance
Step:2 Attach Block Volume to London instance
Compute Instances -> Instance Details -> click London -> Next click Attached block Volumes
Step:-3 Check the volume is attached
Step:-4 Provide the below details
- Attachement mode: iSCSI
- Block Volume: Select the cloned volume which we created before (Clonebv)
- Device Path: Select /dev/oracleoci/oraclevdb
- Cilck Attach
Step:-5 Once the volume is attached, you can click on the ellipsis and then click iSCSI Command and Information link.
Step:-6 Connect to the instance through SSH and run the iSCSI ATTACH COMMANDS.Click on COPY to copy all attach commands run all these commands by pasting it in the terminal
Step:-7 Once the disk is attached, you can run the following commands to mount it.
[root@london ~]# sudo mkdir /backupclone
[root@london ~]# ls -lrt /dev/oracleoci/oraclevd*
lrwxrwxrwx. 1 root root 6 Nov 26 20:38 /dev/oracleoci/oraclevda -> ../sda
lrwxrwxrwx. 1 root root 7 Nov 26 20:38 /dev/oracleoci/oraclevda2 -> ../sda2
lrwxrwxrwx. 1 root root 7 Nov 26 20:38 /dev/oracleoci/oraclevda3 -> ../sda3
lrwxrwxrwx. 1 root root 7 Nov 26 20:38 /dev/oracleoci/oraclevda1 -> ../sda1
lrwxrwxrwx. 1 root root 6 Nov 26 20:46 /dev/oracleoci/oraclevdb -> ../sdb
[root@london ~]# sudo mount /dev/oracleoci/oraclevdb /backupclone
[root@london ~]# cd /backupclone
[root@london backupclone]# ls -lrt
total 20
drwx——. 2 root root 16384 Nov 26 11:52 lost+found
-rw-r–r–. 1 root root 47 Nov 26 14:53 oracledbwr
[root@london backupclone]# cat oracledbwr
Testing block volume cloning to another domain —- File is available
Successfully completed the Testing …………
Check Here -> Oracle Gen2 Cloud-Restoring a Backup to a New Volume
Connect with me:-
Telegram App:https://t.me/oracledbwr
LinkedIn:https://www.linkedin.com/in/hariprasathdba
Facebook:https://www.facebook.com/HariPrasathdba
FB Group:https://www.facebook.com/groups/894402327369506/
FB Page : https://www.facebook.com/dbahariprasath/?
Twitter : https://twitter.com/hariprasathdba