Hello, and welcome to this video demonstrating how to detach and attach boot volumes from
and to instances on Oracle Cloud Infrastructure.
In this video we will look at how to detach a boot volume from one instance and attach
it as a data volume to another instance, for the purpose of troubleshooting or repairing
the volume, and then reattaching it back to its original instance.
Boot volumes are configured when defining the initial instance parameters and are created
when the instance is launched.
To detach a boot volume from an instance, the instance must first be stopped.
This is not the same for block volumes, which can be attached and detached from running
instances.
When an instance is terminated, the boot volume can be detached and deleted, or it can be
de-associated with the terminating instance and kept in the cloud infrastructure.
This allows it to be used as a boot volume for another instance, or as a data volume
for an instance.
The boot volume is attached to another instance as a data volume in the same way as for a
block volume.
Opening the web console we are looking at our instance details.
In this demonstration, we are assuming there is a problem with its boot volume.
To fix this problem we will detach the boot volume from the instance, and attach it to
another instance as a data volume so we can repair it.
Then we will reattach the repaired volume back as a boot volume to the original instance.
Looking at the list of instances in our compartment, we see two instances, mor-demoinst40-ol7 and
mor-demoinst-10.
In this demonstration we will assume the boot volume of the first instance is faulty and
we will detach it and then attach it to the second instance as a data volume, so we can
repair it.
Clicking on the first instances, we see its details.
Scrolling down, under Resources, we click on Boot Volume and see the attached boot volume
for this instance.
To detach it, we click on the three dots menu beside our boot volume name.
We see the Detach Boot Volume option listed in a warning colour of red.
If we attempt to use this option now we will be presented with a warning message informing
us that the instance must be stopped before it can be detached.
To stop the instance, we scroll up and click on the Stop button.
We are presented with a confirmation dialog asking us to confirm we want to stop the instance.
The instance will be gracefully stopped, taking up to 15 minutes to allow applications to
be shutdown.
If there are issues with shutting down applications, it is recommended to manually shut down the
operating system locally before stopping it through the web console.
There is also a checkbox to allow immediately forcing the powering off the instance, we
do not need this, so we will leave it unchecked.
If you want read more about the process of stopping an instance, you can go to the documentation
for more details at this link here.
We click on the Stop Instance button to stop the instance.
We are returned to the instance details and the coloured indicator shows us the instance
is stopping, this will take just a short time.
When we see the instance is Stopped, we scroll down to our listed boot volume again.
Clicking on the three dots menu we now select Detach Boot Volume, and are presented with
a confirmation dialog.
We click Detach Boot Volume to confirm.
Scrolling up we click on Instances in the breadcrumbs menu to go back to our list of
instances.
We can see the instance listed as Stopped.
To attach the boot volume as a data volume to the second instance, we click on the instance
name.
On the instance details, we scroll down and under Resources we click Attached Block Volumes.
To attach our boot volume we click on Attach Block Volume.
We select to attach it as an iSCSI attachment.
In the Volume section, we are already presented with the correct compartment, so we click
on the drop down and select the name of our boot volume.
If you want to find out more about this dialog and attaching block volumes to instances look
for other videos which are available covering this subject.
We click Attach.
A reminder is given about required iSCSI commands or OS tools that will be needed to complete
the local attachment of this volume to the instance.
Our instance is running the OCI Utilities package and daemon, so this is automatically
taken care of for us.
If you want to know more about the OCI Utilities package for managing block volumes on instance
check out this video which is available.
We click Close to close the dialog.
Back at our list of attached block volumes we see the boot volume status is Attaching,
and then changing to Attached.
At this point we can log into our operating system on the instance and carry out the needed
troubleshooting repairs to fix the boot volume.
This troubleshooting and repair is not part of this video, so we will skip to when it
is repaired and ready to be reattached to it original instance again.
To do this we detach it from this instance by selecting the three dots menu beside the
boot volume name.
We select Detach.
We get a confirmation about iSCSI commands or OS Tools that should be used to locally
detach it on the instance.
As its done for us automatically, we click Continue Detachment.
For safety we get a second confirmation, we click OK.
We can see the detachment progress, and when it completes the boot volume disappears as
its not associated with the instance anymore.
To reattach the boot volume back to its original instance, we scroll up, and from the breadcrumbs
menu, we select Instances.
Still in its Stopped state, we click on the original instance name.
We scroll down to the Resources section, and select Boot Volume.
The boot volume is still listed as before, but is marked as Detached.
To attach it, we click on the three dots menu beside it and then Attach Boot Volume.
We are presented with confirmation dialog, and we click Attach Boot volume.
Back at our Boot Volume list we can see its status changed to Attaching.
When it changes to Attached, we can now start the instance again.
Scrolling up, we select the Start button.
The coloured status indicator changes to show Starting, and once complete changes to Running.
We can now log into the running instance again with its repaired boot volume.
Oracle provides an extensive number of resources which you can use to learn more about this
subject and others.
Use the links here to find more content about this video, as well as Oracle Linux and using
Linux on Oracle Cloud Infrastructure.
Thats the end of this video.
Thanks for watching.