Your browser (Internet Explorer 6) is out of date. It has known security flaws and may not display all features of this and other websites. Learn how to update your browser.
X
Post

How to add an additional local disk to your XenServer 5.5 host

After I described how to convert an existing local XenServer storage repository to support thin provisioning I’m now going to show you how you can add an additional local disk to your XenServer host.

Actually that’s pretty straight forward and the first thing you have to do is to add a new physical hard drive in your host. After that you boot up your XenServer again and go to the CLI.

[Side note: Red marked entries have to be changed with your own parameters or can differ from my entries. Also the command you have to enter on the CLI are marked bold.]

On the XenServer CLI you have to list your physical disk with fdisk.

fdisk -l
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 499 4008186 83 Linux
/dev/sda2 500 998 4008217+ 83 Linux
/dev/sda3 999 30401 236179597+ 83 Linux

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

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

There you can see your new hard drive. In my case it shows up as /dev/sdb. For integrating the hard disk into your XenServer you first have to reveal the UUID of your host. This is done by the following command.

xe host-list
uuid ( RO) : ba3d140c-3de5-499b-b831-7c40d82958a9
name-label ( RW): xs-tarenz01
name-description ( RO): Default install of XenServer

The last step is to create a new XenServer storage repository. You have three options for doing so.

First option: create a normal LVHD storage repository. This is by the way the default storage repository type.

xe sr-create host-uuid=ba3d140c-3de5-499b-b831-7c40d82958a9 content-type=user type=lvm device-config:device=/dev/sdb shared=false name-label="Local storage 2"

Second option: Create a LVHD storage repository with thin provisioning support.

xe sr-create host-uuid=ba3d140c-3de5-499b-b831-7c40d82958a9 content-type=user type=lvm device-config:device=/dev/sdb shared=false name-label="Local storage 2" sm-config:allocation=thin

Third option: Create a EXT storage repository with thin provisioning support and direct access to the vhd files.

xe sr-create host-uuid=ba3d140c-3de5-499b-b831-7c40d82958a9 content-type=user type=ext device-config:device=/dev/sdb shared=false name-label="Local storage 2"

