How To Create Or Add More Than 2TB Storage To Xen Server/XCP-NG Virtual Machine (VM)

I always think about the Data stored in a single virtual machine with lots of Space, I was assigned to create a new virtual machine with 20TB by My Manger, Instead of creating the Virtual Machine and adding 20TB to it at once, What happen if the VM crashes? And the data stored in it,

So I created a Ubuntu Server with 100GB LVM during installation incase we need to extend the root partitions and so on, Then after the installation, I need to add 20TB to it I use XCP-NG Center, But it started giving error can't remember the actual, But the problem is can't assign more than 2TB on virtual machine,

And I need to create 20TB, Meaning I will have to create 2TB x 10, Making It 20TB, After that I will start dealing with LVM on the Ubuntu Server which is  a long process, The other option I was thinking was using Xen-Orchestra to create the Storage but still same issue.

While looking for a solution, I came across this, But with an error also, So Let's start on how to create that.

How To Create More Than 2TB In Xen Server/XCP-NG

Login to your Xen Server using ssh, After that, Look at the Storage in which you're trying to create the Storage from, From the Server I am working on, It's about 40TB in Size, Probably even if the Server is on SAN you should be able to identify that.


xe sr-list

Which shows the list of the Storage, For the server, Am configuring we are using a Local Storage that has 40TB in Total, And we need 20TB.


As you can see from the name-label, That's the Local Storage,

You need to find the Volume Group Name, Make use of this:

vgs | awk '{print $1}' | grep 652886ec-9015-1838-1520-14b31c60df2d

Replacing 652886ec-9015-1838-1520-14b31c60df2d with the UUID of your Local Storage,
Which then shows the VG Group Name, Most times, VG_XenStorage-UUID, Example:


Creating The Logical Volume

  • Before running this command, Let's understand this:
    3T – That's the size, 3 Terrabyte, You can change it to 20T, That's 20TB,
    VG_XenStorage – That's the Volume Group Name, Mostly it's default.
  • Run This Command, And Replace your size and UUID.
lvcreate -L3T -n"LV-"$(uuidgen) VG_XenStorage-652886ec-9015-1838-1520-14b31c60df2d

You might have this issue: global/metadata_read_only.

To Fix This Error global/metadata_read_only:

nano /etc/lvm/lvm.conf

And search for metadata_read_only=1 And Remove The 1 And Replace With 0, Making it metadata_read_only=0 and save, After that. Try the command above for creating the Storage it should be successful without error.
This message should display.

Logical volume "LV-4e3da1e4-9e1a-4e12-96a1-d3c233efc0d5" created

Just tell Xen Server/XCP-NG to scan the New Storage, with:

xe sr-scan uuid=b55e5f09-8fef-4b5d-8dae-9410d630f205

Now go to your Xen Center/XCP-NG Center, And Click on the VM you wanted to attach the disk to, by Clicking On It > Storage > Attach Disk, You should be able to see it, Attach it and continue with your configurations.
If you need to rename it: Click On It, And Properties, And do the Naming And Description.



Posted by Shehu Awwal

DevOps Engineer, Interests around Kubernetes, Infrastructure, Security & Automation.

Leave a Reply

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