TIP 118# : Virtualized Exadata-Adding new local disk to DomU


I have seen more Oracle customer adopting virtualized platform in Oracle Exadata. At the same time, I hear concerns regarding virtualization on Exa would be new and it could be buggy, could not be well documented and well tested compare with Bate-Metal install. All these provide me a motivation  to publish some posts regarding real experience in this platform.

Here is the first post :

If you are one of the Oracle customer with a virtualized Exadata, you may notice that the available local space in each DomU may not be sufficient to for various things which you may do such as Grid software, multiple Oracle software, 3rd party monitoring, backup agents and etc.
Also you may notice that there is no full step by step document on how to add more space to local space in DomU.

This post is to share my experience with performing this task and walk you through step by step :

Step 1 :  List existing disks and find out available disk

lsblk -id
NAME MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
xvda 202:0    0   25G  0 disk
xvdb 202:16   0   50G  0 disk /u01/app/12.1.0.2/grid
xvdc 202:32   0   50G  0 disk /u01/app/oracle/product/12.1.0.2/dbhome_1
xvdd 202:48   0   58G  0 disk
sda    8:0    0  128M  0 disk
sdb    8:16   0  128M  0 disk
sdc    8:32   0  128M  0 disk


I will use xvde (the next available) as new disk

Step 2 : Prepare new 20GB file

All VM guest physical files are in Dom0 under /EXAVMIMAGES/GuestImages. The new file is named db12.1.0.2.160719-3-2ndHome.img

qemu-img create /EXAVMIMAGES/GuestImages/exavmadm01vm01.newco.local/db12.1.0.2.160719-3-2ndHome.img 20G


Step 3 : Attach the newly generated file to VM

Use the xm block-attach command to dynamically attach the new generated file to the existing VM.


xm block-attach exavmadm01vm01.newco.local  file:/EXAVMIMAGES/GuestImages/exavmadm01vm01.newco.local/db12.1.0.2.160719-3-2ndHome.img /dev/xvde w


exavmadm01vm01.newco.local  is the VM and the file which is created in step3 is attached as xvde. 
The new disk should be visible in VM now.

lsblk -id
NAME MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
xvda 202:0    0   25G  0 disk
xvdb 202:16   0   50G  0 disk /u01/app/12.1.0.2/grid
xvdc 202:32   0   50G  0 disk /u01/app/oracle/product/12.1.0.2/dbhome_1
xvdd 202:48   0   58G  0 disk
sda    8:0    0  128M  0 disk
sdb    8:16   0  128M  0 disk
sdc    8:32   0  128M  0 disk
xvde 202:64   0   20G  0 disk

 

Step 4 : Find VM uuid and generate a new uuid for the new disk

VM uuid is set in vm.cfg and a new uuid has to be generated for the new disk.

grep -i uuid vm.cfg
uuid = 'b0c2dd2ee4b14f6cabe0b546b930b6e8'  

uuidgen | tr -d '-'
666a1ab9604e4e3d95bbdfce30d0b739

b0c2dd2ee4b14f6cabe0b546b930b6e8 is uuid for VM and 666a1ab9604e4e3d95bbdfce30d0b739 is uuid for the new disk.
These two uuids establish the new disk location. In my example, it would be such as below :


/OVS/Repositories/b0c2dd2ee4b14f6cabe0b546b930b6e8/VirtualDisks/666a1ab9604e4e3d95bbdfce30d0b739.img 

ln -s /EXAVMIMAGES/GuestImages/exavmadm01vm01.newco.local/db12.1.0.2.160719-3-2ndHome.img /OVS/Repositories/b0c2dd2ee4b14f6cabe0b546b930b6e8/VirtualDisks/666a1ab9604e4e3d95bbdfce30d0b739.img

Step 5 - Add the new disk to vm configuration file

vm configuration file (vm.cfg) has disk setting which the new disk needs to be added

disk = [...,
'file:/OVS/Repositories/b0c2dd2ee4b14f6cabe0b546b930b6e8/VirtualDisks/666a1ab9604e4e3d95bbdfce30d0b739.img,xvde,w']

Step6 - Bounce VM and format the new disk

This is mainly the last step - It would be safe to bounce VM and when it backs up, the new disk should be visible.


xm reboot exavmadm01vm01.newco.local

The new disk needs to be formatted and then it is mounted (in this case, it is mounted as /u01/app/oracle/product/12.1.0.2/dbhome_2) and the mount point needs to be added to /etc/fstab

mkfs -t ext4 /dev/xvde
mkdir -p /u01/app/oracle/product/12.1.0.2/dbhome_2
mount -t ext4 /dev/xvde /u01/app/oracle/product/12.1.0.2/dbhome_2


/etc/fstab
.
.
.
/dev/xvde               /u01/app/oracle/product/12.1.0.2/dbhome_2       ext4    defaults        1 1

Now the new disk is ready for use.
Hope it helps.