Configuring RHEV-M — Step-by-step

Let’s look at how to install and configure the Red Hat Enterprise Virtualization Manager (RHEV-M), using a server running Windows Server 2003 R2.

We need at least three machines for configuring RHEV-M:

  1. The Windows Server 2003 R2 server — we’ll install the RHEV Manager here.
  2. An NFS Server — we’ll put up a directory that contains all the ISO images, and share it from here.
  3. The Hypervisor — this machine will be the server that actually hosts all the running VM (virtual machine) instances.

To begin with, let’s first configure the RHEV Manager server.

The RHEV Manager Server

First, install Windows Server 2003 R2 on a server. I won’t be elaborating on how to do that — Google is your friend. Once installed, run Windows Update, and then join the server to your Active Directory — such as KAPIL.COM. Create or configure a domain user (such as ‘kapilm’ in my case) with Administrator privileges, so that the user is capable of adding machines to the domain.

Next up, head to Control Panel and run “Add or Remove Programs” and click “Add/Remove Windows Components” (available as a button on the left-hand side of the Add/Remove window). On the Components window pop-up, select “Application Server” (check the Details box to enable all the options like ASP.NET, DTC, IIS, etc). You’ll need both the Windows Server 2003 R2 discs to complete the process.

Before you can install RHEV-M, you’ll need some pre-requisite stuff installed on your Windows Server 2003 R2 Machine:

  1. You’ll need to have Windows Server 2003 R2 itself updated with the latest patches and Service Pack 2.
  2. You’ll need this server joined to an Active Directory (AD). We already did this above, but in case you skipped that step, RHEV won’t work without AD. So if you don’t have an AD, just create one in this machine.
  3. You’ll need the Microsoft .NET Framework 3.5 SP1 installed. You can download it from the Microsoft Download Center. Remember that .NET is not cumulative, so installing .NET Framework 4 will not install all the features of .NET 3.5 SP1.
  4. You’ll also need to have Windows PowerShell 2.0 installed. (This is installed by default if you’re using Windows Server 2008 or Windows Server 2008 R2).

Now it’s time to install the actual RHEV Manager. Locate the rhevm-2.2-<something>.exe installer file (where, something will be the version number), and double click it. Now:

  1. In the first step, review and accept the EULA.
  2. Continue till the “Features You Want To Install” step. Leave the settings as per their defaults, and select SQL Server 2005 Express. Hit next.
  3. The setup will now ask you to set default password for the SQLEXPRESS user (the user name is sa, by default). Set your password and click Next.
  4. Now it will ask you to either select a “web site” from the drop-down list or create a new one. Just in case, you’re confused in here — the “web site” is the Web-based RHEV-M user interface. By default, the drop-down list should display “Default Web Site”. We’ll let that be — that is, we won’t enable the option to create a new site. Before hitting next, make sure the “Force SSL” option is checked — this is to ensure that connection to RHEV-M is always secure.
  5. You’ll arrive at the RHEV Manager Domain and User screen. Fill in all the details from your Active Directory setup, like:
    • Domain: kapil.com (our example AD Domain, remember?)
    • Username: kapilm (this is the user that we created with admin rights)
    • Password: <AD user password>
  6. On the Certificate Details Screen, enter your Organisation name and the FQDN for your server in the appropriate fields and hit Next.
  7. The Console Port screen should come up. Keep the default port (25285), and hit Next. This should finish up the installation process.

Now head to Start –> Programs –> Red Hat –> RHEV Manager –> RHEV Manager. It’ll ask for login credentials. The login credentials should be the ones that you supplied when you set up your Active Directory; so go ahead and sign in with those details. And done — RHEV-M has been set up correctly!

The iSCSI/NFS Server

We’ll set up a iSCSI or NFS Server to remotely host our ISO images in one place. The advantage of doing this, rather than putting the ISO files inside the Hypervisor machine, is we can pop in new ISOs or edit existing ones from any machine.

So here’s how we do it (I’ll show you how to do it the NFS way; if you want iSCSI, Google for the appropriate howto):

  1. Make a directory to store the ISO images (make sure that it will have enough space to hold all the ISO images):
    mkdir /iso
  2. Add the following line to your /etc/exports file:
    /iso     *(rw,sync)
  3. Run the following commands to finish the NFS setup:
    service portmap start
    chkconfig portmap on
    service nfs start
    chkconfig nfs on

