Migrate Oracle VM from one ODA to another

Oracle Database Appliance is a great invention of Oracle. Yes, there are many things which can be improved but many things got much easier than in standard environments.

Well, moving virtual machines from one ODA to another is one of the things which should be made easier. But until then just follow this guide.

Preparation on old ODA

Log into ODA_BASE, execute the following statements:

[root@db20 ~]# oakcli show vm

  NAME                                  NODENUM         MEMORY          VCPU            STATE           REPOSITORY

prod_web_01                             0               2048               3            ONLINE          shoprepo01
prod_web_02                             0               2048               3            ONLINE          shoprepo01
[...]

The following command will show all details about the vm which I’m going to migrate.

[root@db20 ~]# oakcli show vm prod_web_01
Resource: prod_web_01
  AutoStart       :       restore
  CPUPriority     :       100
  Disks           :       |file:/OVS/Repositories/shoprepo01/
                          .ACFS/snaps/prod_web_01/VirtualMach
                          ines/prod_web_01/ab682e55253442d082
                          cfe5415e952216.img,xvda,w||,xvdb:/O
                          VS/Repositories/shoprepo01/.ACFS/sn
                          aps/prod_web_01/VirtualMachines/pro
                          d_web_01/cdrom,r|
  Domain          :       XEN_PVM
  ExpectedState   :       online
  FailOver        :       false
  IsSharedRepo    :       true
  Keyboard        :       en-us
  MaxMemory       :       2048
  MaxVcpu         :       2
  Memory          :       2048
  Mouse           :       OS_DEFAULT
  Name            :       prod_web_01
  Networks        :       ['bridge=net2']
  NodeNumStart    :       0
  OS              :       OL_5
  PrefNodeNum     :       0
  PrivateIP       :       None
  ProcessorCap    :       100
  RepoName        :       shoprepo01
  Source          :       0
  State           :       Online
  TemplateName    :       otml_ol6tmp
  VDisks          :       |0|
  Vcpu            :       3
  cpupool         :       default-unpinned-pool
  vncport         :       5905

Shutdown the vm:

[root@db20 ~]# oakcli stop vm prod_web_01

Stopped VM : prod_web_01

Make sure the vm stopped. This may take a while. In case you run a windows vm you may have to shut down the guest manually. In this case the guest is an ol6 server which can process the halt signal from the hypervisor.

[root@db20 ~]# oakcli show vm

  NAME                                  NODENUM         MEMORY          VCPU            STATE           REPOSITORY

prod_web_01                             0               2048               3            OFFLINE         shoprepo01
[...]

Login to dom0 of one of the nodes of the source ODA and cd to the disk’s location (marked bold above).

[root@oda2-node0 prod_web_01]# pwd
/OVS/Repositories/shoprepo01/.ACFS/snaps/prod_web_01/VirtualMachines/prod_web_01
[root@oda2-node0 prod_web_01]# ll -h
total 26G
-rw------- 1 root root 26G Jan 27 2017 ab682e55253442d082cfe5415e952216.img
-rw-r--r-- 1 root root 427 Jan 2 12:41 vm.cfg
-rw-r--r-- 1 root root 515 Sep 2 13:20 vm.cfg.bak

Archive (tar) and copy all files (except sub directories) to the new ODA dom0. I used the following command to accomplish this task:

[root@oda2-node0 prod_web_01]# tar cvzf - *.img *.cfg | ssh root@oda1-node0 "cat > /OVS/prod_web_01.tar.gz"

This step will take a while. The architecture of ODA in virtualized configuration is not very I/O optimized. This was improved in ODA X6-2. But that’s another story.

Preparation on new ODA

Login to oda_base of the destination ODA.

First of all we create a new repository if necessary:

[root@db19 ~]# oakcli create repo shoprepo01 -size 512G -dg DATA

Created Shared Repo : shoprepo01

[root@db19 ~]# oakcli show repo

NAME                          TYPE            NODENUM  FREE SPACE     STATE

odarepo1                      local           0               N/A     N/A
odarepo2                      local           1               N/A     N/A
shoprepo01                    shared          0             99.77%    ONLINE
shoprepo01                    shared          1             99.77%    ONLINE

This will also create a new acfs mount point as you can see with the df tool.

[root@db19 ~]# df -h
Filesystem             Size Used Avail Use% Mounted on
[...]
/dev/asm/shoprepo01-58 512G 1.2G 511G  1%   /u01/app/sharedrepo/shoprepo01

Create cloned VM

Let’s import the vm we just transferred as a new template.

[root@db19 ~]# oakcli import vmtemplate prod_web -files /OVS/prod_web_01.tar.gz -repo shoprepo01 -node 0

Imported VM Template

Now we are ready to clone our new vm from the template:

[root@db19 ~]# oakcli clone vm prod_web_03 -vmtemplate prod_web -repo shoprepo01 -node 1

Cloned VM : prod_web_03

Here are some checks before we start the vm:

[root@db19 ~]# oakcli show vm

  NAME                                  NODENUM         MEMORY          VCPU            STATE           REPOSITORY

prod_web_03                             0               2048               3            OFFLINE         shoprepo01    

[root@db19 ~]# oakcli show vm prod_web_03
Resource: prod_web_03
  AutoStart       :       restore
  CPUPriority     :       100
  Disks           :       |file:/OVS/Repositories/shoprepo01/
                          .ACFS/snaps/prod_web_03/VirtualMach
                          ines/prod_web_03/ab682e55253442d082
                          cfe5415e952216.img,xvda,w|
  Domain          :       XEN_PVM
  ExpectedState   :       offline
  FailOver        :       false
  IsSharedRepo    :       true
  Keyboard        :       en-us
  MaxMemory       :       2048
  MaxVcpu         :       3
  Memory          :       2048
  Mouse           :       OS_DEFAULT
  Name            :       prod_web_03
  Networks        :       |bridge=net2|
  NodeNumStart    :       0
  OS              :       OL_5
  PrefNodeNum     :       0
  PrivateIP       :       None
  ProcessorCap    :       100
  RepoName        :       shoprepo01
  Source          :       0
  State           :       Offline
  TemplateName    :       otml_prod_web
  VDisks          :       |0|
  Vcpu            :       3
  cpupool         :       default-unpinned-pool
  vncport         :       None

Start the VM:

[root@db19 ~]# oakcli start vm prod_web_03

Started VM : prod_web_03 on Node Number : 0

[root@db19 ~]# oakcli show vm

  NAME                                  NODENUM         MEMORY          VCPU            STATE           REPOSITORY

prod_web_03                             0               2048               3            ONLINE          shoprepo01    

That’s IT

One thought on “Migrate Oracle VM from one ODA to another

Add yours

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: