In my previous post, I described how to install Oracle VM and Oracle VM Manager on the same sandbox. However, to start playing with Oracle VM v3 you need to configure some storage to be used for new VM hosts. The problem is that Oracle states that you should allocate a full HDD for VM host storage. If you have just one HDD in your system, then you are in trouble since part of it is already occupied by the Dom0 host.
However, you can still manage to get your first couple of VM hosts running. The idea is to mount part of your single disk via the NFS protocol. This way, Oracle VM can use the rest of the single HDD for VM host storage. The only small drawback could be additional CPU cycles spent running NFS services.
Hey, let me give you a final warning about the solution before we start: DO NOT USE IT IN DEV/TEST/PROD ENVIRONMENTS. The solution should be used for sandbox only. I hope we all understand the reasons behind it :)
Anyway, off we go:
Step 1: Create a partition
fdisk /dev/sda [[email protected] /]# fdisk /dev/sda Command (m for help): n First cylinder (9373-38913, default 9373): -- Using default value 9373 Last cylinder or +size or +sizeM or +sizeK (9373-38913, default 38913): -- Using default value 38913 Command (m for help): w ... WARNING: Re-reading the partition table failed with error 16: Device or resource busy. ... -- Let's run the partprobe to address the WARNING without additional reboots [[email protected] /]# partprobe /dev/sda
Step 2: Create a file system
[[email protected] /]# mkfs.ext3 /dev/sda6
Step 3: Mount the volume
[[email protected] /]# mkdir /u03 [[email protected] /]# grep sda6 /etc/fstab /dev/sda6 /u03 ext3 defaults 0 0 [[email protected] /]# mount /u03 [[email protected] /]# df -h /u03 Filesystem Size Used Avail Use% Mounted on /dev/sda6 223G 188M 212G 1% /u03 [[email protected] /]#
Step 4: Start NFS services
[[email protected] /]# service portmap start [[email protected] /]# service nfs start [[email protected] /]# service nfslock start
Step 5: Configure NFS mount
[[email protected] /]# mkdir /u03/nfs02 [[email protected] /]# /etc/exports [[email protected] /]# grep u03 /etc/exports /u03/nfs02 *(rw) [[email protected] /]# exportfs -r [[email protected] /]# showmount -e vm04 | grep u03 /u03/nfs02 *
We’re almost there!
Step 6: Register File Server
- Go to the Oracle VM Manager
- Hardware (tab) -> Storage -> File Servers -> Register File Server
- Name: < your name for a file server >
- Storage Plug-In: Oracle Generic Network File System
- Access Host: < your server – vm04 – in my case >
- Next -> Available Servers: move the only one you see
- Tick the file system you want to use
- NOTE: If you don’t see a file system in the list of available file systems, try executing “chmod 777 /u03/nfs02” on the server. As of now, I haven’t figured out why there are such issues from time to time. The interesting fact is that after you successfully registered the file system, you can change the permissions back. If you know why it is happening, you are welcomed to share in the comment section. ;)
- Click “Finish” button.
Step 7: Create Repository
Just to finalize your efforts, you need to create an Oracle VM Repository.
In the “Oracle VM Manager” Web interface go to Home (tab) -> Server Pools -> Repositories -> Create New Repository.
Fill all obligatory fields, and off you go! :)
Enjoy the latest Oracle VM learning process.
Some other related hints:
— If you use loop back IP 127.0.0.1, it may eliminate some unnecessary things (in our case, CPU cycles).
— Recently, Oracle made its YUM repository publicly available. It makes it much easier to configure some useful Linux tools on your Oracle VM. As an example, I have installed VNC, FireFox on my Dom0 host (Don’t tell anyone okay? It isn’t supported and Avi from Oracle will tell people that I am preparing an Armageddon again.) to download Oracle VM templates directly to Oracle VM repository :).
— If you did allocate a whole disk to the dom0 host, you still can use the solution described above. Just start implementing from Step 4.
[…] Oracle VM desde la versión 3 espera que el repositorio se cree en otro disco por lo que si tenemos un sistema con un solo disco tendremos que presentarlo por NFS con todo lo que ello implica ( ciclos de CPU / posible inestabilidad ), para presentar una partición por NFS podemos encontrar una referencia en otro post del blog de Pythian de Yuri Velikanov. […]
Thank you very much for your info, now i be able to use my repo.
Great info. Really need this to setup a lab environment.
hello, When I try to create file system it shows me error “/dev/sda4 is apparently in use by the system; will not make a filesystme here”
And when I delete the sda4 partition and again try to do so, then it show me “The device apparently does not exist; did you specify correctly?”
Can you please tell me the solution for how to use single hdd and all configuration regarding oracle vm server and manager ??
I have a issue and I dunno if you can help me. When I install Oracle VM Server I have 110gb of a vHDD on a ESXi5.5 server. And when I end up instaling OVS after using the entire disk unit for its instalation, the indication of the server HDD space is 50GB max. With the use of df- h I can only see two partitions /dev/sda1 (boot) and /dev/sda2 (root) and this one has 50GB allocated. And when I use fdisk /dev/sda with “p” command I have 4 partitions. Two of them with the rest of the space. /dev/sda3 and /dev/sda4. How come oracle vm server does not use those other two partitions in the beggining to use the entire disk space? :S I do not follow. Do you have any suggestion? Is it documented anywhere, because I can’t find that piece of information.
Thanks in advance. Hope anyone can hear my cry for help. This is getting frustrating.
Very Useful information.