Oracle VM 3.3.1 script: guest hot-backup on different repository (v. 0.2)

== PLEASE SEE NEW VERSION RELEASED ON THIS BLOG == 

Here you can find a further real experience based on real customer case and requirements.

The requirement, in this case, was to have an hot guest backup placed on a NFS-repository; this NFS repository ( mounted by all Oracle VM servers also on different pools ) is also mounted by a backup-server.

The target, in this case, is to have hot backups of guests on the NFS repository where Backup server ( that could be based on all media library supplied by different Hardware Vendor ) stores everything on media library ( tape and/or further media library ).

Obviously, starting from release 3.x, this is possible using the web-interface of Oracle VM Manager but, manual snaps could be a problem if you need to schedule them.

So, here you have the script ( that interacts with Oracle VM Manager 3 CLI ) that allows you to schedule hot-snaps and to put them on a dedicated repository ( NFS is suggested but you can also evaluate to put them on an OCFS2 repository and export only this "backup" repository outside ).

Requirements:

- expect installed

- Oracle VM >= 3.3.1 release ( it does not work on older Oracle VM releases )

- Oracle VM Manager network reachable

- guest owns only virtual-disks ( physical disks cannot be hot-cloned without storage-plugin installed ) 

- source repository must be OCFS2 type ( not NFS ) 

Executing the script:

[scoter@area51: ~/Oracle/OVM_33/HotCloneVm_0.1]# ./HotCloneVm.sh ##################################################################################### You have to specify <guest id> or <guest name>: Use HotCloneVm.sh <Oracle VM Manager password> <Oracle VM Manager host> <guest name>

<Oracle VM Server Pool> <target Repository> Example <guest name>: HotCloneVm.sh Welcome1 ovm-mgr.oracle.local vmdb01 myPool repo02 #####################################################################################

This little bash script could be executed on a client ( laptop ) or directly on the Oracle VM Manager server.

The script, to obtain an hot-clone on different repository, execute the following steps:

1. create an hot-clone of the guest on the same ocfs2 repository ( using ocfs2-reference-link )

2. create a dedicated "Clone Customizer" based on the info of the guest

3. move the snap to the repository ( that could be NFS and/or OCFS2 ) indicated in the script

In the example below, I'm going to obtain an hot backup of the guest named "olnx01" that resides on "repo01"

and move it to a different repo named "repo03".

Guest details:

 

 

[scoter@area51: ~/Oracle/OVM_33/HotCloneVm_0.1]#

./HotCloneVm.sh Welcome1 127.0.0.1 olnx01 ovspool33 repo03

spawn ssh -l admin 127.0.0.1 -p 10000 admin@127.0.0.1's password: ## Starting Generated OVMCLI Script... ##

Here you can check jobs executed by the scripts: 

 

As you can see in the screenshot below, the script completed the creation of an hot-clone of the guest on the

repository "repo03"; Its name contains the word "CLONE" and, at the same time, contains the data/hour of

the execution of the snap: 

 

Here you can find the script reported in this blog-post.

Corrections, comments and enhancements are welcome.

Simon Coter

Comments:

This looks amazing. Thank you so much for sharing...

Is there any way to incorporate incrementals to the NFS storage?, or will the snapshots ALWAYS be a FULL backup.

Posted by guest on September 03, 2014 at 04:48 PM CEST #

