In one of my earlier posts, I discussed setting up a shared storage repository using OCFS2. Today, I’d like to discuss the steps involved in implementing additional repositories to your Oracle VM Server. One of the main reasons you would want to add an additional repository is the simple fact of not having additional space within your current OVS repository to host more virtual machines. In this tutorial, I’ll show you step by step on how to do just that.

NOTE: In the steps below, I used device mapper for my shared storage.

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

Example:
fdisk /dev/mapper/mpath2
NOTE: If your shared disk volume is larger than 2 TB in size, please use the gparted utility (GPT) gparted /dev/mapper/mpath2

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/mpath2
kpartx -l /dev/mapper/mpath2

NOTE: If within /dev/mapper/ you DO NOT see /dev/mapper/mpath2p1 but instead see /dev/mapper/mpath21, please reboot your OVM Server. It is important for the partition to contain the ‘p’ for proper usability.

2. Create your OCFS2 filesystem on your partition
mkfs.ocfs2 –T datafiles –N 8 –L “OVS2” source
Example:
mkfs.ocfs2 –T datafiles –N 8 –L “OVS2” /dev/mapper/mpath2p1

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 the OCFS2 filesystem has been created on the OVM Server Master node, we want to verify that our other OVM Severs can see the OCFS2 filesystem creation. We can do a simple check of this with the following command:

tunefs.ocfs2 -Q “VolLabel = %V\n” /dev/mapper/mpath2p1
VolLabel = OVS2

4. Once we have ensured all of our OVM Severs can see our OCFS2 partition, we need to go to the OVM Manager to initialize our additional OVS repository.

5. At the OVM Manager, go to Resources->Shared Virtual Disks->Import

6. At the import screen, select the appropriate server pool that you wish to add the new OVS repository.

7. At the import screen, select the appropriate group name, i.e. default is ‘My Workspace’.

8. Under the Shared Virtual Disk Type:, select Multipath-based Disks and choose the appriorate disk.
NOTE: In our example, this will be shown as /dev/mpath/OVS2p1. However, this is a bug I’ve currently filed with Oracle to fix. Oracle VM Manager should be using /dev/mapper not /dev/mpath for multipathed devices. This bug did not effect my process of adding another OVS repository.

9. Fill in a Description to your new device such as “OVS2 repository”

10. Click Next and Confirm your settings.

11. Once you have confirmed your changes, you might notice your OVS repositories unmounted from your OVS Servers. Please reboot all your OVM Servers for all the changes to take effect.

Advertisements