Home » Virtualization » How to attache new hard drive on xen server

How to attache new hard drive on xen server

This article will help you to attache new hard drive on xen server. Xen storage repository supports IDE, SATA, SCSI and SAS drives when locally connected, excluding iSCSI, NFS, SAS and fiber channel in case of a remote storage.

Steps to create an SR in a XenServer.
1. SSH to the XenServer as root.
2. Find the disk ID of the new device using the next commands:

# cat /proc/partitions

You will see list of all the HDDs and partitions. Find which device is your new local disk. This is probably “sdx”(most likely sdb) or “/cciss/c0d1p0”.

# ll /dev/disk/by-id

This command will show the disk ids for all the partitions/HDDs present in the server
Find the disk ID of the “sdx” or “cciss/c0d1”disk. The “scsi-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx” or “cciss-xxxxxxxxxxxxxxxxxxxxxxxxxx”format is what you need.
3. Discover the ‘host-uuid’ in the XenSserver using the following command.

#xe host-list

The uuid (RO) is the ‘host-uuid’ you will need.
4. Generate a Storage Repository (SR):

Note: The sr-create command is for adding a new hard drive. This is a critical process that will partition and format the drive, and any data on the drive will be vanished. If you desire to re-introduce a drive that contains existing data, you should use sr-introduce instead.

# xe sr-create content-type=user device-config:device=/dev/disk/by-id/ host-uuid= name-label=”Local Storage 2” shared=false type=ext3

– Or –

# xe sr-create content-type=user device-config:device=/dev/disk/by-id/ host-uuid= name-label=”Local Storage 2” shared=false type=lvm

– Or –

# xe sr-create content-type=user device-config:device=/dev/ host-uuid= name-label=”Local Storage 2” shared=false type= ext3

You can verify it from XenCenter with the following steps:
1. Connect to the XenCenter.
2. Go to the ‘Storage tab’. You will find the details of all storage repositories here. You can see the storage ‘Local Storage2’ in the list.
This signifies that the disk has been added successfully. Now, you can start creating VDIs on it.

About

I am founder and webmaster of www.linuxpcfix.com and working as a Sr. Linux Administrator (Expertise on Linux/Unix & Cloud Server) and have been in the industry from last 7 years.

Leave a Reply

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

*
*

Time limit is exhausted. Please reload the CAPTCHA.

Categorized Tag Cloud