Skip to main content

Relocating Compute Instances

· 4 min read
Adrian Png
Director of Innovation, AI and Cloud Solutions @ Insum, a Talan Company

Moving a House, New Zealand Style

To everyone following my 30 Days on the Oracle Cloud experience, I apologise that I was not able to keep up with the series previously, due to work commitments. I have enrolled in yet another trial, so I am hoping to continue where I left off and share my thirty day adventure with an Oracle Cloud trial. I'm on Day 14 now, and for this post, I'll examine an important issue that many of us face, even in our personal life - moving houses!

Suppose I had a compute instance running Oracle Application Express (APEX) to perform some proof of concept tasks and now I am ready to move it from my Oracle Cloud tenancy to a client's. There are several recipes for achieving this goal. I could for example, use the Oracle Database's backup and recovery, or data migration tools, but is there a simpler approach? What if I could clone the server and then ship it over to be deployed on my client's tenancy?

This is definitely possible and I will walk you through a simple procedure to perform this migration exercise.

Create and Export a Custom Image

First, on the source tenant, create a custom image of the compute instance and then prepare the image for export.

  1. Click Compute Instances.
  2. Place the mouse cursor over the and then click "Create Custom Image". WARNING: this will initiate a system shutdown on the target instance! Initiate custom image creation. IMPORTANT: Instance will shutdown!
  3. Select the target compartment, enter a name and then click "Create Custom Image". Specify name and target compartment
  4. While waiting for the process to be completed, if a new Object Storage Bucket needs to be created, click Object Storage Object Storage. Create an Object Storage Bucket if necessary
  5. Enter a Bucket Name, select Standard Storage Tier, use Oracle-managed keys and then click "Create Bucket".
  6. Click Compute Custom Images. The status should show green and "Available" when the custom image is ready. At this point, the compute instance would have powered back on automatically. Custom Image ready
  7. Place the mouse cursor over the next to the newly created custom image and then click "Export Custom Image".
  8. Select Object Storage Bucket, the Bucket compartment and name, and then enter a new Object Name. Click "Export Image" when you are ready to proceed. Export Image to Object Storage Bucket
  9. Exporting the image takes a while to complete. click Object Storage Object Storage and then select the bucket that the image was written to. When it is completed, the object will appear in the Objects table.
  10. Place the mouse cursor over the next to the newly created object and click "Create Pre-Authenticated Request". Generate a Pre-Authenticated Request
  11. Enter the name of the request, select Object for the request target, Permit Read on the Object for Access Type and then specify an expiration date. Click "Create Pre-Authenticated Request" when done. Enter Pre-Authenticated Request details
  12. The next dialog presented contains the Pre-Authenticated Request URL. Copy the link in full. It will be required for the import process. Copy the Pre-Authenticated Request URL

Import the Image and Create Compute Instance

Next, on the target tenant, create a new compute instance using the imported custom image.

  1. Click Compute Custom Images.
  2. Click "Import Image" and enter the following information and then click "Import Image". Import the custom image
    • Compartment to create a new custom image in.
    • Name of the new custom image.
    • Operating System, in this case, Linux.
    • The Object Storage Pre-Authenticated Request URL obtained earlier.
    • Select OCI for Image Type.
  3. Importing the image again takes a long time to finish. When it's done, the fastest path to create the instance is to click "Create Instance". Custom image import details showing progress
  4. From here, creating the instance is the same as previously described. Create the compute instance from imported custom image

Summary

This looks like a lengthy process, but it's really simple to move your compute instances from one tenant to another. This might come in handy, especially when you've put in quite a bit of effort creating your compute instances during a trial. I'm just saying! .

Photo Credits

Photo by theyounz License: CC BY-ND 2.0