![]() | Oracle System Handbook - ISO 7.0 May 2018 Internal/Partner Edition | ||
|
|
![]() |
||||||||||||||||||||||||||||||||||||||||||
Solution Type Technical Instruction Sure Solution 1668933.1 : ODAVP: How to create a VM template from a Guest VM
In this Document
Applies to:Oracle Database Appliance Software - Version 2.5.0.0 and laterOracle Database Appliance - Version All Versions and later Information in this document applies to any platform. GoalThe purpose of this article is to illustrate how to create a VM template from a Guest VM running on Oracle Database Appliance Virtualized Platform. SolutionHow to create a VM template from a Guest VM
VM Guest running from local storage repository
1. Stop the VM running on local repositoryIn order to keep consistency on the VM files you must stop the Virtual Machine. From ODA_BASE domain issue the following command: oakcli stop vm <vm_name> [-force]
example: # oakcli stop vm ol6u4a4 2. Check in which local repository your vm is runningFrom ODA_BASE issuing the following comand: oakcli show vm <vm_name> 3. Package the current VM as a template.tgz fileFrom the dom-0 related to the local repository where your VM is running, you need to package the VM as tgz file issuing the following command (note as the package file is created on the same Guest VM folder): tar cvfzS /OVS/Repositories/<local_repo_name>/VirtualMachines/<vm_name>/<vm_name>.tgz -C /OVS/Repositories/<local repo name>/VirtualMachines/<vm_name> .
example: # tar cvfzS /OVS/Repositories/odarepo1/VirtualMachines/ol6u4a4/ol6u4a4.tgz -C /OVS/Repositories/odarepo1/VirtualMachines/ol6u4a4 . 4. Import it as a vmtemplateHaving the VM package you can now import on the local repository, from ODA_BASE: oakcli import vmtemplate <vmtemplatename> -files /OVS/Repositories/sharedrepo/<local_repo_name>/VirtualMachines/<vm_name>/<vm_template_name>.tgz -repo <repo_name>
example: # oakcli import vmtemplate ol6u4a4_shared -files /OVS/Repositories/odarepo1/VirtualMachines/ol6u4a4/ol6u4a4.tgz -repo odarepo1 4. Remove the source vm templateHaving the VM template imported, you can now remove the source file, from dom0: rm /OVS/Repositories/sharedrepo/<local_repo_name>/VirtualMachines/<vm_name>/<image files>
example: # rm /OVS/Repositories/odarepo1/VirtualMachines/ol6u4a4/ol6u4a4.tgz
VM Guest running from shared storage repository1. Stop the VM running on shared repositoryIn order to keep consistency on the VM files you must stop the Virtual Machine. From ODA_BASE domain issue the following command: oakcli stop vm <vm_name> [-force]
example: # oakcli stop vm ol6u4a4 2. Check in which local repository your vm is runningFrom ODA_BASE issuing the following comand: oakcli show vm <vm_name> 3. Package the current VM as a template.tgz fileFrom ODA_BASE, you need to package the VM as tgz file issuing the following command (note as the package file is created on the same Guest VM folder): tar cvfzS /u01/app/sharedrepo/<shared_repo_name>/<vm_name>.tgz -C /u01/app/sharedrepo/<shared_repo_name>/.ACFS/snaps/<vm_name>/VirtualMachines/<vm_name> .
example: # tar cvfzS /u01/app/sharedrepo/srepo1/ol6u4a4.tgz -C /u01/app/sharedrepo/srepo1/.ACFS/snaps/ol6u4a4/VirtualMachines/ol6u4a4 . Note: in case your Guest VM is using VDisks, you need take care for them as well and include into the tgz file create above.
Example: Let's suppose you guest VM is using a VDisk such : "oakvdk_disk01_srepo1". /u01/app/sharedrepo/<shared_repo_name>/.ACFS/snaps/oakvdk_<vdisk_name>/VirtualDisks/<vdisk_name> in example: then the archive creation command will be: tar cvfzS /u01/app/sharedrepo/<shared_repo_name>/<vm_name>.tgz -C /u01/app/sharedrepo/<shared_repo_name>/.ACFS/snaps/VirtualMachines/<vm_name> . -C /u01/app/sharedrepo/<shared_repo_name>/.ACFS/snaps/oakvdk_<vdisk_name>/VirtualDisks .
example: 4. Import it as a vmtemplate in a shared repoHaving the VM package you can now import on the shared repository, from ODA_BASE: oakcli import vmtemplate <vmtemplatename> -files /OVS/Repositories/sharedrepo/<shared_repo_name>/VirtualMachines/<vm_name>/<vm_template_name>.tgz -repo <repo_name> -node <0|1>
example: # oakcli import vmtemplate ol6u4a4_newt -files /OVS/Repositories/sharedrepo/srepo1/ol6u4a4.tgz -repo srepo1 -node 0 Note: if your Guest VM was using VDisks, "oakcli show vm <vmname> will show them under "Disk" and not anymore under "VDisk"
5. Remove the source vm templateHaving the VM template imported, you can now remove the source file, from ODA_BASE: rm /u01/app/sharedrepo/<shared_repo_name>/<vm_name>.tgz
example: # rm /u01/app/sharedrepo/<shared_repo_name>/ol6u4a4.tgz
References<NOTE:1524138.1> - ODAVP: How To Create a Fully-Virtualized Guests (HVM) from an OS ISO image<NOTE:1633166.1> - ODAVP: HowTo backup/restore your VM Guest <NOTE:1601860.1> - ODAVP: How to move a VM from local to a shared repository Attachments This solution has no attachment |
||||||||||||||||||||||||||||||||||||||||||
|