In order to enable High Availability for a server pool you have to have access to shared storage using either clustered OCFS2 on SAN, or ISCSI storage, or NFS on NAS. Lets say you don’t have access to that type of infrastructure or simply don’t need some of the HA features (live migration, automatic restart of failed VMs). There is a way to take advantage of some of the other cluster features without setting this up.
Oracle VM Server comes packaged with a NFS server, so you can share out the /OVS directory and mount it on other servers. This will provide you with the ability to cold start VM’s on different servers in your server pool. This eases the headache of manually moving around VM’s if a server is maxed on resources or diskspace.
In our case, this works well for our DEV environment since we create/destroy/park a lot of VM’s. We have some older servers which don’t have a lot of storage and that which is does have is dreadfully slow. We have a new server with plenty of blazingly fast disk and even over NFS its faster than local.
Scenario: For the steps below I’m assuming you have at least two independent Oracle VM servers, meaning they both reside in their own server pools and have been added to VM Manager. The goal is to export the filesystem from server A, mount it on B and add B to the same server pool as A.
1. Disable the Firewall. Disable the iptables firewall or add a rule. Since this is a dev environment I disabled iptables.
[root@server_a ~]# service iptables stop
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
To disable iptables so it doesn’t start on the next reboot use chkconfig. Chkconfig will show you which runlevels a service is enabled in and provide you with the ability to turn it off.
[root@vmserver_a ~]# chkconfig --list iptables
iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
root@vmserver_a ~]# chkconfig iptables off
[root@vmserver_a ~]# chkconfig --list iptables
iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
2. Delete the server pool for server B. Login to VM Manager and delete the server pool for B. Click on the Server Pools tab, select the Server Pool B and click on the Delete button. You will see a screen similar to the following:
Do not select either option and click on Yes.
3. Export /OVS on Server A. Add the following to the /etc/exports file on Server A.
4. Start NFS on Server A. Execute the following on server A.
[root@vmserver_a OVS]# service nfs start
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
Set NFS to start automatically on reboot:
[root@vmserver_a OVS]# chkconfig nfs on
5. Mount NFS export from Server A on Server B
a. First stop the Oracle VM Server services on Server B. Otherwise /OVS will be busy and you won’t be able to unmount it.
[root@vmserver_b init.d]# service ovs-agent stop
OVSAgentServer going down...
[root@vmserver_b init.d]# service ovsrepositories stop
Stopping OVS Storage Repository Mounter...
OVS Storage Repository Mounter Shutdown: [ OK ]
b. Unmount /OVS and remount it as /OVS_OLD
[root@vmserver_b init.d]# umount /OVS
c. Edit /etc/fstab to mount /OVS from vmserver_a. I also mounted the local /OVS directory under /OVS_OLD in case there were vm’s I wanted to transfer.
/dev/sda1 /OVS_OLD ocfs2 defaults 1 0
Vmserver_a:/OVS /OVS nfs rw,bg,hard,nointr,tcp,vers=3,timeo=300,rsize=32768,wsize=32768,actimeo=0
[root@vmserver_b init.d]# mount /OVS_OLD
[root@vmserver_b init.d]# mount /OVS
d. Restart the OVS services on Server B
[root@vmserver_b init.d]# service ovs-agent start
[root@vmserver_b init.d]# service ovsrepositories start
Starting OVS Storage Repository Mounter...
OVS Storage Repository Mounter Startup: [ OK ]
6. Add Server B to Server A’s server pool. Login in to Oracle VM Manager, select the Servers tab and click on the Add button. You will see a screen similar to the one below:
Enter the Server Host/IP for Server B. If its different than the name you want to give it, then enter Server Name as well. Type in the Server Agent Password for Server B and check Virtual Machine Server for Server Type. Click on the Add button when complete.
On the Server Pools tab, in the column for Server Pool A you should see that it now 2 servers in its pool.
Note: I am not an NFS expert so if you have any recommendations on better settings or how to improve performance, feel free to leave a comment. I searched for recommended NFS settings and a few sites referenced Kevin Closson’s blog. Compared with the settings I used initially, these offered quite an improvement. There are other ways to improve NFS performance such as using multiple NIC’s but I haven’t look into that yet.