XenServer \ XCP-ng: How to Create a Virtual Disk Larger than 2tb

So recently I ran into an issue where I needed to create a virtual disk 20TB in size. Unfortunately, XCP-ng does not allow doing this through its manager because it uses an older disk system. However, you can manually create an LVM partition and map it to the VM. Here is what you need to do:

 

Grab your SR UUID from the management console. The UUID I will be using for example commands is f8f32ef5-81d7-9154-d0f2-b92559b8ecbc. You will need to replace it with your UUID.

 

Now we need to get the volume group device name:

vgs | awk '{print $1}' | grep f8f32ef5-81d7-9154-d0f2-b92559b8ecbc

 

Now we create the volume. Make to change the “20T” to your desired size in TB:

lvcreate -L20T -n"LV-"$(uuidgen) VG_XenStorage-f8f32ef5-81d7-9154-d0f2-b92559b8ecbc --config global{metadata_read_only=0}

 

Finally, scan the SR and you should see a no name virtual disk.

xe sr-scan uuid=f8f32ef5-81d7-9154-d0f2-b92559b8ecbc

 

Now you can attach the created disk to your VM. Just make sure to change the name in the management center.

 

There might be a way to thin provision it, but I don’t know how to do that. If you have found a way to do so, please comment down below.

 



About: Ryan Parker

I am former captain of the Cyber Defense team form Cal State San Bernardino. I also have a side job helping small to medium business with anything technology, including but not limited to servers, networking, and end user devices. One of my hobbies is building out infrastructures for myself, friends, and clients. I current maintain a VMware ESXi cluster with about 280GB of RAM, with a 10Gbit network as backbone.


5 thoughts on “XenServer \ XCP-ng: How to Create a Virtual Disk Larger than 2tb”

  1. How do you do this on a NFS Volume Group? The “vgs” command only shows my local storage volumes not NFS mounted ones.

  2. Could you provide more info about what you did. You created a new logical volume in LVM on host/dom0.
    How does this help to override a 2TB virtual disk limit? How did you attach this 20TB disk to a VM? Thanks

Leave a Reply

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