In my previous post, I already post script to backup Oracle ODA VM, In this post we will use that backup files to clone virtual machine.
Here is the steps ;
1- Create ISO Image to clone Virtual Machine. Just tar the virtual machine files from its own directory or go to my previous post to backup virtual machine.
Note : Here is important note ; For some oda versions tar file type can throw an error message please consider about it and try other format too, here is two format.
tar -cvzf /u01/app/sharedrepo/vmrepo1/VirtualMachines/WEBLOGIC_APP.tgz ./*
tar -cvzf /u01/app/sharedrepo/vmrepo1/VirtualMachines/WEBLOGIC_APP.tar.gz ./*
2- Create Template for the virtual machine we would like to clone. Please make sure about the file location, Though we run this command from odabase layer , directory location will be from dom0 layer
oakcli import vmtemplate WEBLOGIC_APP_Template -files /OVS/WEBLOGIC_APP.tgz -repo vmtemp1
oakcli import vmtemplate WEBLOGIC_APP_Template -files /OVS/WEBLOGIC_APP.tar.gz -repo vmtemp1
3- Create Virtual Machine
oakcli clone vm WEBLOGIC_APP_CLONE -vmtemplate WEBLOGIC_APP_Template -repo vmrepo1
Important Note :
When you start this virtual machine you will have an IP conflict. To not have an IP conflict there is one way to change it before start the cloned virtual machine,
- Mount that img file
- Use editor for modify network configuration ” vi /etc/sysconfig/network-scripts/ifcfg-eth0″
- Save,exit and unmount img file.
- Start VM
For more details to mount img file go to post ” How to mount Image (*.img) file “
793 views last month, 1 views today