Total Pageviews

Wednesday, March 16, 2011

RHEV In a NutShell

RHEV Hypervisor Installation and  RHEV Manager  UI Deep Dive 

  Under this section we are going to complete tour of Installing and Setting up RHEV Hypervisor, RHEV Manager, starting from Creating Data Centre, Adding Cluster, Registering RHEV-Hypervisors as well RHEL as Hypervisors, Attaching storage, Creating and Managing Virtual Machines, Virtual Machine Snapshots, Templates, User and Role Management, Configuration Tuning and More .



Log in to RHEV Manager from  any of the Supported Browsers from your Desktop or you You can Go to Start-->All Programs-->Redhat-->RHEVManager-->RHEVManager IE TAB from the same machine where you installed RHEV Manager.



Browser Prerequisites:


A client with Windows XP and .NET Framework 3.1 with Service Pack 1, or Windows 7, is required to access the web-based administration portal. The client must be running Internet Explorer 7 or 8.


To connect to virtual machines with SPICE via the Red Hat Enterprise Virtualization administration portal, a SPICE browser plug-in is used. The SPICE plug-in for Internet Explorer is only compatible with 32-bit editions of Internet Explorer.


When using a 64-bit Windows operating system, you must install a 32-bit edition of Internet Explorer to use the SPICE plug-in. You must also make a global registry setting change to allow the WPF application to run as a 32-bit process. The process for making this change is described in Microsoft kbase article 974396


Note : If you get any Certificate Download error while downloading the WPF Certificate of RHEV Manager on your IE, You can disable the Internet Explorer Enhanced Security Feature by opening a ServerManager-->Configure IE ESC--->Select OFF.




Set up Overview

Some brief details about the set up we are going to use in our Demo.

RHEV Manager FQDN :   http://rhevmanager.rhev.in/
Admin User : rhevadmin
Domain :  rhev.in
Hypervisor 1: hyp1-ml350g6.rhev.in (RHEV-H)
Hypervisor 2: hyp2-dl580g5.rhev.in (RHEL as an Hypervisor)
DNS: rhev.in (With Forward and Reverse Lokk up configured for both hypervisors,RHEV Manager and storage in case of NFS and IscsI Set Up )

Lets starts with Login to RHEV Manager



Once you Logged in It will Take you to to Virtual machines Tab, But which will be  empty We are going to Set up  on our upcoming Section




To do that Go to Data Centres Tab . You will find a Default Data Centre in Uninitialized state.Either you can use the existing Default One or you can create a new as relevant to our environment.





Creating Data Centre


To Create a New Data Centre, Click on New under Data Centre Tab and fill as like below. In our Set up  We are going to Create a New Data Centre Named "Mumbai-DC1" with a Description of "Mumbai-Private-Cloud" with Storage type of FCP (Fibre Channel)  and Select the Compatibility Version to 2.2 and Click OK . I strongly recommend you to use rhev 2.2 instead of 2.1 since it comes up  with more features.


Note: I will cover  setting up NFS and ISCSI Data Centre Set up on Separate Blog and Its almost similar as like below with few changes




Once you Select  OK You will get a Pop up New Data Centre Guide Me screen as like Below, Select Configure Clusters




It will take you to the New Cluster Set up screen, Give the Cluster name "Web-Cluster" with some relevant description "Web Server Farms" and the Data Centre is going to be our newly Created Mumbai-DC1 by default, and from the Memory Overcommit Drop Down Menu Select " Server Load (150%) "  and From the CPU Name field Select your cpu type in our case its "Intel Xeon" and from the Compatibility Version select 2.2 and Click on OK




Next it will take you to Configure Host and Storage  as like below, Since we did not installed any Hypervisor, you can select Configure Later and Proceed to RHEV Hypervisor Installation.




As of now We created a Data Centre named Mumbai-DC1 and a cluster named web-cluster in that Data Centre.






Note: I will take you to the details of the Data Centre and Cluster Sub tabs in the upcoming section, so don't skip any of the below Section  and if you so it will work smoothly.



RHEV Hypervisor Installation


Download the Necessary RHEV-H Image from the RHN and burn it on A CD else you can use your USB drive as boo table media See below Link for more details on how to make your RHEV-H Boo table USB or if you have the RHN or any other PXE boot Server running environment you can integrate the one too . See below Link for more detail on USB and PXE Boo table of RHEV-H


