Tuesday, March 19, 2019

How to add disk volume to AWS EC2 instance and format for ASM

This was a manual process.  No automation was used.

We made the new disks partitioned because all the other disks were that way.  Typically we don't do that in the data center or AWS, but we just wanted consistency in these servers.



1) EC2 Instances page

   - Display EC2 instance

   - Get region and zone, instance-id, and name of highest attached disk



2) EC2 Volumes page

   - Filter on Name of instance

   - Sort by attachment



3) Create Volume

     Volume Type: gp2

     Size (Gib):  2000

     Availability Zone:  (zone of EC2 instance)

     Snapshot ID:  (ignore)

     Encryption:  (select)

     Master Key:  (default) aws/ebs

     Add Tag:     Key: Name   Value: (name of EC2 instance)



Wait for volume to be created and appear in filtered list



4) Actions -> Attach Volume

     Instance:  (instance-id of EC2 instance)

     Device:    /dev/sdl   ( "L" was next available device in sequence)



Wait for volume to be attached



5) Logon to instance as root



     export LC_ALL=C

     lsblk



   Verify that new device is seen.

   The device attached as /dev/sdl will probably appear as /dev/xvdl.



   Create a partition map with 1 big partition



     parted /dev/xvdl mklabel msdos

     parted /dev/xvdl mkpart primary ext2 0% 100%



   Display the oracle devices.

   Determine the next device name in sequence.



     oracleasm listdisks



   In this case the in sequence was DATA005.

   Create oracle ASM disk DATA005 on partition 1 of device xvdl



     oracleasm createdisk DATA005 /dev/xvdl1

     oracleasm scandisks

     oracleasm listdisks

     oracleasm querydisk -p DATA005



Turn over disk to DBA team



6) EC2 Volumes page

     Copy all the other tags from one of the other volumes on the

       same EC2 instance to the new volume.

NOTE: Tags are necessary for chargeback and automatic backups.


No comments:

Post a Comment