Xenserver 6 – Create an Addtional Local Storage Respository with Thin Provisioning Support

ShippingSo recently I deployed 3 XenServer 6 hosts with local storage only. Our need was to virtualize approx 6 very old Centos QA servers running on ancient hardware.

Since I did not have any dedicated network/san storage at my disposal I stuck 6, 146 SAS drives in each server and carved them up into a 410GB raid 10 array.

However the XenServer install did not detect this secondary logical disk, so I had to figure out how to manualy create a storage repository using this new drive.

The first thing that I needed to do was to see how the disk was identified by the OS, for this I used fdisk

#fdisk -l

Disk /dev/sdb: 440.3 GB, 440345714688 bytes
255 heads, 63 sectors/track, 53535 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Using the output above I was easily able to determine that my secondary drive was /dev/sdb.

So first this i did was to determine the UUID of the host that I was logged into

xe host-list

Which spit out the output below

# xe host-list
uuid ( RO) : 4a9971f7-1e59-4e02-b849-04d206ee7b2b
name-label ( RW): xen01
name-description ( RW): Default install of XenServer

Then I ran the following command to create my new SR on /dev/sdb on xen01

xe sr-create host-uuid=4a9971f7-1e59-4e02-b849-04d206ee7b2b content-type=user type=ext device-config:device=/dev/sdb shared=false name-label=”Local storage 2″

Then I confirmed that the new SR was created

xe sr-list host=xen01

Note that one fo the things that I found most odd with this process is that you do not actually create a partition on your disk before turning it into a storage repository.

Advertisements

Add a New Disk/Lun to RHEL5/CentOS5 without Rebooting

Ming Honestly I cannot believe that i have not put this one up on Fatmin before. I have to add new disks to RHEL servers all the time and can never remember I can never remember this procedure. I end up hitting up google all the time.

Anyway the command below causes a rescan of the scsi bus which is what you need to do for your server to detect a newly added disk. I find myself doing this on virtual machines all the time. Oh and for the love of all that is holy, please create your new disk a logical volume, and dont be lazy and just format the disk and stick a filesystem on it.

In this example I am using host0 as the target, however this may differ on your box.

echo “- – -” > /sys/class/scsi_host/host0/scan

Resolving SCSI Reservation Conflicts/Locks in Vsphere 4.0

Blue_lock-main1A few days ago we got hit with a ton of alerts which indicated that a handful of VMs were down, then up, and down again. This cycle continued several times.

At first, after a bit of digging through logs, we thought that the issue was related to scsi reservation errors, but we were already compliant with the best practices for 3PAR mentioned here. So we dug deeper and found that we were in fact suffering from SCSI locks. Go here for more information.

 According to VMware…

"The second
category involves acquisition of locks. These are locks related to VMFS
specific meta-data (called cluster locks) and locks related to files
(including directories). Operations in the s
econd category occur much more frequently than operations in the first category. The following are examples of VMFS operations that require locking metadata:

  • Creating a VMFS datastore
  • Expanding a VMFS datastore onto additional extents
  • Powering on a virtual machine
  • Acquiring a lock on a file
  • Creating or deleting a file
  • Creating a template
  • Deploying a virtual machine from a template
  • Creating a new virtual machine
  • Migrating a virtual machine with VMotion
  • Growing a file, for example, a Snapshot file or a thin provisioned Virtual Disk

To resolve a SCSI Lock, log into each of your ESX boxes and run the following command. 

# esxcfg-info | egrep -B5 "s Reserved|Pending

Look for the output below, as the host that has "Pending Reservation" value greater than one is causing the lock.

|—-Pending Reservations……………. 1

Now reset the lun.

vmkfstools –lock lunreset /vmfs/devices/disks/vml.02000000006001c230d8abfe000ff76c198ddbc13e50455243


Raid Levels Explained and Simplified

b39c97c1c0dfbdc1eb7636c231493133
As a Systems Administrator, I deal with Raid 1(mirroring) pretty much exclusively. Hell, nowadays when building a server the server automatically mirrors your Operating System disks for you, which means that you do not even need to understand what is happening behind the scenes. You just pop your two drives in your server and go. However the world of the San Administrator is much more complicated.

First off its important to know that RAID stands for either “Redundant Array of Independent Disks”, or less commonly  “Redundant Array of Inexpensive Disks”. Either way you slice it (pun intended) the basic idea of RAID is to combine multiple hard disks to either increase performance or increase redundancy.

Before I get started its important to introduce the term LUN. A LUN is a logical disk that consists of raw physical
disk space.
LUNs are created as a basic part of the storage provisioning process. They are presented across a SAN to a server as a single physical disk.

Note that the title of this article is “Raid Levels Explained and Simplified“, and when I say simplified I mean it. I am going to give a brief overview of most of the common RAID levels and then present a weakness and strength. Scroll down to the bottom of the article for links to more in depth articles and web pages. 

 

RAID 0: Striped…No Fault Tolerance

OK, in my opinion, and in the opinion of many other, RAID 0 is not even RAID, because there is no redundancy. If a disk fails, you are toast. Basically your take a slice of two disk or more disks and create a LUN. For example lets say that you as the Sysadmin request 1 80GB disk from your local SAN Admin. In the scenario below your SAN guru would carve 8 10GB blocks and present them in order (block 1,2,3,4,5,6,7,8) to you as a single LUN. RAID 0 provides good read and write performance. In the end RAID 0 is striping which is the most important thing that you probably need to know about it.

Raid0

Continue reading