To check the NFS exports from a given machine, run the following from a Linux box:

showmount -e

We’ll now go ahead and populate the /iso/ directory with our ISO files for the operating systems we want to deploy as virtual machines. Remember, the ISO file names should ideally not have spaces in them, as that can create major headaches with cryptic file-not-found errors.

Run the following command to properly set permissions for the ISO directory:

chown -R 36:36 /iso
# chmod g+s /iso
The Hypervisor Machine

Boot your Hypervisor machine with the RHEV Hypervisor CD. It’ll be a standard Anaconda-based installation, so you’ll be entering details according to your own scenario. The machine should be up and running in no time. However, take note if you’re using HP Smart Array for storage: your device might be detected as /dev/cciss/c0d0, so when you’re booting up, you’ll have to edit the kernel command line and add storage_init=/dev/cciss/c0d0, where /dev/cciss/c0d0 is your device name on the server

The LUNs that have been exported from SAN boxes are usually auto-discovered and configured when using RHEV-M. However, if for any reason the LUNs require manual authentication, you’ll have to dive into the iSCSI config files on the Hypervisor server, like:

Now edit the newly created /config/etc/iscsi/iscsid.conf appropriately. It typically looks like the this — you need to add the required information at the right places:

# for login
node.session.auth.username = My_ISCSI_USR_NAME
node.session.auth.password = MyPassword
# for discoery
discovery.sendtargets.auth.username = My_ISCSI_USR_NAME
discovery.sendtargets.auth.password = MyPassword

We’ll first confirm the changes done to the above file, like:

iscsiadm -m discovery -t st -p <IP-address-of-the-machine>

This will discover all the exported LUNs. Now we’ll log in to the iSCSI Target, like:

iscsiadm -m node -T targetname -l

We’ll now run fdisk -l, and hopefully see the LUN that we attached, in action.

It should show something like /dev/dm-0, which means we’re all done.

Finally, we have to reboot the system so that it copies the config files from /config/etc/iscsi/iscsid.conf to /etc/iscsi.

One last thing: if you allocate a LUN to a VM, and then delete the VM, you might face issues when you try to reuse the existing LUN in a new VM. The trick is to zero-write the LUN, and here’s how to do it:

  1. On hypervisor machine check the LUN number by:
    fdisk -l
  2. This will show all the attached disks, including the LUNs. Let us assume that /dev/md-0 is the LUN that we want. So to zero-write it, we do:
    dd if=/dev/zero of=/dev/md-0

14 Comments

  1. Rajveer Singh says:

    Very good article..!!!

  2. Rajveer Singh says:

    Very good article..!!!

  3. jlchannel says:

    Just wonder you try out RHEV & RHEVM High Availability or not?

  4. jlchannel says:

    Just wonder you try out RHEV & RHEVM High Availability or not?

  5. Amitrithalia says:

    Kya Kapil sir ….. Mast Blog. and it is useful for me.

  6. Amitrithalia says:

    Kya Kapil sir ….. Mast Blog. and it is useful for me.

  7. registrycleaner says:

    The LUNs that have been exported from SAN boxes are usually auto-discovered and configured when using RHEV-M.

  8. registrycleaner says:

    The LUNs that have been exported from SAN boxes are usually auto-discovered and configured when using RHEV-M.

  9. Ganesh Pagade says:

    Hi Kapil, I am trying to evaluate the possibility of installing RHEV-M on a VM instead of on a physical box. Have you tried doing this? If not, do you see any issues in doing this? Thanks.nnnnnnnnf nnnnn

  10. Ganesh Pagade says:

    Hi Kapil, I am trying to evaluate the possibility of installing RHEV-M on a VM instead of on a physical box. Have you tried doing this? If not, do you see any issues in doing this? Thanks.

    f

  11. A.Jesin says:

    Hi Kapil is RHEV available for trial ? Where can I download RHEV ?

  12. Ram says:

    Really good one, simple and user friendly to understand the concepts and how to deploy RHEV

  13. praveen says:

    can we have RHEV-M and Hypervisor on the same machine?

Leave a Reply

Your email address will not be published. Required fields are marked *