How to Backup an Instance and Restore on Oracle Cloud Infrastructure


I would like to backup the boot volume of an instance to Object Storage and be able to restore the backed up image. Here are the steps.

I am going to ssh into the instance that I provisioned and create a file under my home directory.

So I have test.txt under my home directory. And then, I am going to backup the boot volume in Object Storage.

If you click Boot Volume link, it takes you to the link.

And if you click the link, you get to see the following options.

Now, click on Boot Volume Backups link. Now you can create a Boot Volume Backup as you can see in the image below.

Once you click Create Boot Volume Backup button, you can create a backup like the below. Click on Create Boot Volume Backup blue button to start the process

Once backup is complete, you should see it’s available now.

Just to be able to check if the boot volume has been restored, I am adding another line in test.txt. When I restore the volume, the second line should be gone.

I’m going to run the following commands after the backup. I should be able to run those commands again to update the OS after restoring the boot volume.

sudo apt update && sudo apt upgrade


If you navigate to Menu-> Storage -> Block Storage -> Boot Volume Backups, you should see the list of boot volume backup. Now click on the target backup.

Click on the target backup and then click Restore Boot Volume button.

Now if you navigate to Menu -> Storage -> Block Storage -> Boot Volumes, you can see the one you just restored.

Once the boot volume is restored, attach it to the instance you already have. But first, you have to stop the instance and detach the boot volume.

If you go to the boot volume section of the instance details, you can detach the boot volume.

Well, I am not seeing the action item to attach restored boot volume in the menu. So I am restoring to OCI CLI to see if it works.

The following command may just work for me.

oci compute boot-volume-attachment attach --boot-volume-id [text] --instance-id [text]

It looks easy enough. Well, but it didn’t work.

    "code": "Conflict",
    "message": "Boot volume ocid1.bootvolume.oc1.iad.abuwcljro5zeuegg7i2ms7xoaxgeft5mpef3ucykogfehtjhjde3zy676ddq cannot be attached to instance ocid1.instance.oc1.iad.anuwcljroksebviczqhtrjxzsu2d7angpz3bnpnl5z5gko27spvqlacxvicq. It can only be attached to its parent instance.",
    "opc-request-id": "98ECF81CD426418EB99DBB929733865A/38C80819B5A2267CEF1E0F89086F26D6/164678769EA39E4C60B724840D7F9F87",
    "status": 409

I googled it but could not figure out why. I will look into the issue when I have some time. Now my only option is to create a new instance out of the restored boot volume.

If you navigate to the restored boot volume, you can create a new instance.

Now that I was able to create an instance out of the restored boot volume, I was able to get the text.txt file I created in my home directory. And the second line I created after backing up was not there.

In a sense, this experiment was successful but I still need to figure out why I was not able to attach the restored boot volume to the existing instance.

5 thoughts on “How to Backup an Instance and Restore on Oracle Cloud Infrastructure”

  1. “need to figure out why I was not able to attach the restored boot volume to the existing instance.”
    I am trying to find out too. It seems like it is fixed and tied to the 1st original boot volume.

    1. Hi, Kleber. Thanks for your comment!
      Yeah, that’s pretty much where I’m settled based on my research and trying. Logically though, we should be able to detach and attach boot volume just like SSD drive on a PC. I wonder if they are working on such a feature down the road…

Leave a Reply

Your email address will not be published.