Preparing a RHEV Hypervisor USB storage device
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Hypervisor_Deployment_Guide/sect-Deployment_Guide-Preparing_Red_Hat_Enterprise_Virtualization_Hypervisor_installation_media-Preparing_a_RHEV_Hypervisor_USB_storage_device.html


RHEV-H PXE Cobbler
http://rcritical.blogspot.com/2010/11/rhev-hypervisor-installtion-using-rhn.html




Once you Prepared the Install media Boot the Server with RHEV-H , and you will find a below screen after the Post Bios .


Type  boot: linux storage_init=/dev/cciss/c0d0 firstboot


Note: Replace cciss driver with your Hardware Hard disk driver eg: /dev/sda


You will find all other possible boot parameter on the Boot Menu or you even refer the below Hypervisor installtion guide for more detail


http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Hypervisor_Deployment_Guide/chap-Deployment_Guide-Installing_Red_Hat_Enterprise_Virtualization_Hypervisors.html






Now from the Configration Set up Menu Select and configure in the following  order







Configure Storage
Select  1) "Configure Storage Partition"





Select the default value to yes or you can configure manually by selecting "Review Option", In our section am selecting the default one or if you are not sure which disk to select you go back by selecting "Return to Back Menu".




Now Select "Commit Configuration" & Accept and Proceed








Setting Up Root Password & Enable  SSHD


Enable SSH Authentication and Set the Password by seclecting "Configure Authentication" and I strongly recommend to enable this so that it will easy for remote administartion in case of any issues.


set admin password : you root password





Toggle SSH Password authentication : To enable sshd daemon





Press "Retun to Menu"  once you set the password and enabled sshd

Configure Host name

Now Set the hostname of the Hypervisor by Selecting "Set the Hostname" Option.


Configuring Networking

Move to the Next Step Enable Networking by Selecting "Networking Setup"

Choose the interface eth0 or eth1 as per your environment & Select Yes or No to find out the actual eth0 or eth1



Now Enable or Disbale Vlan as per your requirement , Now am going to make this as simple by slecting No, i will take you the rhev vlan deep dive on a sperate blog

Then Select the IP either its going to be Static Or DHCP, Netmask, Gateway, DNS and NTP Server IP, in our case Weare using static network configuration . Then finally Select "Save and Return to Main menu"

Note: At any point of time if you want to check the logs or some other configuration you can use the Option "Support Menu" , it will give you an nice  shell to  troubleshoot.

Registering to RHN

If your hypervisor Connected  to the internet you can use the Option "Resgister to RHN" to register the hypervisor with the RedHat Network Satellite.

Configure RHEV Host

We moved on to one of the important Phase , registering the hypervisor to the Red Hat Enterprise Virtualization Manager by slecting "Configuring the Host for RHEV"

Here you can give either the IP of the RHEV Manager or the Hostname , Hostname is prefered.In our case its rhevmanager.rhev.in, and set the Netconsole as same as rhevmanager.rhev.in ,If you dont have any network or dns  issue you will find the RHEVManager address is set as a output on both the option.

Finally  Select "Install Locally and Reboot", it will ask you to provide any extra kernel paramet leave default and Press Enter to Continue  , once the installtion is over it will go for a reboot .


Now the time to move into RHEV Manager UI and Proceeds rest of the Set up like Approve the Host and Attaching theStorage etc.


Adding RHEL Host as an Hypervisor in RHEV


Check my below Blog to  use RHEL 5.4 & Later as a Hypervisor in your RHEV Set Up 


.http://rcritical.blogspot.com/2011/03/adding-rhel-host-in-rhev-manager.html


Approving RHEV-H or Adding RHEL Host on the RHEV Manager

Log into RHEVManager-->>Go To Host Tab Now  You will  see the hypervisor we installed in our last step, will Pending for approval.


Select the host--> Right Click and Approve


Edit and Select cluster Name from Default to your Cluster Name in our case its web-cluster, and  Enable Power Management with the IP,Username,Password,Port and extra options as per your server remote management and Click on Save


Now RHEV-M  will check all the Hardware and Software Prerequise, Install ssl  cerificates  and Comes Up , You will get detailed Logs under the Events tab on the Down Pane.


After few seconds  hypervisor will come up  and you can simply ignore the failed to connect host to storage domain error as you see under the events tab of the below screen shot , because we are yet to attach the storage domain in the RHEV data center.

What is SPM?

Also if you see on the Host Tab there is an option called SPM status , SPM stands for storage pool manager , it will control and manage storage related locks on the data centre . So on every data centre there should be one SPMhost no matter how many cluster running on that Data centre, it will manage the storage . Once you attach the storage you will see the above host we approved become an spm . we will see more about in detail in the following section.


