Hello, and welcome to this demonstration on creating and using block volume storage in
Oracle Cloud Infrastructure.
In this video we will look at creating an iSCSI block volume, attaching it to, and then
detaching it from, an Oracle Linux instance using the web console and iSCSI ADM commands.
And finally taking use of the OCI Utilities to automatically connect and disconnect the
volume on the Oracle Linux instance.
We are currently looking at the Block Volumes list in the Oracle Cloud Infrastructure web
console.
When provisioning and attaching block volumes in the web console it is also necessary to
make the connection locally on the instance, so we also have terminal open using SSH to
the instance.
So lets start by first creating a new iSCSI block volume.
To create a block volume we click on Create Block Volume.
In the dialog we give the new volume the name mor-demo-bv80.
The compartment is correct for us so we leave it as it is.
The instance we will attach the volume to is in the AD3 domain, so we click on the drop
down and select the domain US-ASHBURN-AD-3.
If we use a domain different to the one for the instance, then the volume will not be
displayed as available when we attempt to select it to be attached.
Volume sizes can be between 50 gigabytes and 32 terabytes, with a default selection of
1 terabyte.
We will use a volume size of 80 gigabytes.
The Block Volume service uses elastic performance to allow you to dynamically change the volume
performance.
This enables you to pay for the performance characteristics you require independently
from the size of the block volume.
You can purchase more VPUs, or volume performance units, to modify the resources allocated to
a volume, increasing IOPS per GB and throughput per GB.
You can also purchase fewer VPUs, which reduces the performance characteristics for a volume,
however this can provide cost savings.
To get more information about the performance setting use this link to the documentation.
We will leave the setting at the default of Balanced, as it provides a good balance between
performance and cost savings for most workloads.
For the backup policy we will select the Oracle defined Bronze policy.
These Oracle policies are predefined for setting backup frequency and retention, and cannot
be modified.
It is also possible to to create custom user defined backup policies and schedules.
We will leave the default encryption setting, and also the checkbox to bring us to the volume
details page after we start the volume provisioning process.
We click Create Block Volume.
You can find more information on Block volumes at this documentation page.
We are brought to the block volume details page, and can see the provisioning status
with the coloured indicator.
The status changes to green when the volume becomes available for use.
To attach it to our instance we navigate the menu, selecting Compute, and Instances.
We click on the instance name mor-demoinst-10.
On the instance details page we scroll down and under resources, select Attached Block
Volumes.
Currently there are no attached volumes to this instance.
To attach our volume we click on Attach Block Volume.
We select iSCSI as the attachment type.
As the volume was originally created in the same compartment and domain, when we click
on the Volume drop down we can see and select our volume, mor-demo-bv80.
Note in the dropdown that there is also a section to list boot volumes.
It is also possible to attach a boot volume to an instance as a block volume.
If supported by our instance, and we wanted to define a specific consistent device path
to be used which will remain the same between reboots, we could select it from this dropdown,
but for this demonstration it is not important, so we will leave it blank.
We leave the Access as Read/Write and click Attach.
An information dialog reminds us that for the iSCSI block volume we must also use iSCSI
ADM commands to make the connection on the instance locally.
Or as we will see later, OCI Utilities can make the connection for us automatically.
We click Close to continue.
We can see our volume is being attached to the instance.
This takes a few minutes.
Once attached we need to also connect it locally using the iSCSI ADM commands.
Beside the volume name we click the three dots menu, and select iSCSI Commands and Information.
This dialog provides us with the information we may need to attach and detach an iSCSI
block volume from our Oracle Linux instance.
Whether we are connecting or disconnecting the volume, we simply copy the commands from
the dialog sections and paste them into the instance terminal.
As we are going to connect the volume, we click the Copy link beside the Commands for
connecting section to copy the commands to the clipboard.
We close the dialog.
We open our terminal window to our instance.
Running the command ls -l /dev/oracleoci, we see any Oracle Cloud Infrastructure boot
and block volumes connected to the instance.
We can see the boot device listed as /sda and its partitions, and its continuous device
path oraclevda.
But there is no listing for our new block volume yet.
And if we run the command fdisk -l, we also see no listing for our new block volume.
To connect the new block volume using the iSCSI ADM commands, we paste the commands
from our clipboard and press Return.
Clearing the screen to create some space, we run the command ls -l /dev/oracleoci.
We now see the device /sdb.
Note that there is no separate consistent device path created for the block volume because
in the attach dialog as we did not ask for one.
For example, here we can see that if we had asked for the device path oraclevdb, then
it would be listed in the directory, and can be used for partitioning, mounting, etc.
And if we run the command fdisk -l, we also see the device available to partition.
For this demonstration we are not going to go through the partitioning, make file system
and mounting process.
You can find out about that topic and more in other videos available for Oracle Linux
at this link.
Returning to our web console, we will look at detaching the volume from our instance.
Block volumes can be detached from an instance and attached to a different instance easily,
all while the instance is running.
But note that if you detach a boot volume from an instance, you must first shutdown
the instance.
So to detach this block volume we click on the three dots menu, and select Detach.
A confirmation dialog reminds us that we must also disconnect the volume from the instance
locally, and provides the commands required for this.
We click on the Copy link beside the Commands for disconnecting section to copy them to
our clipboard.
As we have not disconnected yet, we leave this dialog open and return to our terminal
window.
We paste in the commands and press Return.
Running the command fdisk -l, we see the volume device /sdb is not listed anymore confirming
it has been disconnected.
Returning to our web console, and the Detach Block Volume dialog, we now click on Continue
Detachment.
A second confirmation dialog asks us to confirm again for safety, we click Ok.
We see the volume being detached, and it disappears from the instance attached block volume list.
Now lets look at having the local connection of the block volume to the instance done automatically
for us using the OCI Utilities.
There is a package of OCU Utilities which is included by default in the standard Oracle
Linux 7 and 8 images available through the Oracle Cloud Infrastructure catalog.
A daemon service loaded by the package performs the automatic connection and disconnection
of iSCSI block volumes on the instance after attachments and detachments are done in the
web console.
Once the daemon is started and running on instance this operation removes the need to
run the iSCSI ADM commands on the instance.
Lets have a look at it working.
We open our terminal window to our instance, the OCI Utility daemon has been started.
You can find out more about how to install, enable and use the OCI Utilities by looking
for this video.
Running the command systemctl status ocid, we see the service is running.
Clearing the screen and running the command fdisk -l, we see there is only the boot volume
listed.
We return to our web console to attach our volume again to the instance.
Clicking on Attach Boot Volume opens the Attach dialog again.
We select iSCSI for the attachment type, and select the name of our volume from the Volume
dropdown.
We keep the rest default as before and click Attach.
The dialog reminds us that we need to run iSCSI ADM commands to connect it locally,
but as the OCI Utilities package daemon is running, we will not need to do this.
We click Close.
We wait for the volume to finish attaching.
Returning to our terminal window, we run the command fdisk -l.
We now see the attached volume listed as /sdb and available to partition.
This shows the OCI Utilities daemon automatically discovered and connected the volume for us,
removing the need for us to run the iSCSI ADM commands.
Returning to the web console, we click on the three dots menu, and select Detach.
The dialog reminds us to use the iSCSI ADM commands to disconnect, but again, the OCI
utilities daemon will be taking care of this, so we can simply click on Continue Detachment.
And click Ok in the second confirmation window.
We wait for the detaching to complete.
Back on our terminal, we run the clear command to make some space, and then the fdisk -l
command again.
And now we see the block volume has been automatically disconnected.
Oracle provides an extensive number of resources which you can use to learn about this subject
and others.
Use the links here to find out more content about this video, as well as Oracle Linux
and using Linux on Oracle Cloud Infrastructure.
Thats the end of the video.
Thanks for watching.