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.
Which UUID do you mean? I always get errors…
What step are you on? What id the UUID of your Storage Repository?
How do you do this on a NFS Volume Group? The “vgs” command only shows my local storage volumes not NFS mounted ones.
We’ve not had to use NFS with XenServer or XCP-ng, so unfortunately cannot help you. You might be able to make some progress mixing info from this article with info from this one:
https://discussions.citrix.com/topic/383323-mount-storage-volume-xenserver/
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
Id imagine it will not work because it was essentially making a lvm volume. Id really only recommend this for a single host deployment, and honestly would not even really recommend it, I needed it for a one off
It’s been a few years, but does this work in a pool with iSCSI storage? For instance, if you do this on host A, can the VM be live-migrated to host B or C, assuming the SR is accessible to all the hosts?
I would not recommend this for any kind of clustered configuration
I was able to create in LVM (thick provisioning worked but I failed with ext – thin provisioning), so thanks for the guide! This was a dry run before we get a new server with a lot of storage, so now I know not to create the new one as ext, which I like to do to save on space.
One question is that I’m unable to rename it in XCP-Center 20.04.01 as it gets stuck at the “Size and Location” portion and won’t save the new name. I have a feeling this will cause problems during backups. Is there a workaround?
I would not count on any GUI utility working for this… Since its a bit of a hack its unlikely it will be supported in xcpng’s graphical utilities. As for backups id bet they would not work either.
Do you know of a CLI command to rename/add a description to the virtual disk? I’ve been hunting around with no luck.
As far as backups, you’re right – I tried to back up my dummy VM to a Synology NAS and it got a “Not enough space” error (there was enough space). My guess is that the Synology didn’t allow the creation of a 2TB+ file.
Sorry I dont actively use xcp-ng these days though I might when the UI gets improved in the next version… Good luck on your hunt though.
Ahh. Thanks anyway – your guide was a good start. It looks like XCP is going to support 2TB+ disks now: https://xcp-ng.org/forum/topic/10308/dedicated-thread-removing-the-2tib-limit-with-qcow2-volumes