Thank you for your comment.
This kind of OVMCli script repeat all the steps that you can also manyally do by web interface ( so there isn't any incremental snapshot possibilitY ).
Keep in minds that the NFS repository could also be your "real" backup.
It all depends which is your standard backup method.
My next blog-entry would cover the need to have an incremental backup but it will be a totally different solution.
Obviously both ( this solution and what I'm going to prepare soon ) could be applied at the same time.

Posted by Simon on September 04, 2014 at 10:58 AM CEST #

Awesome, just what I was looking for, I have 2 questions: 1. It only works in OVM 3.3? I have customers running OVM 3.2 asking for this kind of backup. 2. It will be integrated in a future release? Those customers complains about the snapshot capability of other virtualuzation product that I will not say

Regards

Posted by Luis on September 08, 2014 at 07:33 PM CEST #

Thank you so much for ALL your help.

If an incremental/differential backup solution per VM becomes available for Oracle VM this will be the best VM solution on the market. This is the major thing that is holding us back. We do not want to ever need to run backup agents internally inside the VMs. We need a HOST level VM backup solution for Oracle VM.

You are the best and thank you so much for all your help.

Posted by guest on September 10, 2014 at 05:03 PM CEST #

Hi Luis,

maybe it's possible also on version 3.2 ( with different methods and OVMCli calls ).
Actually I'm busy to the oncoming Oracle Open World but I'll try to give you a complete reply as soon as possible.
Thank you for your feedback.

Simon

Posted by Simon on September 11, 2014 at 01:46 AM CEST #

Hello,
I'm being trying to run your scrip but i don't find the "create VmCloneCustomizer" at my OVM cli.
I look at the document you has posted earlier but i couldn't find it.
Anything i could do?

Posted by Josseoss on September 16, 2014 at 08:23 PM CEST #

Hi Josseoss,

if your OVMCli doesn't recognize the "create VMCloneCustomizer" means that you are not working on an Oracle VM 3.3.1 environment.
As you can see in my reply to Luis, maybe it's possible with different calls and methods also on older releases ( like Oracle VM 3.2 ).
The subject of the blog post reports "Oracle VM 3.3.1 script" but now I'm also going to report it on section "requirements".
Thank you for your comment.

Simon

Posted by Simon on September 17, 2014 at 01:14 AM CEST #

Hi Simon,
I thank you a lot for your script. it's been very helpfull. I have to upgrade my OVM but it wasn't so much trouble.
Some recomendations:
I have to edit the script because when it was looking for the disk mapping in the virtual guest, when you send the command "show vm name=$vmid\r" i change the expect message from set successMsg "Status: Success" to set successMsg1 "Locked =".
Thats because when you made with the firs it does not have time to show the entire output of the command, so it doesn't show the disk mapping from the server and doesn't take the backup of the disk.

Also i comment the line time out line when it's doing the copy because i have some guest with 500G or plus and with this timeout the script show the failure message without finishing the other steps, but it continue copying the files.

one last question, maybe you can help me. I have now to dettach the new NFS repository so i can move the backup to another location, is i delete the virtual server i will be deleting the vm.cfg fila also and i don't want it.
What can i do to dettach the repository without lossing any data of virtual machines?
Thanks a lot for your help

Posted by josseossa on September 17, 2014 at 07:18 PM CEST #

Hi Josseoss,

thank you for your feedback, I'm going to prepare the version "0.2" of the script, also with your help.
About the question of the repository, I suggest you to:

- move the virtual-machine "CLONE" to "Unassigned Virtual Machines"
- unpresent the NFS repository from your pool
- present the NFS repository to the further pool and refresh it
- start the cloned guest

Keep in mind that an NFS repository can be mounted from more pools at the same time.
Let me know if everything is clear.
Thank you.

Simon

Posted by Simon on September 18, 2014 at 12:22 PM CEST #

can this solution ever support an incremental or differential backup?

Posted by guest on October 07, 2014 at 10:02 PM CEST #

Hi "guest",

actually this solution is not able to support incremental or differential backup.
If you need it, you can think to have more than one local hot-clone ( on ocfs2 filesystem ) and move only one of them on the NFS repository ( weekly ).
All simple-hot-clones taken on an ocfs2 repository are differential.
Hope this helps.
Ciao

Simon

Posted by Simon on October 09, 2014 at 01:41 AM CEST #

Hi,

There is a way to create a custom VMCloneCustomizer and use it?

Because I've create a new respository for the disks in another storage, the vm File are copied in that repo but the virtual disk does not, there are copied in the same repo that the original files were located.

Regards.

Posted by Marco Cano on November 18, 2014 at 02:28 PM CET #

Hi Marco,

please, see the new version (0.4) of the script at the following link:

https://blogs.oracle.com/scoter/entry/oracle_vm_3_3_12

and let me know if you need further help.

Simon

Posted by Simon on November 18, 2014 at 03:13 PM CET #

Hi,

I'm trying to implement the script, but when I run it, generates the vm files in the repo that I put as paraneter (e.g. repo2), but the virtual disk aré copied in the same repo of the vm (repo1) and I want the clone virtual disk sin repo2.

Regards.

Marco Cano

Posted by guest on November 18, 2014 at 03:42 PM CET #

Simon!

The 0.4 version works great!

Regards.

Marco Cano

Posted by guest on November 18, 2014 at 04:05 PM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Simon Coter is a Principal Product Manager for Oracle VM and VirtualBox. He worked on projects covering more Oracle products such as Oracle Database, eBusiness Suite, Oracle VM, Oracle Linux, Oracle ExaData and much more.

Search

Categories
Archives
« August 2015
SunMonTueWedThuFriSat
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
     
Today