Adding Storage Domain

Now the Next step is to Add a Storage Domain . In RHEV for any Data Centre to be active you need atleast a singleData storage domain in short SD , to be added under the Storage Domain  and attached to the corresponding Data Centre. Always one of the disk in the Data Centre will be the Data(Master) , even though if the Data centre is running with mutiple data disk .

What is Data & ISO disk under RHEV Storage Domain?

So data disk is nothing but disk where you are going to store the virtual machine  iamges and there is a other disk called ISO disk , it will be used to strore all you ISO  software libraries required to spindle up new virtualmachines as well as to attach CD or Software or RHEV Guest agents tools on to the virtual machines as a cdrom device.

Export and Import Domains

Apart from the above two disk you can even attach the export disk where you can take the virtual machine backup , and you can use the same export disk and attach it to other data centre as a import disk  and import the  virtual machines . So this will be usefull in moving the virtual machines across different data centres . I will coverup the virtual machine export and import of  RHEV in a seperate blog.

Virtual Machine Image Back end Storage format

 In case of nfs storage all the virtual machnies images are created and stored as file whereas in ISCI or FCP storage , every virtual machine, snapshots and templates are stored as a logical volume .

Hope you get a good basic idea about RHEV Storage Domains lets move and see how we can attach the data and iso disks.

Attaching a Data and ISO Disk

Once the Host is Up, Go to Storage Tab-->New Domain-->Select Domain Function as "Data" and Storage Type as "FCP" ,Provided If you already assigned the LUN from you storage to the Hypervisor , it will  try to scan and retrieve n and show you the List of Presented LUN to the Hypervisor as like below. Give some relevant Name to the data disk for example we had given Mumbai-dc1-data1 you can see in one snapshot later below

What is the difference between  "Build New Domain" and "Preconfigured Domain" ?

Leave "Build New Domain" as default since we are doing an fresh set up . "Preconfigured Domain" Will be usefull in a scenario where you don't have full control over you storage environment , so in that case your storage admin create raw volume group and provide  the detail to you , so that you can use this Preconfigured Domain option to import such raw fresh Storage Volume group already created on top of the LUN which is presented  either from you FCP or ISCSI Storage.

Use Host

 Since we have only one approved host , you can use that host in Use host: tab and if you have multiple host already approved on the data centre or in the specific cluster  and presented the same LUN to all  the you can user any host by selecting it using the drop down box.


Now Select the Disk you want to attah and "Add" it using the Down Arrow Key and Click 
OK


After that If there is no error , then the disk will show as "Unattached State" under stroage tab . If you get any error , Log into RHEV Hypervisor and check /var/log/vdsm/vdsm.log to find out  for what reason it getting failed. I will cover about RHEV troubleshoting & RHEV Log files in a sperate blog.


Now we attached the first data disk in the Storage Domain . Now to attach to the specific data centre in our casefor Mumbai-DC1, Go to Datacentre-->Mumbai-DC1-->Select Attach Domain Under Storage Sub section in the Down Pane. You can see the Disk what we attached, select the disk(Mumbai-DC1-Data-1) and Click OK


It will take some time, Disk will go in Locked state and it will become active in some seconds .  See below snapshots the disk is active and since this is the first disk in the DC, it tooks a role of Data Master and the Data Centre Mumbai-DC1 comes to UP and Active State.


Attaching NFS ISO Library

 To attach a NFS iso disk we need one nfs exported empty disk with write permisssion for the Hypervisors , for that we already exported empty nfs export disk with the owner and group permission set to 36:36 on the nfs server .This 36:36 ownership  is manadatory for any nfs exported disk you are going to use with rhev storage.

Setting up NFS Storage  exports on RHEL for RHEV ISO Library or RHEV Data Disks

The below steps also  applicable to RHEV NFS storage data centre and use NFS data disk to store virtual machines. Log into NFS  server console and check, In our case the export disk is /rhev-22-iso and the NFS is running on RHEL5.

#[root@nfs1 ~]# ls -ld /rhev-22-iso/
#drwxr-xr-x 3 root root 4096 Mar 15 01:31 /rhev-22-iso/

Change the Ownership to 36:36

#[root@nfs1 ~]# chown 36:36 /rhev-22-iso/
#[root@nfs1 ~]# ls -ld /rhev-22-iso/
drwxr-xr-x 3 36 36 4096 Mar 15 01:31 /rhev-22-iso/

Cross verfiy the export disk is empty

