Oracle VM uses Oracle VM Server (OVS) repositories to store resources such as virtual machines, templates, ISO images, and shared virtual disks. Once a storage repository has been created and initialized, it will create storage repository directories to store these resources. One of these sub-directories is the running_pool directory which will contain your virtual machines. Via your Server Pool Master you will create an OVS repository following the steps below.

1. Create a partition on the shared disk that will be used for your OVS repository.

Example:

fdisk /dev/mapper/mpath1

NOTE: If your shared disk volume is larger than 2 TB in size, please use the gparted utility (GPT) gparted /dev/mapper/mpath1
Once you have created your partition, run the following command on all your OVM servers to ensure your partition table has been updated:

kpartx -a /dev/mapper/mpath1
kpartx -l /dev/mapper/mpath1


2. Create your OCFS2 filesystem on your partition

mkfs.ocfs2 -T datafiles -N 8 -L "OVS" source

Example:
mkfs.ocfs2 -T datafiles -N 8 -L "OVS" /dev/mapper/mpath1p1

The –T datafiles parameter makes use of a large cluster size. This cluster size depends on the device size and cannot be changed later. It is recommended allocate the –N option with at least 8 slots, even if using non-shared storage. Increase the number of slots to greater than 8 if the cluster will have more than 8 OVM Server nodes. The –L option is a label for our OCFS2 partition in which we have named OVS.


3. Once your OCFS2 filesystem is ready, we will delete the local repository from your Oracle VM Server Pool Master to ensure that our OVM Servers are using the shared repository.
The command to delete an OVS repository is the following:

/opt/ovs-agent-2.3/utils/repos.py -d source

Example:

/opt/ovs-agent-2.3/utils/repos.py -d /dev/sda3

4. The command to create your OVS repository is the following:

/opt/ovs-agent-2.3/utils/repos.py -n source

Example:
/opt/ovs-agent-2.3/utils/repos.py -n /dev/mapper/mpath1p1

The repos.py script is used to manage your storage repositories. It provides the flexibility of creating, deleting and initializing one or more storage repositories. In the example above, the –n option creates a new storage repository. The source is the block device path of our shared storage volume used as our OVS partition.


5. Once your OVS repository has been created, you will make the newly created repository the cluster root repository for your OVM Servers. From the Server Pool Master run the command:

/opt/ovs-agent-2.3/utils/repos.py -r uuid

NOTE: The UUID is the Universal Unique Identifier of the storage repository which can be found by using the list command from the repos.py script. An example of obtaining the UUID is shown below:
/opt/ovs-agent-2.3/utils/repos.py -l

The –l option or –list option shows the storage repository UUID and the block device path of your shared EqualLogic storage volume.

6. Once the storage repository has been created and the cluster root for the repository has been set, reboot all Oracle VM Servers.

7.Once the systems have finished rebooting, the next step is to ensure that you can see all of your /OVS mounts across all your OVM Server nodes using the command:

df -h

NOTE: The /OVS directory is the cluster root and is a symbolic link mounted to the /var/ovs/mount/uuid directory
Example:

ls -l /OVS
lrwxrwxrwx 1 root root 47 Feb 2 09:15 /OVS -> /var/ovs/mount/A84025B29DEA421B9D53C819CAA01115

8. Once the OVS partition is mounted, we must initialize the storage repository from your Oracle VM Manager (steps can be
found under the Oracle VM Manager section). Once a server pool is created via the OVM Manager, it will propagate the shared repository across all your existing Oracle VM Server nodes. The initialization of the storage repository will create sub-directories within your /OVS partition. A common folder found within these sub-directories is the running_pool directory which stores virtual machines.

9. For more information on how to you use the repos.py script please use the –h or –help option.
If you enjoyed this article, check out my other content at http://rogervm.wordpress.com