Files
notes/tiddlywiki/KVM - some example commands to create Oracle RAC.txt
2026-03-12 22:01:38 +01:00

133 lines
5.3 KiB
Plaintext
Executable File

qemu-img create -f raw /vm/hdd0/mandalore/hdd_01.img 8G
qemu-img create -f raw /vm/hdd0/mandalore/swap_01.img 16G
qemu-img create -f raw /vm/hdd0/mandalore/app_01.img 60G
virt-install \
--graphics vnc,listen=0.0.0.0 \
--name=mandalore \
--vcpus=4 \
--memory=32768 \
--network bridge=br0 \
--network bridge=br0 \
--cdrom=/mnt/yavin4/kit/Oracle/OEL7/V1003434-01.iso \
--disk /vm/hdd0/mandalore/hdd_01.img \
--disk /vm/hdd0/mandalore/swap_01.img \
--disk /vm/hdd0/mandalore/app_01.img \
--os-variant=ol7.6
qemu-img create -f raw /vm/hdd0/mandalore/app_02.img 30G
virsh attach-disk mandalore /vm/hdd0/mandalore/app_02.img vdd --driver qemu --subdriver raw --targetbus virtio --persistent
lvextend -l +100%FREE /dev/vg_app/lv_app
xfs_growfs /app
dd if=/dev/zero of=/vm/hdd0/mandalore/data_01.img bs=1G count=20
dd if=/dev/zero of=/vm/hdd0/mandalore/data_02.img bs=1G count=20
dd if=/dev/zero of=/vm/hdd0/mandalore/fra_01.img bs=1G count=20
qemu-img create -f raw /vm/hdd0/mandalore/data_01.img 20G
virsh attach-disk mandalore --source /vm/hdd0/mandalore/data_01.img --target vde --persistent
virsh attach-disk mandalore --source /vm/hdd0/mandalore/data_02.img --target vdf --persistent
virsh attach-disk mandalore --source /vm/hdd0/mandalore/fra_01.img --target vdg --persistent
vgcreate vg_data /dev/vde /dev/vdf
vgcreate vg_fra /dev/vdg
lvcreate -n lv_data -l 100%FREE vg_data
lvcreate -n lv_fra -l 100%FREE vg_fra
mkfs.xfs /dev/vg_data/lv_data
mkfs.xfs /dev/vg_fra/lv_fra
virsh detach-disk --domain mandalore /vm/hdd0/mandalore/data_01.img --persistent --config --live
virsh attach-interface --domain vortex-db01 --type network \
--source br0 \
--model virtio \
--config --live
virsh attach-interface --domain vortex-db01 --type bridge --source br0 --model virtio --config --live
dd if=/dev/zero of=/vm/ssd0/vortex-rac/disk_array/asm_01.img bs=1G count=20
dd if=/dev/zero of=/vm/ssd0/vortex-rac/disk_array/asm_02.img bs=1G count=20
dd if=/dev/zero of=/vm/ssd0/vortex-rac/disk_array/asm_03.img bs=1G count=20
dd if=/dev/zero of=/vm/ssd0/vortex-rac/disk_array/asm_04.img bs=1G count=20
dd if=/dev/zero of=/vm/ssd0/vortex-rac/disk_array/asm_05.img bs=1G count=20
virsh domblklist vortex-db01 --details
virsh attach-disk vortex-db01 --source /vm/ssd0/vortex-rac/disk_array/asm_01.img --target vde --persistent
virsh attach-disk vortex-db01 --source /vm/ssd0/vortex-rac/disk_array/asm_02.img --target vdf --persistent
virsh attach-disk vortex-db01 --source /vm/ssd0/vortex-rac/disk_array/asm_03.img --target vdg --persistent
virsh attach-disk vortex-db01 --source /vm/ssd0/vortex-rac/disk_array/asm_04.img --target vdh --persistent
virsh attach-disk vortex-db01 --source /vm/ssd0/vortex-rac/disk_array/asm_05.img --target vdi --persistent
virsh attach-disk vortex-db02 --source /vm/ssd0/vortex-rac/disk_array/asm_01.img --target vde --persistent
virsh attach-disk vortex-db02 --source /vm/ssd0/vortex-rac/disk_array/asm_02.img --target vdf --persistent
virsh attach-disk vortex-db02 --source /vm/ssd0/vortex-rac/disk_array/asm_03.img --target vdg --persistent
virsh attach-disk vortex-db02 --source /vm/ssd0/vortex-rac/disk_array/asm_04.img --target vdh --persistent
virsh attach-disk vortex-db02 --source /vm/ssd0/vortex-rac/disk_array/asm_05.img --target vdi --persistent
# need PARTITIONS for ASM disk
fdisk /dev/vdXXXXX
groupadd -g 54327 asmoper
groupadd -g 54328 asmdba
groupadd -g 54329 asmadmin
useradd -g oinstall -G asmoper,asmdba,asmadmin -c "Grid Infrastructure Owner" grid
usermod -g oinstall -G asmdba,dba,oper -c "Oracle Sotfware Owner" oracle
systemctl stop firewalld.service
systemctl disable firewalld.service
yum install -y kmod-oracleasm.x86_64 oracleasm-support
oracleasm configure -i
(choose grid for user and asmdba for group)
oracleasm init
oracleasm createdisk DATA_01 /dev/vde1
oracleasm createdisk DATA_02 /dev/vdf1
oracleasm createdisk DATA_03 /dev/vdg1
oracleasm createdisk DATA_04 /dev/vdh1
oracleasm createdisk DATA_05 /dev/vdi1
dd if=/dev/zero of=/vm/hdd0/vortex-rac/disk_array/asm_fra_01.img bs=1G count=20
dd if=/dev/zero of=/vm/hdd0/vortex-rac/disk_array/asm_fra_02.img bs=1G count=20
dd if=/dev/zero of=/vm/hdd0/vortex-rac/disk_array/asm_fra_03.img bs=1G count=20
dd if=/dev/zero of=/vm/hdd0/vortex-rac/disk_array/asm_fra_04.img bs=1G count=20
virsh attach-disk vortex-db01 --source /vm/hdd0/vortex-rac/disk_array/asm_fra_01.img --target vdj --persistent
virsh attach-disk vortex-db01 --source /vm/hdd0/vortex-rac/disk_array/asm_fra_02.img --target vdk --persistent
virsh attach-disk vortex-db01 --source /vm/hdd0/vortex-rac/disk_array/asm_fra_03.img --target vdl --persistent
virsh attach-disk vortex-db01 --source /vm/hdd0/vortex-rac/disk_array/asm_fra_04.img --target vdm --persistent
virsh attach-disk vortex-db02 --source /vm/hdd0/vortex-rac/disk_array/asm_fra_01.img --target vdj --persistent
virsh attach-disk vortex-db02 --source /vm/hdd0/vortex-rac/disk_array/asm_fra_02.img --target vdk --persistent
virsh attach-disk vortex-db02 --source /vm/hdd0/vortex-rac/disk_array/asm_fra_03.img --target vdl --persistent
virsh attach-disk vortex-db02 --source /vm/hdd0/vortex-rac/disk_array/asm_fra_04.img --target vdm --persistent
oracleasm createdisk RECO_01 /dev/vdj1
oracleasm createdisk RECO_02 /dev/vdk1
oracleasm createdisk RECO_03 /dev/vdl1
oracleasm createdisk RECO_04 /dev/vdm1