[root@nfs1 ~]# ls -al /rhev-22-iso/
total 28
drwxr-xr-x  3   36   36  4096 Mar 15 01:31 .
drwxr-xr-x 36 root root  4096 Mar 15 02:00 ..
drwx------  2 root root 16384 Mar 15 01:31 lost+found

To export the Disk,  open /etc/exports and put entry like below

[root@nfs1 ~]# cat /etc/exports
/rhev-22-iso *(rw)

Refresh the export and start portmap and nfs daemon

#[root@nfs1 ~]# exportfs  -rav
exporting *:/rhev-22-iso

Note: In case on your RHEL NFS server selinux is enabled please configure proper labels for the exports

Now go to RHEVManager-->Storage-->New Domain-->Select Data Function to "ISO" and storage type to "NFS"


Note: Remove the last forward slash after the export as i wrongly captured in above diagram

After that If there is no error , then the ISO disk  will show as "Unattached State" under stroage tab . If you get any error , Log into RHEV Hypervisor and check /var/log/vdsm/vdsm.log  ti find out for what reason it getting failed.


Now we attached the ISO disk in the Storage Domain . Now to attach to the specific data centre in our case for Mumbai-DC1, Go to Datacentre-->Mumbai-DC1-->Select Attach ISO Tab  Under Storage Sub section in the Down Pane. You can see the Disk what we attached select the disk(Mumbai-DC1-ISO) and Click OK


It will take some time, Disk will go in Locked state and it will become Inactive  in some seconds. Select the Disk and Click on Activate Button to make it active on the Data Centre.



Note: If you are running multiple data centre there is no need to create seperate ISO library for each  instead you can detach from one data centre and attach to other data centre. Apart from the first data disk you attach a new data centre rest of the disk to be activated manaully else it will always in Inactive state after attached todata centre from the Storage Domain.

So we are having both Data disk and ISO disk active in a RHEV Data centre, Now we can Push some ISO's , to spindle up some new virtual machines.

Uploading ISO's in RHEV

In our example am going to show you the deployment of RHEL6 and windows 2008 Virtual Machines and   how to install RHEV guest tools to install guest agents and virtio block and network drivers for better performance.

Also  am going to upload virtual floppy drives image that contains the virtio block and network drivers to use with os disk  while installing windows virtual machines to provide virtio driver for the Hard disk and NIC for better performance instead of using IDE as an Hard disk inside the virtual Machines .

Note: For RHEL5 Update 4 and Later and RHEL 6,  virtio drivers are integrated into kernel by default so there is no need to manully install any virtio performance drivers for  these RHEL Versions.

To upload ISO Go to the windows RHEV Manager server and Start-->>All Programs-->RedHat-->RHEVManager-->ISO Uploader-->Add-->Browse the ISO path from your local or network drive--> Upload. In our below example am uploading the RHEVGuest tools iso on to the ISO library.


 Use the same step to upload RHEL or windows ISO. If you want to do some bulk upload you can even scp the iso from the source to the remote nfs iso export library path . But it is not recommended but it will work smoothly and fastly as well. To do it from scp command line log in to nfs server and find the path to copy

[root@nfs1 ~]# ll  /rhev-22-iso/9f740b2c-a15a-4666-8f5a-c934f5711bbb/images/11111111-1111-1111-1111-111111111111/ 
total 103044
-rw-r--r-- 1 36 36 105406464 Mar 16  2011 RHEV-toolsSetup_2.2_47513.iso

Note: Second directory with random Alphanumeric number (9f740b2c-a15a-4666-8f5a-c934f5711bbb) will vary across set up , scp the iso on to this path and change the ownership to 36:36 as like below.

From your iso dumps server copy the iso to the nfs iso library

# scp -r rhel-server-6.0-x86_64-dvd.iso root@nfs1.rhev.in:/rhev-22-iso/9f740b2c-a15a-4666-8f5a-c934f5711bbb/images/11111111-1111-1111-1111-111111111111/

Once the iso uploaded then you can go to virtual machines tab and start creating the virtual machines.


Creating Virtual Machine on RHEV

Virtual Machine General Information Tab

Lets start with creating a RHEL6 Virtual Machine. To do do Log into RHEV Manager-->Virtual Machines-->New Server and Feed the Necessary Inputs. Under General Tab configure  Data Centre: Mumbai-DC1, Host-Cluster:Web-Cluster, Default Host:Auto Assign (Leave to default its recommended for virtual machine High Availabillity), Name: RHEL6-WEB(VM NAME), Description: RHEL6 Web Server , Based On Template: Blank(since this is our first virtual machine I will cover up template in the later section) , Select Memory,Cores and Cpus and Operating System Type from the Drop Down Menu.

