1.3 Configuring Software RAID for Storage

You can use software RAID devices for storage repositories or virtual disks. However you must first configure these devices on Oracle VM Server before Oracle VM Manager can discover the array for storage.

Important

As a best practice, you should use software RAID devices as storage repositories in a deployment environment before using them in a production environment.

In environments where you use software RAID devices as storage repositories for server pools, unexpected behavior can occur with certain virtual machine migration operations. For example, if you clone a virtual machine and then attempt to live migrate it to an instance of Oracle VM Server in the same server pool, the migration fails with an error that indicates the virtual machine disk does not exist. In this case, you must stop the virtual machine and then move it to the appropriate instance of Oracle VM Server.

To configure software RAID devices as storage, do the following:

  1. Connect to Oracle VM Server as the root user.

  2. Ensure the local disks or multipath LUNs you want to configure as software RAID devices are available as mapped devices.

    # ls /dev/mapper
  3. Run the multipath -ll command to find the WWIDs for the devices, as follows:

    # multipath -ll
    
    device1-WWID dm-0 LSI,MR9261-8i
    size=558G features='1 queue_if_no_path' hwhandler='0' wp=rw
    `-+- policy='round-robin 0' prio=1 status=active
    `- 2:2:1:0 sdb 8:16 active ready running
    
    device2-WWID dm-1 LSI,MR9261-8i
    size=558G features='1 queue_if_no_path' hwhandler='0' wp=rw
    `-+- policy='round-robin 0' prio=1 status=active
    `- 2:2:2:0 sdc 8:32 active ready running
    Note

    The multipathing service, multipathd, uses the underlying devices to create a single device that routes I/O from Oracle VM Server to those underlying devices. For this reason, you should not use the udev device names to create a software RAID, such as /dev/sdb. You should only the WWIDs of the devices to create a software RAID. If you attempt to use a udev device name, an error occurs to indicate that the device is busy.

  4. Create a software RAID configuration with the devices.

    # mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 \
      /dev/mapper/device1-WWID /dev/mapper/device2-WWID
  5. Open /etc/mdadm.conf for editing.

  6. Comment out the DEVICE /no/device line.

  7. Specify each device to include in the software RAID configuration on separate DEVICE lines, as in the following example:

    DEVICE /dev/mapper/device1-WWID
    DEVICE /dev/mapper/device2-WWID
  8. Save and close /etc/mdadm.conf.

  9. Run the following command to scan for software RAID devices and include them in mdadm.conf:

    # mdadm --detail --scan >> /etc/mdadm.conf

    Note

    This command is optional. However, including the software RAID devices in mdadm.conf helps the system assemble them at boot time.

    If any software RAID devices already exist, this command creates duplicate entries for them in mdadm.conf. In this case, you should use a different method to include the new software RAID device, as in the following example:

    # mdadm --detail --scan
    
    ARRAY /dev/md0 metadata=1.2 name=hostname UUID=RAID1_UUID
    ARRAY /dev/md1 metadata=1.2 name=hostname UUID=RAID2_UUID
    ARRAY /dev/md2 metadata=1.2 name=hostname UUID=RAID3_UUID
    
    # cp /etc/mdadm.conf /etc/mdadm.conf.backup
    
    # echo "ARRAY /dev/md2 metadata=1.2 name=hostname UUID=RAID3_UUID" >> /etc/mdadm.conf

  10. Confirm that the configuration includes the software RAID device.

    # cat /etc/mdadm.conf
    # For OVS, don't scan any devices
    #DEVICE /no/device
    DEVICE /dev/mapper/device1-WWID
    DEVICE /dev/mapper/device2-WWID
    
    ARRAY /dev/md0 metadata=1.2 name=hostname UUID=RAID_UUID
  11. Check the status of the software RAID device.

    # mdadm --detail /dev/md0
        /dev/md0:
              Version : 1.2
        Creation Time : time_stamp
           Raid Level : raid1
           Array Size : 55394112 (52.83 GiB 56.72 GB)
        Used Dev Size : 55394112 (52.83 GiB 56.72 GB)
         Raid Devices : 2
        Total Devices : 2
          Persistence : Superblock is persistent
    
          Update Time : time_stamp
                State : clean
       Active Devices : 2
      Working Devices : 2
       Failed Devices : 0
        Spare Devices : 0
    
                 Name : hostname:0
                 UUID : RAID_UUID
               Events : 17
    
          Number   Major   Minor   RaidDevice State
             0     251        0        0      active sync   /dev/dm-0
             1     251        1        1      active sync   /dev/dm-1

You can find more information about software RAID in the Oracle Linux documentation at:

http://docs.oracle.com/cd/E37670_01/E41138/html/ch18s04.html

1.3.1 Removing Software RAID Devices

You cannot use Oracle VM Manager to remove software RAID devices. You must manually remove these devices on Oracle VM Server as follows:

  1. Connect to Oracle VM Server as the root user.

  2. Stop the software RAID device.

    # mdadm --stop /dev/md0
  3. Remove the software RAID superblock from the devices.

    # mdadm --zero-superblock /dev/mapper/device1-WWID /dev/mapper/device2-WWID
  4. Remove the software RAID device from /etc/mdadm.conf.

  5. Remove the software RAID device from Oracle VM Manager.

    Note

    After you remove the software RAID device, Oracle VM Manager displays an event with a severity of warning. The event message is similar to the following:

    Warning time_stamp storage.device.offline. Physical disk is Offline
        No Description: OVMEVT_007005D_001 Rescan storage layer on server [hostname] did
        not return physical disk [md-UUID] for storage array [Generic Local Storage Array

    You can ignore this warning.