Practical Demo on OCI Core Services | Compute Instance | Block Volume | Object Storage | Part 2

Practical Demo on OCI Core Services | Compute Instance | Block Volume | Object Storage | Part 2

Block Volume Service: Create and Attach

OCI Block Volume service lets you dynamically provision and manage block storage volumes. You can create, attach, connect and move volumes as needed to meet your storage and application requirements. Once attached and connected to an instance, you can use a volume like a regular hard drive. Volumes can also be disconnected and attached to another instance without the loss of data.

Step 1: Creating a Block Volume

The common usage of block volume is to add storage capacity to an Oracle Cloud Infrastructure instance. Once you have launched an instance and set up your cloud network, you can create a block storage volume through the Console or API. Once created, the volume can be attached to an instance using a volume attachment. Once the volume is attached, you connect to the volume from your instance's guest OS using iSCSI or paravirtualized mode. The volume can then be mounted and used by your instance.

  1. Click the Navigation Menu in the upper left. Navigate to Storage, and click Block Storage.

2. In Block Volume service, click Create Block Volume and provide the following details:

  • Name: BV-DEMO
  • Compartment: Demo
  • Availability Domain: It must be the same as the AD you chose for your instance
  • Size: Please choose 50 GB
  • Backup Policy: Gold

Note: Size must be between 50 GB and 32 TB. You can choose in 1 GB increments within this range. The default is 1024 GB

3. Leave the encryption and tags options as their default values and click Create Block Volume. The volume will be ready to attach once its icon no longer lists it as PROVISIONING in the volume list.

PROVISIONING
AVAILABLE

Short brief about the backup policy:

  • Bronze Policy: The bronze policy includes monthly incremental backups, run on the first day of the month. These backups are retained for twelve months. This policy also includes a full backup, run yearly on January 1st. Full backups are retained for five years.
  • Silver Policy: The silver policy includes weekly incremental backups that run on Sunday. These backups are retained for four weeks. This policy also includes monthly incremental backups, run on the first day of the month and are retained for twelve months. Also includes a full backup, run yearly on January 1st. Full backups are retained for five years.
  • Gold Policy: The gold policy includes daily incremental backups. These backups are retained for seven days. This policy also includes weekly incremental backups that run on Sunday and are retained for four weeks. Also includes monthly incremental backups, run on the first day of the month, retained for twelve months, and a full backup, run yearly on January 1st. Full backups are retained for five years.


Step 2: Attach a Block Volume to an Instance

  1. Once the Block Volume is created, you can attach it to the VM instance you just launched on Compute Practice. When you attach a block volume to a VM instance, you have two options for attachment type, iSCSI or paravirtualized.

  • iSCSI: iSCSI attachments are the only option when connecting block volumes to bare metal instances. Once the volume is attached, you need to log in to the instance and use the iscsiadm command-line tool to configure the iSCSI connection
  • Paravirtualized: Paravirtualized attachments are now an option when attaching volumes to VM instances. For VM instances launched from Oracle-Provided Images, you can select this option for Linux-based images published. It is ready to use once you attach a volume using the paravirtualized attachment type. You don't need to run any more commands. However, due to the overhead of virtualization, this reduces the maximum IOPS performance for larger block volumes. See Paravirtualized Attachment Performance for more information.

2. Go to the Compute Instances Menu, and navigate to the VM instance you created before. Click Attached block volumes.

3. Click Attach block volume.

4. Click Select volume and choose the following options:

  • Volume: Select the volume created
  • Device Path: Select /dev/oracleoci/oraclevdb
  • Attachment mode: Paravirtualized
  • Click Attach

5. Once the volume is attached, you can click on the ellipsis and then click Paravirtualize commands and information.

6. Connect to the instance using Cloud shell using your private key and do the following-

[opc@dbamamun-instance ~]$ sudo su - root
Last failed login: Wed Aug 28 19:13:35 GMT 2024 on pts/0
There was 1 failed login attempt since the last successful login.
[root@dbamamun-instance ~]# 
[root@dbamamun-instance ~]# 
[root@dbamamun-instance ~]# 
[root@dbamamun-instance ~]# fdisk -l
GPT PMBR size mismatch (97727283 != 97728511) will be corrected by write.
The backup GPT table is not on the end of the device. This problem will be corrected by write.
Disk /dev/sda: 46.6 GiB, 50036998144 bytes, 97728512 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes
Disklabel type: gpt
Disk identifier: A8EDFC93-F340-4EA1-A0FF-A579088864BF

Device       Start      End  Sectors  Size Type
/dev/sda1     2048   206847   204800  100M EFI System
/dev/sda2   206848  2303999  2097152    1G Linux filesystem
/dev/sda3  2304000 97726463 95422464 45.5G Linux LVM


Disk /dev/mapper/ocivolume-root: 35.5 GiB, 38117834752 bytes, 74448896 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes


Disk /dev/mapper/ocivolume-oled: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes


