Cross-tenancy compute VM migration on OCI

 

In this blog post I will show you how we can migrate OCI compute instance from one tenancy to another tenancy. Both tenancies should be in same region US East (Ashburn).





Pre-requisite:

1. We should have access on both tenancies.

2. Object storage bucket must exists in source Tenancy.

3. You must have predefined policies to restore the backups across tenancies.

Steps:

1. Stop the source VM and go to More actions and click on create custom image



2. Name the custom image and click create custom image



3. Now export the Image to storage bucket.

Once Custom Image created, Go to compute --> Custom Images and click on the newly created custom image --> click on Export


and provide bucket name, image name and format and click export Image


4. Create  Pre-Authenticated Request

Go to the bucket where we exported custom Image. Storage --> bucket -> click on bucket name

Here is resources --> Objects , we can see the Image.


Select the Image and click on 3 dots at the end  and click on Create Pre-Authenticated Request.


Name the PAR request , choose object, object name and access type to "Permit object reads" and create PAR Request.


5. Now copy the PAR URL which we have to use in Target tenancy.


6. Now login to Target Tenancy and go to compute --> custom Image and click import Image

Name the custom Image, choose "Import from an Object Storage URL"

and paste the URL copied in step 5.

Choose Image type = OCI and click on Import Image



7. Once Image imported, we can create compute instance using that Image.

Click on the imported Image --> click on create Instance


8. Fill all the details, name, shape, keys etc. and click create. It will take few minutes and instance will be up in Target tenancy.

So successfully moved our VM to new Tenancy.

Note: If you have attached block volume on source VM, you need to move that on target tenancy as well.

In my case, I created a new block volume in target tenancy with same size and attach to the compute instance and then mount it. Then copy the data from source mount point to target mount point using scp.

I will show you how we can mount the attached block volume on compute instance in my next blog post. 




No comments:

Post a Comment

How To Disable Automatic Database Backups Using DBAASCLI on ExaCC

  In this blog post I will show you how to disable Automatic database backups on ExaCC using dbaascli.