Oracle® VM Server User's Guide Release 2.1 Part Number E10898-04 |
|
|
View PDF |
This Chapter discusses implementing High Availability (HA) fail over for server pools and guests in Oracle VM. This Chapter contains:
You can manage HA of server pools and guests using Oracle VM Manager. See the Oracle VM Manager User's Guide for information on managing HA using Oracle VM Manager.
You can set up HA in Oracle VM to guarantee the availability of guests if the Virtual Machine Server they are running on fails or restarts. When a Virtual Machine Server is restarted or shut down, the guests running on it are either restarted on, or migrated to, another Virtual Machine Server.
You can manage HA with Oracle VM Manager. To implement HA, you must create a cluster of Virtual Machine Servers in a server pool and have them managed by Oracle VM Manager. HA cannot be implemented with Oracle VM Server alone.
To use HA, you must first enable HA on the server pool, then on all guests, as shown in Figure 9-1, "Enabling HA". If you enable HA in the server pool and then for guests, when a Virtual Machine Server is shut down or fails, the guests are migrated or restarted on another available Virtual Machine Server. HA must be enabled for both the server pool and for guests. If HA is not enabled for both, HA is disabled.
If HA is enabled, when you restart, shut down, or delete the Virtual Machine Server in Oracle VM Manager, you are prompted to migrate the running guests to another available Virtual Machine Server. If you do not migrate the running guests, Oracle VM Agent attempts to find an available Virtual Machine Server on which to restart the guests. The Virtual Machine Server is selected using the Preferred Server setting for the server pool when you create a guest in Oracle VM Manager:
Auto selects an available Virtual Machine Server.
Manual selects an available preferred Virtual Machine Server.
If you do not select a preferred Oracle VM Server when creating a guest in Oracle VM Manager, Auto is set as the default.
If there is no preferred Virtual Machine Server or Virtual Machine Server available, the guests shut down (Power Off) and are restarted when a Virtual Machine Server becomes available.
If the Server Pool Master fails, HA also fails for the Virtual Machine Servers running in that server pool.
The possible HA scenarios are:
If you shut down or restart a Virtual Machine Server in Oracle VM Manager, you are prompted which guests to migrate to another available Virtual Machine Server. Any guests which are not migrated, are restarted on an available Virtual Machine Server.
If you shut down or restart a Virtual Machine Server at the Oracle VM Server command-line, Oracle VM Agent restarts the guests on an available Virtual Machine Server.
If a Virtual Machine Server fails, all running guests are restarted automatically on another available Virtual Machine Server.
If a Virtual Machine Server fails and no other Virtual Machine Servers are available, all running guests are restarted when a Virtual Machine Server becomes available.
Figure 9-2, "HA in effect for a Virtual Machine Server failure" shows a Virtual Machine Server failing and the guests restarting on other Virtual Machine Servers in the server pool.
Figure 9-3, "HA in effect for a Virtual Machine Server restart or shut down" shows a Virtual Machine Server restarting or shutting down and the guests migrating to other Virtual Machine Servers in the server pool.
To enable HA, you must first make sure all Virtual Machine Servers in the server pool:
Use the same shared storage.
Are in the same OCFS2 or NFS cluster.
Are Oracle VM Server Release 2.1.2 or above.
Have the same cluster root, which is a specially designated shared storage used for heatbeating in the cluster. For example, the cluster root might be example.com:/OVS for an NFS cluster, or /dev/sdd6 for an OCFS2 cluster. The heartbeat file would be located at example.com:/OVS/.server_pool_hb for an NFS cluster. There is no heartbeat file for an OCFS2 cluster as one is in-built in the file system.
Have the cluster root mounted at /OVS. All other storage may be mounted at the standard location of /OVS/uuid.
Have moved any /OVS mount points (set in FSTAB for Releases 2.1 or 2.1.1) to the /etc/ovs/repositories file. All storage, even that mounted at /OVS, must be maintained in the /etc/ovs/repositories file. You can move the mount points to the /etc/ovs/repositories file with the following command:
# /usr/lib/ovs/ovs-cluster-check --alter-fstab
Have a shared cluster root at /OVS, and not local, using clustered OCFS2 on SAN, or ISCSI storage, or NFS on NAS. The default local storage is OCFS2, and is not supported with HA.
The following sections describe how to perform the configuration required to enable HA.
To enable HA, you must first create a shared virtual disk to be used by the server pool. You can set up a shared virtual disk in the following configurations:
OCFS2 (Oracle Cluster File System) using the iSCSI (Internet SCSI) network protocol
OCFS2 using SAN (Storage Area Network)
NFS (Network File System)
This section discusses creating a shared virtual disk in these configurations.
To create a shared virtual disk using OCFS2 on iSCSI:
Install the iscsi-initiator-utils RPM on the Oracle VM Server. The iscsi-initiator-utils RPM is available on the Oracle VM Server CDROM or ISO file.
# rpm -Uvh iscsi-initiator-utils-version.el5.i386.rpm
Start the iSCSI service:
# service iscsi start
Run discovery on the iSCSI target. In this example, the target is 10.1.1.1:
# iscsiadm -m discovery -t sendtargets -p 10.1.1.1
This command returns output similar to:
10.1.1.1:3260,5 iqn.1992-04.com.emc:cx.apm00070202838.a2 10.1.1.1:3260,6 iqn.1992-04.com.emc:cx.apm00070202838.a3 10.2.1.250:3260,4 iqn.1992-04.com.emc:cx.apm00070202838.b1 10.1.0.249:3260,1 iqn.1992-04.com.emc:cx.apm00070202838.a0 10.1.1.249:3260,2 iqn.1992-04.com.emc:cx.apm00070202838.a1 10.2.0.250:3260,3 iqn.1992-04.com.emc:cx.apm00070202838.b0
Delete entries that you do not want to use, for example:
# iscsiadm -m node -p 10.2.0.250:3260,3 -T iqn.1992-04.com.emc:cx.apm00070202838.b0 -o delete # iscsiadm -m node -p 10.1.0.249:3260,1 -T iqn.1992-04.com.emc:cx.apm00070202838.a0 -o delete # iscsiadm -m node -p 10.2.1.250:3260,4 -T iqn.1992-04.com.emc:cx.apm00070202838.b1 -o delete # iscsiadm -m node -p 10.1.1.249:3260,2 -T iqn.1992-04.com.emc:cx.apm00070202838.a1 -o delete # iscsiadm -m node -p 10.0.1.249:3260,5 -T iqn.1992-04.com.emc:cx.apm00070202838.a2 -o delete
Verify that only the iSCSI targets you want to use for the server pool are visible:
# iscsiadm -m node
Review the partitions by checking /proc/partitions:
# cat /proc/partitions major minor #blocks name 8 0 71687372 sda 8 1 104391 sda1 8 2 71577607 sda2 253 0 70516736 dm-0 253 1 1048576 dm-1
Restart the iSCSI service:
# service iscsi restart
Review the partitions by checking /proc/partitions. A new iSCSI device (for example, sdb) is listed. Determine the share disk volume you want to use and create the desired partitions (for example, /dev/sdb1) using the fdisk command.
# cat /proc/partitions major minor #blocks name 8 0 71687372 sda 8 1 104391 sda1 8 2 71577607 sda2 253 0 70516736 dm-0 253 1 1048576 dm-1 8 16 1048576 sdb
Format the shared virtual disk from any of the Oracle VM Servers in the cluster. For example, to create an OCFS2 partition with a 4k block size, 4k cluster size, 64MB journal size, and 16 node slots:
# mkfs.ocfs2 -L mylabel -b 4K -C 4K -J size=64M -N 16 /dev/sdb1
To create a shared virtual disk using OCFS2 on SAN:
Review the partitions by checking /proc/partitions. Determine the share disk volume (for example, sdb) you want to use and create the desired partitions (for example, /dev/sdb1) using the fdisk command:
# cat /proc/partitions major minor #blocks name 8 0 71687372 sda 8 1 104391 sda1 8 2 71577607 sda2 253 0 70516736 dm-0 253 1 1048576 dm-1 8 16 1048576 sdb
Format the shared virtual disk from any of the Oracle VM Servers in the cluster. For example, to create an OCFS2 partition with a 4k block size, 4k cluster size, 64MB journal size, and 16 node slots:
# mkfs.ocfs2 -L mylabel -b 4K -C 4K -J size=64M -N 16 /dev/sdb1
Mount the shared virtual disk from all the Oracle VM Servers in the cluster on /OVS/remote.
To support HA you must also create an Oracle VM Server cluster to ensure the safety of guest data, and protect from runaway nodes which may become unreachable. Clustered Oracle VM Servers have built in rules and restrictions which are more stringent than unclustered Oracle VM Servers, for example, Quorum is needed and may require restarting one or more Oracle VM Servers to preserve the cluster under rare circumstances.
The following sections detail how to create a cluster and enable HA. You can create either an NFS-based cluster, or an OCFS2 cluster.
On the Server Pool Master, start the cluster service:
# /usr/lib/ovs/ovs-cluster-configure
On the Server Pool Master, configure the shared storage with /usr/lib/ovs/ovs-makerepo
source
C
description
, for example.
# /usr/lib/ovs/ovs-makerepo example.com:/OVS C "cluster root"
On the Server Pool Master, check the cluster has been configured correctly and is running:
# /usr/lib/ovs/ovs-cluster-check --master --alter-fstab
The --master
parameter should only be used on the Server Pool Master. The --alter-fstab
parameter modifies the /etc/fstab file. A backup of the original /etc/fstab file is created in /tmp.
Log in to Oracle VM Manager and create an HA-enabled server pool. See Section 9.4, "Enabling HA" for information on creating an HA-enabled server pool.
To create an OCFS2-based cluster for HA:
On the Server Pool Master, format a volume to be an OCFS2 partition with the mkfs.ocfs2 utility. For example, to create an OCFS2 partition with a 4k block size, 4k cluster size, and 16 node slots:
# mkfs.ocfs2 -L mylabel -b 4K -C 4K -J size=64M -N 16 /dev/sda1
On the Server Pool Master, start the cluster service:
# /usr/lib/ovs/ovs-cluster-configure
This script generates the /etc/ocfs2/cluster.conf file if it does not already exist, and configures and starts the o2cb service.
On the Server Pool Master, configure the OCFS2 partition as shared storage with /usr/lib/ovs/ovs-makerepo
source
C
description
, for example.
# /usr/lib/ovs/ovs-makerepo /dev/sda1 C "cluster root"
Check the cluster has been configured correctly and is running:
# /usr/lib/ovs/ovs-cluster-check --master --alter-fstab
The --master
parameter should only be used on the Server Pool Master. The --alter-fstab
parameter modifies the /etc/fstab file. A backup of the original /etc/fstab file is created in /tmp.
Log in to Oracle VM Manager and create an HA-enabled server pool. See Section 9.4, "Enabling HA" for information on creating an HA-enabled server pool.
To enable HA, you must first enable HA in the server pool, and then on each guest. To enable HA:
Log in to Oracle VM Manager and enable HA in the server pool. If the server pool already exists, enable HA on the server pool. See the Oracle VM Manager User's Guide for information on setting up HA in Oracle VM Manager.
The Oracle VM Agent on the Server Pool Master calls the /usr/lib/ovs/ovs-cluster-configure script and creates the cluster.conf file, if it does not already exist. The Oracle VM Agent then creates and starts a heartbeat device if required.
The server pool setup is verified and any errors are displayed in Oracle VM Manager. If there are no errors, the Oracle VM Agent on the Server Pool Master propagates the repositories and the cluster.conf file to other Oracle VM Servers in the server pool. When an Oracle VM Agent is started in the server pool, this propagation is repeated for that Oracle VM Server.
The server pool is HA enabled.
When creating guests (virtual machines) in Oracle VM Manager, enable HA.
HA is enabled on the server pool and guests.