Note: Only the Operating system available in the Dropdown box menu of Operating System Filed is supported and tested on RHEV Virtualization Infrastructure.




Console Tab

Then on Console Tab Keep VNC as default you can even use SPICE protocol, but i prefer SPICE only for VDI rather for any servers class systems  , USB Policy is default disabled for Server and its only for Desktops , In our example i am going to use VNC and i will cover spice in a later section or in a seperate blog for VDI.

Virtual Machine High Availlabillity Tab

Moving to High Availability Section You can either enable or disable Virtual machine HA based upon the criticallity of the service its running and even you can select priority as like low, medium and High.

 So in a scenario if the host runnning the virtual machines went non responsive for some reason , then the virtual machines which are all marked HA will start migrate to other available host in the same cluster . The vm with High Priority will move first , Medium Next and Low Last .

Since we are running only a single host on the cluster am not enabling this for time being, once we added second host to the same cluster in the data centre , I will cover this and Virtual Machine Live Migration in detail later.

Boot Sequence Tab

Under this you can set First & Second Boot Device, and even you can attach CD once the Virtual Machine was created. Leave Default when you are creating the virtual machine for first time .

After given all the information , you will get "Guide Me" Popup to  add a NIC and Virtual Disk for the Virtual Machine


Configuring NIC for Virtual Machine

Select Configure Network Interface-->Name(nic1)-->Network(rhevm) first logical network you can change as relevantto your environment --> Type(Redhat Virtio) --> If you want you can even specify MAC Address as well-->OK


Note: For RHEL3 & RHEL4 till RHEL4U5, RHEL5 to RHEL5U3 you can't use virtio so in that case select network drivertype to e1000 driver and for RHEL5U4 & later release you can use virio drivers  and for windows you can use Redhat Virtio for better performance when compared generic rtl8139 driver. Its applicable to Virtual Hard disk as well

Configuring Virtual Disk

Select Configure Virtual Disk--> size of disk (5 GB)-->Storage Domain: Mumbai-DC1-Data1(Data Disk Where you want to create te virtual machine)-->and in Advanced Tab-->Disk Type: system (since this is first os installer disk ifyou are going to atttach second disk it sholud be data)-->> Interface: virtio (Hard disk driver for better performace)-->>Format:Preallocated (for better server workloads and you can select thin provisiong for lesser I/O loads or for  dekstops) and Generally for fist virtual disk of vm Bootable flag is enabled and wipe after delete will delete complete refernce about this virtual machine from the storage when you deleted the virtual machine from the RHEVM and this is for security reasons.


Once you click on Ok , Guide me Windows will ask you for option additional NIC and virtual disk configuration youcan safelly Ignore by configure later option then  the Virtual Machine Image will go in  Locked state for few seconds then comes down to Down state

Starting the Virtual Machine for First Time


Now you can start the virtual machine installtion by following the below steps

Select the virtual machine--> "Run Once" (This is only to be run if you are installing for first time or your aregoing to dual boot or reinstall the existing OS else to start the virtual machine you must  always to use "Run" not "Run Once")


Under Run Once Select Boot Options : Select Attach CD-->Select the ISO to use -->> Leave Rest Default and Click OK



Attach Floopy : It will be usefull for windows guest to provide virtual floppy drivers I will Cover later

Boot Sequence : No need any extra fancy explanation

Start in Pause Mode : In case if you are dual booting or starting the virtual machine using PXE this will be helpfull it will boot phase  by phase.

Run Stateless : Its to create stateless virtual machines in short what ever stored on the guest won't persist across guest reboot

Virtual Machine Console

Once the Virtual Mahcine Powered Up Completly, Select the Virtual Machine-->Right Click-->Console.





Then follow the OS install instruction  as per the Operating System guide and deploy your application and test.


Windows Guest Installation


 Check my Below Blog for windows guest installation on RHEV and the rhev guest tools setup .

 http://rcritical.blogspot.com/2011/04/windows-virtual-machine-with-rhev-guest.html

 I will cover up virtual machines snapshots, Templates and User Management and rest of RHEV in next couple of days under the same or in a separate blog as per the topic .

Hope it all helps you guys and your Comments and suggestions are always welcome to improve further.

2 comments:

Andres Mujica said...

great guide, thanks for sharing

Anonymous said...

Awesome man...