3.4. Upgrading to RHVH While Preserving Local Storage

Environments with local storage cannot migrate virtual machines to a host in another cluster (for example when upgrading to version 4.0) because the local storage is not shared with other storage domains. To upgrade RHEV-H 3.6 hosts that have a local storage domain, reinstall the host while preserving the local storage, create a new local storage domain in the 4.0 environment, and import the previous local storage into the new domain.
This process is based on the assumption that the Red Hat Virtualization Manager is version 4.0, and the compatibility level of the data center and cluster to which the host belongs is currently 3.6.

Procedure 3.2. Upgrading to RHVH While Preserving Local Storage

  1. Ensure the RHEV-H host's local storage is in maintenance mode before starting this process:
    1. Open the Data Centers tab.
    2. Click the Storage tab in the details pane and select the storage domain in the results list.
    3. Click Maintenance.
  2. Reinstall the Red Hat Virtualization Host, as described in Installing Red Hat Virtualization Host in the Installation Guide.

    Important

    When selecting the device on which to install RHVH from the Installation Destination screen, do not select the device(s) storing the virtual machines. Only select the device where the operating system should be installed.
    If you are using kickstart to install the host, ensure that you preserve the devices containing the virtual machines by adding the following to the kickstart file, replacing device with the relevant device.
    # clearpart --all --drives=device
    For more information on using kickstart, see Kickstart Syntax Reference in the Red Hat Enterprise Linux 7 Installation Guide.
  3. On the reinstalled host, create a directory, for example /data in which to recover the previous environment.
    # mkdir /data
  4. Mount the previous local storage in the new directory. In our example, /dev/sdX1 is the local storage:
    # mount /dev/sdX1 /data
  5. Set the following permissions for the new directory.
    # chown -R 36:36 /data
    # chmod -R 0755 /data
  6. Red Hat recommends that you also automatically mount the local storage via /etc/fstab in case the server requires a reboot:
    # blkid | grep -i sdX1
    /dev/sdX1: UUID="a81a6879-3764-48d0-8b21-2898c318ef7c" TYPE="ext4"
    
    # vi /etc/fstab
    UUID="a81a6879-3764-48d0-8b21-2898c318ef7c" /data    ext4    defaults     0       0
  7. In the Administration Portal, create a data center and select Local in the Storage Type drop-down menu.
  8. Configure a cluster on the new data center. See Creating a New Cluster in the Administration Guide for more information.
  9. Add the host to the Manager. See Adding a Host to the Red Hat Virtualization Manager in the Installation Guide for more information.
  10. On the host, create a new directory that will be used to create the initial local storage domain. For example:
    # mkdir -p /localfs 
    # chown 36:36 /localfs
    # chmod -R 0755 /localfs
  11. In the Administration Portal, open the Storage tab and click New Domain to create a new local storage domain.
    Define localfs as the Name and /localfs as the Path.
  12. Once the local storage is Active, select Import Domain and define the domain's details.
    For example, define Data as the Name, Local on Host as the Storage Type and /data as the Path.
  13. Click OK to confirm the message that appears informing you that storage domains are already attached to the data center.
  14. Activate the new storage domain:
    1. Open the Data Centers tab.
    2. Click the Storage tab in the details pane and select the new Data storage domain in the results list.
    3. Click Activate.
  15. Once the new storage domain is Active, import the virtual machines and their disks:
    1. In the Storage tab, select data.
    2. Select the VM Import tab in the details pane, select the virtual machine(s) and click Import. See Importing Virtual Machines from Imported Data Storage Domains in the Administration Guide for more details.
  16. Once you have ensured that all virtual machines have been successfully imported and are functioning properly, you can move localfs to maintenance mode.
    1. Click the Storage tab and select localfs from the results list.
    2. Click the Data Center tab in the details pane.
    3. Click Maintenance, then click OK to move the storage domain to maintenance mode.
    4. Click Detach to open the Detach Storage confirmation window.
    5. Click OK.
You have now successfully upgraded the host to version 4.0, created a new local storage domain, and imported the 3.6 storage domain and its virtual machines.