Block Storage and Compute
Best practice is to store data on a separate block storage device / instance to the boot volume that stores a virtual image’s configurations, applications, and libraries.
Steps
Create a data block volume
Go to block volume create page
Make sure it’s in the same Availability Domain
I made this 1 TB because it’s a complex process to resize storage after it’s mounted – but be aware you will be charged for the whole allocated block volume, whether you use it or not.
Provisioned too quickly for me to get a screen shot of in-progress
Mount the Block Volume
Now we need to mount it onto the virtual machine we have been working with
Navigate to the compute instance on the OCI dashboard and then scroll down on the instance details
You can see there are no block volumes currently attached
So, we attach the block volume we just created to the compute image
Some things to note:
-
You don’t have to specify a device path, but life is easier if you do.
-
We recommend choosing ISCSI as an attachment type rather than leaving it as paravirtualized.
-
CHAP credentials do add security, but they also add complexity. Unless you have PII or PHI on the volume you can leave them off
Success message
Now click on the three dots to the extreme right of the attached volume listing
Select the ISCSI commands and information option and you will get this screen
Copy each of the commands (line by line is better) and execute
Fdisk -l will show the new drive mounted
Format the Newly Mounted Volume
Next, we need to format the volume. I chose xfs as the filesystem, but you could also choose ext4 or another fs if you prefer.
Finally Create a Mount Point
Now we need to create a mount point and mount the partition to it
Success!
Now we have a place to house our data separate from the OS and applications