Installation of Centos 6.5 on ESXi 5.1 with RDM in RAID1 + LVM

Like probably everybody you have important files, backups etc etc you want to store so you cannot lose them. I have been thinking some time to think about my solution.
On this VM i will set up RAID1 softwareRAID and put NFS shares on it. I’ll be able to write backups and use rsync for important files between my 2 locations (10km distance). This way I have a semi professional solution on keeping my files safe.

**Note: This is an advanced installation. I will not cover all (basic) aspects of the centos 6.5 installation. I will assume you know certain things already. My scope lies on the RDM disks and creating the softwareRAID 1 + LVM.

I decided the following things:

OS: Centos 6.5
Memory: 1024MB
Diskspace OS: 10GB
Diskspace storage: 1TB
However: Software RAID 1 (so that will be 2 disks in mirror)

Step 1: Create RDM disks
I am running ESXi 5.5 on the HP server. And I need to create 2 RDM disks, because I didnt want to spend another 300 euro’s on a proper raid controller.

Let me give you an advice up front. Please be very carefull on the command line in ESXi. It is slighty different from regular linux!

The steps to creat the two disks are fairly easy:
Ssh into the machine as root!

Now we can see two disks underneath. Those two will be the RDM disks. Please double check within vsphere if you are selecting the correct disks!
Copy the two RAW Id’s we will be needing them later to create the RDM.
We now go to the default datastore to see where we need to create the RDM files.

As you can see my datastore is called datastore1. Let’s create a folder called RDM here. So we can store the .vmdk files

Next we will actually create the RDM disks:
*tip: if you want to use spaces (which I tend to discourage). You have to use quotes on the location of your vmdk.

In total four files will be created in your RDMdisks:

Step 2: Mount the RDM files in ESXI
In vsphere go to the settings of the VM you want the RDM disks on.

Now let’s follow the steps on the pictures to add the two disks:

click add

Now add the RDM disk

Repeat the steps above for the second disk.

After you’ve added them, press okay and vsphere will state it is reconfiguring the virtual machine.

If you’ve done everything correctly it will show similar to this

**note: Don’t forget to attach the centos iso to the cdrom!

Step 3: Configuring software RAID1 and LVM
Oke lets power up the VM and get into the Partitioning tool.
Be sure to choose custom layout!

So first is my OS disk setup:

/boot is a standard partition:

Next we’re creating the LVM physical volume:

After that the LVM volume group:

And the logical volumes:
I’ll give one example. You can use the best case sizing below.

/ 2500MB – vg_pandora – ext4
/var 2000MB vg_pandora – ext4
/opt 2000MB vg_pandora – ext4
/tmp 1000MB vg_pandora – ext4
swap 2000MB vg_pandora – ext4

After you’ve set the base disk up. It will look like this:

Now we are going to setup the software raid + LVM.
This basically goes like this.
First you make RAID partitions of sdb and sdc.
After that you creat a RAID device with both partitions in them, in addition we will set up the LVM.

Setting up LV on the RAID configuration:

After all these actions. You should have an overview like this:

Now press NEXT. You will get a screen asking if you want to format. In my case the disks are empty so i want to format them. Also we choose ext4 and xfs filesystems. So the partitions should be formatted with them.

Step 4: Continue installation and reboot.
This basically is just waiting until installation and you can reboot.

Leave a Reply

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