…and finish. Now you have added an additional storage repository on your newly added physical hard drive to your XenServer.

  • Brilliant! works perfectly, thanks very much

    Adrian

    1. June 2010

  • Hi Adrian,

    I did exactly what you mentioned in your post and everything was working fine then this morning i upgraded my XenServer from 5.6 to 5.6 FP1and now it shows disconnected that additional local storage.

    how to reconnect it ?

    Thanks

    Mudassir

    13. March 2011

  • error message:
    The SR operation cannot be performed because a device underlying the SR is in use by the host.
    can i do?

    mark

    27. June 2010

  • Hi Mark,

    this article could help .

    Tim Arenz

    30. June 2010

  • what is the best option between 2) and 3). What’s the advantage of having an ext partition vs lvm?

    MD

    24. July 2010

  • Using the EXT partition is in my opinion the best way. There could be a little performance penalty when using EXT but you have the possibility to access the created vhd files directly via ssh or scp.

    tim

    25. July 2010

  • Works for me.
    Thanks

    John Crawford

    19. August 2010

  • works for me too, thanks very much.

    Fernando Costa

    28. August 2010

  • Thanks a lot Master. This really was some great help. I’m pretty new to XenServer (I use 5.6) and since I’m originally a Citrix guy I’m not used to Linux/XenServer commands that much.

    My additional disk is now added but the system reports only 58GB available since the disk was first used in a Windows system and not cleared before mounting. There is still some HPFS/NTFS data on there. Can I reformat the disk in order to make all 500.1GB available to the system ? See below:

    Disk /dev/sda: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 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 60801 479995393 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

    Device Boot Start End Blocks Id System
    /dev/sdb1 * 1 7650 61440595+ 7 HPFS/NTFS

    Thanks, Henri

    Henri

    9. September 2010

  • My excuses for my ignorence but by using Google I solved my issue. First destroyed the SR via “xe sr-destroy uuid=”, then reformatted the disk using fdisk/fsck and afterwards recreated the SR again.

    Thanks in advance, Henri

    Henri

    9. September 2010

  • Henri, you’re welcome! ;)

    tim

    9. September 2010

  • Hi, I have a problem with a 6TB partition; fdisk says that it is too big bla bla use parted bla bla
    clearly I cannot install parted (I think).
    Should I proceed anyway?
    Thanks,
    Miguel

    miguel

    15. October 2010

  • Hi Miguel,

    this article should help: http://forums.citrix.com/thread.jspa?threadID=272861&tstart=0

    Tim

    tim

    10. January 2011

  • Hello,

    as mark wrote i am also getting the same error:
    The SR operation cannot be performed because a device underlying the SR is in use by the host.

    Google did not help, because youre allways directed to the citrix knowlege center. http://support.citrix.com/article/CTX122233 Anyway the solution there does not fit on this problem.

    Do you have any idea?

    Thanks Stefan

    Stefan

    16. November 2010

  • Excelente, realmente funciona!!!

    Jhon

    30. March 2011

  • Hello,

    i have a XenServer 5.6.0 with 3 disks (1.=1TB 2.=2TB 3.=1TB). After a problem i have to reinstall Xenserver, on disk 2 and 3 i have different VM installed from the first xenserve installation, but after the second installation i can’t find this VM’s. with the command:

    [root@xenjm by-id]# ls -l
    total 0
    lrwxrwxrwx 1 root root 9 Apr 11 06:06 edd-int13_dev83 -> ../../sdd
    lrwxrwxrwx 1 root root 9 Apr 11 06:06 scsi-SATA_ST31000524NS_9WK362LT -> ../../sda
    lrwxrwxrwx 1 root root 10 Apr 11 06:06 scsi-SATA_ST31000524NS_9WK362LT-part1 -> ../../sda1
    lrwxrwxrwx 1 root root 10 Apr 11 06:06 scsi-SATA_ST31000524NS_9WK362LT-part2 -> ../../sda2
    lrwxrwxrwx 1 root root 10 Apr 11 06:06 scsi-SATA_ST31000524NS_9WK362LT-part3 -> ../../sda3
    lrwxrwxrwx 1 root root 9 Apr 11 06:06 scsi-SATA_ST31000524NS_9WK388FK -> ../../sdb
    lrwxrwxrwx 1 root root 9 Apr 11 06:06 scsi-SATA_ST32000542AS_6XW27LWQ -> ../../sdc
    lrwxrwxrwx 1 root root 9 Apr 11 06:06 usb-ST310005_28AS_93A9FFFFFFFF -> ../../sdd

    [root@xenjm by-id]# fdisk -l

    Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 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 121601 968371393 8e Linux LVM

    Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

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

    Disk /dev/sdc: 2000.3 GB, 2000398934016 bytes
    255 heads, 63 sectors/track, 243201 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Disk /dev/sdc doesn’t contain a valid partition table

    Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Disk /dev/sdd doesn’t contain a valid partition table

    i can see /dev/sdb and /dev/sdc but how can i access (mount / reconnect) this VM’s on this disks?

    Sorry for my english, this is not my language. Thank you for your help.

    Jean-Marie

    Jean-Marie

    13. April 2011

  • Jean-Marie, this should help: http://support.citrix.com/article/CTX120962

    tim

    22. May 2011

  • Thanks for the walkthrough!

    The process worked great… for the first disk added (dev/sdb).

    I now have another new physical disk installed (/dev/sdc) that fdisk -l sees, but when I run xe host-list, the UUID of /dev/sdb is returned… How do I call up the UUID of newest install?

    Please advise.

    Thanks again :)

    Jim

    19. May 2011

  • Jim, the UUID from xe-host list isn’t a reference to the disk but a reference to the UUID of your XenServer hosts. So the IDs should be the same and everything is just fine! ;)

    tim

    22. May 2011

  • | adrian's domain

    7. July 2011

  • Thanks

    Brian M

    10. August 2011

  • Work´s fine in XenServer 6.0. Thanks! :-)

    Jesser

    4. November 2011

  • thank you for the instructions good sire! :)

    josh

    29. November 2011

  • Thanks! It worked perfectly!

    MasterV

    11. December 2011

  • [...] via How to add an additional local disk to your XenServer 5.5 host « XenDesktopMaster. [...]

Leave a comment  

name*

email*

website

Submit comment