oraclebase / vagrant

Vagrant Builds
https://oracle-base.com/
GNU General Public License v3.0
194 stars 170 forks source link

how to add disk #26

Closed AJKGitHub21 closed 3 years ago

AJKGitHub21 commented 3 years ago

Hello Tim,

I want to create new diskgroup and I guess it needs to be done via scripts instead of directly from VBOX as it reads "vagrantfile" when we bringup the machine. can you please share some steps to do that.

Thanks Ajay

oraclebase commented 3 years ago

I assume you are talking about RAC. In this example I'm assuming the disk group is called NEWDG.

1) In the config/vagrant.yml file, add another disk definition. Example.

asm_newdg_disk_1: /u05/VirtualBox/shared/ol8_19_rac/asm_newdg_disk_1.vdi asm_newdg_disk_size: 20

2) In the Vagrantfile for both node1 and node22 add a new variable.

var_asm_newdg_disk_1 = params['shared']['asm_newdg_disk_1'] var_asm_newdg_disk_size = params['shared']['asm_newdg_disk_size']

And add the creation of the disk into the Provider section.

unless File.exist?(var_asm_newdg_disk_1)
  vb.customize ['createhd', '--filename', var_asm_newdg_disk_1, '--size', var_asm_newdg_disk_size * 1024, '--format', 'VDI', '--variant', 'Fixed']
end
vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 4, '--device', 0, '--type', 'hdd', '--medium', var_asm_newdg_disk_1, '--mtype', 'shareable', '--nonrotational', var_non_rotational]

3) Edit shared_scripts/configure_shared_disks.sh. Add the extra fdisk

if [ ! -e /dev/sdh1 ]; then echo -e "n\np\n1\n\n\nw" | fdisk /dev/sdh fi

Add the extra UDEV stuff. Eg.

ASM_DISK6=/usr/lib/udev/scsi_id -g -u -d /dev/sdh

KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/\$parent", RESULT=="${ASM_DISK3}", SYMLINK+="oracleasm/asm-newdg-disk1", OWNER="oracle", GROUP="dba", MODE="0660"

Add the extra partx stuff twice.

/sbin/partx -u /dev/sdh1

4) Edit node1/scripts/oracle_grid_software_config.sh to add the extra disk group.

CREATE DISKGROUP newdg EXTERNAL REDUNDANCY DISK '/dev/oracleasm/asm-newdg-disk1' ATTRIBUTE 'compatible.asm'='19.0','compatible.rdbms'='19.0';

I've not tested this, but it should give you an idea of what to do.

Cheers

Tim...

AJKGitHub21 commented 3 years ago

Thank you Tim!