Disk /dev/sdb: 50 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes
[root@dbamamun-instance ~]# 
[root@dbamamun-instance ~]# 
[root@dbamamun-instance ~]# 
[root@dbamamun-instance ~]# df -hT
Filesystem                 Type      Size  Used Avail Use% Mounted on
devtmpfs                   devtmpfs  7.7G     0  7.7G   0% /dev
tmpfs                      tmpfs     7.7G     0  7.7G   0% /dev/shm
tmpfs                      tmpfs     7.7G  8.7M  7.7G   1% /run
tmpfs                      tmpfs     7.7G     0  7.7G   0% /sys/fs/cgroup
/dev/mapper/ocivolume-root xfs        36G  9.7G   26G  28% /
/dev/mapper/ocivolume-oled xfs        10G  134M  9.9G   2% /var/oled
/dev/sda2                  xfs      1014M  360M  655M  36% /boot
/dev/sda1                  vfat      100M  6.0M   94M   6% /boot/efi
tmpfs                      tmpfs     1.6G     0  1.6G   0% /run/user/986
tmpfs                      tmpfs     1.6G     0  1.6G   0% /run/user/1000
[root@dbamamun-instance ~]# 
[root@dbamamun-instance ~]# 
[root@dbamamun-instance ~]# 
[root@dbamamun-instance ~]# mkfs -t xfs /dev/oracleoci/oraclevdb
meta-data=/dev/oracleoci/oraclevdb isize=512    agcount=4, agsize=3276800 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1    bigtime=0 inobtcount=0
data     =                       bsize=4096   blocks=13107200, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=25600, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
Discarding blocks...Done.
[root@dbamamun-instance ~]# 
[root@dbamamun-instance ~]# mkdir /u01
[root@dbamamun-instance ~]# 
[root@dbamamun-instance ~]# mount /dev/oracleoci/oraclevdb /u01
[root@dbamamun-instance ~]# 
[root@dbamamun-instance ~]# df -hT
Filesystem                 Type      Size  Used Avail Use% Mounted on
devtmpfs                   devtmpfs  7.7G     0  7.7G   0% /dev
tmpfs                      tmpfs     7.7G     0  7.7G   0% /dev/shm
tmpfs                      tmpfs     7.7G  8.7M  7.7G   1% /run
tmpfs                      tmpfs     7.7G     0  7.7G   0% /sys/fs/cgroup
/dev/mapper/ocivolume-root xfs        36G  9.7G   26G  28% /
/dev/mapper/ocivolume-oled xfs        10G  134M  9.9G   2% /var/oled
/dev/sda2                  xfs      1014M  360M  655M  36% /boot
/dev/sda1                  vfat      100M  6.0M   94M   6% /boot/efi
tmpfs                      tmpfs     1.6G     0  1.6G   0% /run/user/986
tmpfs                      tmpfs     1.6G     0  1.6G   0% /run/user/1000
/dev/sdb                   xfs        50G  389M   50G   1% /u01
[root@dbamamun-instance ~]# 
        
Note: When mounting a storage volume for the first time, you can format the storage volume and create a single, primary partition that occupies the entire volume by using fdisk command (Caution: Using fdisk to format the disk deletes any data on the disk).

Create an Object Storage Service

Oracle Cloud Infrastructure (OCI) Object Storage is a scalable, high-performance storage solution designed for secure and cost-effective data durability. It can handle unlimited unstructured data, from analytics to rich media like images and videos.

With easy-to-use management interfaces, you can safely store or retrieve data directly from the internet or within OCI. Being a regional service, Object Storage isn't tied to specific compute instances, allowing you to access your data from anywhere.

Object storage offerings:

  1. Use Standard for data to which you need fast, immediate, and frequent access. Data accessibility and performance justify a higher price point to store data in the Object Storage
  2. Use Archive for data to which you seldom or rarely access, but that must be retained and preserved for long periods of time. The cost efficiency of the Archive Storage tier offsets the long lead time required to access the data.

Step 1: Create an Object Storage Bucket

  1. Click the Navigation Menu in the upper left, navigate to Storage, and select Buckets

2. Select the compartment that you want to create your bucket in. Click Create Bucket.

3. Fill out the dialog box:

  • Bucket Name: Provide a name
  • Default Storage Tier: Standard

4. Click Create

Step 2: Upload Object and Create Pre-Authenticated Link

  1. Create a word file with some sample data. This file you will upload to the object storage.
  2. Switch to OCI window and click the Bucket Name.

3. Bucket detail window should be visible. Click Upload.

4. Click select files and select the sample-file.txt you just downloaded. Click Upload in the Dialog box, then click Close.

5. Click select files and select the sample-file.txt you just downloaded. Click Upload in the Dialog box, then click Close.

6. Fill out the dialog box:

  • Name: Use an easy-to-remember name
  • Pre-Authenticated Request Target: Object
  • Access Type: Permit object reads
  • Expiration: Specify link expiration date

7. Click Create Pre-Authenticated Request.

8. Click Copy to copy the link.

Note: The link must be copied and saved once the window is closed. The link cannot be retrieved again.

9. Click Close.

10. Open a new browser window and paste the Pre-Authenticated link.

You can see the file is downloaded... :)

Mentions:

Oracle Cloud Computing Oracle Cloud Amazon Web Services (AWS) Microsoft Azure Google Cloud

要查看或添加评论,请登录

Al Mamun的更多文章

社区洞察

其他会员也浏览了