Archive

Posts Tagged ‘Harddrive’

How to add an additional hard drive to Xenserver

September 9, 2011 Leave a comment

1. Login the server as root. list all available physical disk with command “fdisk -l”

Here is my output:

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 523 4194304 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 523 1045 4194304 83 Linux
/dev/sda3 1045 19457 147899713 8e Linux LVM

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

2. The new drive i need to add to the host is /dev/sdb in my case.
Let’s get the UUID of your xenserver by using this command “xe host-list”
You should see something like this:

uuid ( RO) : 4fd93ca2-2f60-4387-9fb0-b8abc34b7526
name-label ( RW): xenserver-lgsgdjzo
name-description ( RW): Default install of XenServer

3. Create a new XenServer storage repository by using the  one of the following options(Make sure you use your own uuid instead of my):
Option1:create a normal LVHD storage repository. This is by the way the default storage repository type. (The following code should be typed in one line in your terminal)

xe sr-create host-uuid=4fd93ca2-2f60-4387-9fb0-b8abc34b7526
content-type=user type=lvm device-config:device=/dev/sdb 
shared=false name-label="Local storage 2"

Option2:Create a LVHD storage repository with thin provisioning support.(The following code should be typed in one line in your terminal)

xe sr-create host-uuid=4fd93ca2-2f60-4387-9fb0-b8abc34b7526
content-type=user type=lvm device-config:device=/dev/sdbshared=false
name-label="Local storage 2" sm-config:allocation=thin

Option3: Create a EXT storage repository with thin provisioning support and direct access to the vhd files.(The following code should be typed in one line in your terminal)

xe sr-create host-uuid=4fd93ca2-2f60-4387-9fb0-b8abc34b7526
content-type=user type=ext device-config:device=/dev/sdbshared=false
name-label="Local storage 2"

Done !

Advertisements
Categories: Xenserver Tags: ,