Oracle VM: What If You Have Only 1 HDD System?

Mar 28, 2012 / By Yury Velikanov

Tags: ,

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
[root@vm04 /]# 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
[root@vm04 /]# partprobe /dev/sda

Step 2: Create a file system

 [root@vm04 /]# mkfs.ext3 /dev/sda6

Step 3: Mount the volume

 [root@vm04 /]# mkdir /u03

[root@vm04 /]# grep sda6 /etc/fstab
/dev/sda6 /u03 ext3    defaults       0 0

[root@vm04 /]# mount /u03
[root@vm04 /]# df -h /u03
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda6             223G  188M  212G   1% /u03
[root@vm04 /]#

Step 4: Start NFS services

 [root@vm04 /]# service portmap start
[root@vm04 /]# service nfs start
[root@vm04 /]# service nfslock start

Step 5: Configure NFS mount

 [root@vm04 /]# mkdir /u03/nfs02
[root@vm04 /]# /etc/exports
[root@vm04 /]# grep u03 /etc/exports
/u03/nfs02 *(rw)
[root@vm04 /]# exportfs -r
[root@vm04 /]# 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.

Yury

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.

3 Responses to “Oracle VM: What If You Have Only 1 HDD System?”

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>