How to attach and detach direct LUNs to Virtual Machines in oVirt Setup
Hello Techies, there are some scenarios where we are required to present Direct LUNs and RDM Disk to Virtual machines under oVirt / RHEV Setup. In this article I will demonstrate how to attach and detach Direct LUNs to Virtual machines hosted in oVirt Setup.
Let’s suppose I have non-production Data center and under this DC I have one Cluster with name “Non_Prod_Cluster” and under this cluster I have two ovirt host or ovirt hypervisor.
Let’s assign 100 GB Direct LUN to CentOS7 Virtual Machine.
Step:1 Login to your oVirt Manager Portal.
First login to oVirt engine / oVirt Manager and select your data center and then click on the Disks Tab
Click on New
Select the ‘Direct LUN‘ option, then specify the followings, In my case I am using beneath
- Alias : direct_lun_centos7
- Description: Automatically Populates
- Datacenter : Automatically Selected.
- Use Host : Specify the Host on which LUN is directly attached via Fibre Channel
- Storage Type : Fibre Channel / iSCSI
Click on OK
Step:2 Select the VM on which we want attach Direct LUN
Click on Virtual Machines Tab and then select the Virtual Machine (CentOS7_Server) on which we want map or present Direct LUN and then Click on Disks Tab for the selected Virtual Machine.
Click on Attach Option from Disks Tab,
Click on Direct LUN option and then Select the LUN that you want to map or present to the VM, In our previous step we have added alias to our Direct LUN, So we can select LUN by its Alias
When we click on OK, the it will map the direct lun to the VM
To verify the LUN details like its LUN ID, Serial Number and Vendor ID click on Direct LUN option from Disk Tab.
Let’s Verify from the OS as well whether new 100 GB LUN is visible or not. Login to your virtual machine run ‘fdisk -l‘ and ‘multipath -l‘ command,
Detach Direct LUN from Virtual Machine in oVirt Setup
To detach Direct LUN from virtual machine refer the following steps:
Select the LUN from Disks Tab of Virtual Machine and then click on Deactivate
Click on ok
Once the LUN is deactivated then remove it by clicking on Remove Option from the Disks Tab
Click on Ok
Now Verify from OS side as well whether LUN has been removed or not, Run ‘fdisk -l’ and ‘multipath -l’ from the terminal
As we can see there is no disk of 100 GB present on the server as well , so we can say LUN has remove successfully from the server as well.
That’s all from this article. I hope you got an idea how to map direct LUN to a virtual machine in oVirt Setup. In the past we have already discuss the following topics on oVirt.