XCP-NG - Resizing VDI

Hi,

Firstly, keep up the good work with the YT vids. They are very useful !!!

Got a small query regarding resizing drives. Have got a windows 2019 server running on XCP-NG 8.2 and need to increase the drive size so I can add a bit more space in C: and add a new D: partition.

Was looking to utitlise : xe vdi-resize uuid= ***** disk-size=500GiB online=true then I would sort it out with Windows Disk Management. However, I’m getting “This function is no longer available” when trying to run from cmdline.

What’s the recommended procedure for this?

Appreciate your help

IM

Found a fix. It looks like it can’t be done when running. So stopping and running the cmd with online=false works.

You can also do this in Xen Orchestra simply by stopping the VM and typing in the new size

I’d like to know how you are going to increase the size of the C drive. I’ve done this on one of my VM’s and due to partitioning scheme during install, this created space that is not contiguous to C so I can’t simply expand the C drive.

It was easy enough to create a new partition for this unused space and assign a new drive letter.

This was a server 2022 eval install if that matters and default is boot, system, and recovery partitions (in that order), then the extended part was next.

I created the larger size using the methods I mentioned above. I then went to Computer Management/Disk Management and seen the unallocated space. I simply RHC the C Drive and selected extend volume.

Not sure why that would not work on your system. Perhaps your disks are configured as dynamic and that doesn;t work.

The spaces are not contiguous in my server 2022, expending the volume can only be don on contiguous spaces. Since Server 2022 “requires” the recovery partition, and puts it after the C drive partition, extending is not an option. I’ll get a picture later to show this.

I may need to look into creating the partitions manually so that I can extend them in the future.

I also question what kind of recovery is going to be allowed on a domain controller, generally speaking without the backup and migrate role/feature installed, there isn’t much recovery.

Here is what my layout looks like, the extra 140GB is what I added and because it was not contiguous with my C drive, I could not extend the C drive.

What I should do is specify the EFI, recovery, and then C drive when making new VM’s so that I can extend them. Or find a way to move the partition order around.

Deleting the recovery might have worked too, I’ll have to try one and see what happens to Windows, not like it is storing a lot of info in there.

Ok, so I have increase a disk on my XCP for a 2019 server. This is the postion it should be in:

So looking at your disks, it looks like you need to delete the volume first to set as unallocated

Then extend

Hope this helps

After

I think your issues is the recovery partition after C:

Something about it here : Why is the recovery partition after C: - Microsoft Q&A

Yup that’s the issue. And this partition is created after the OS installs which is why it is last. I’ll read through the article and see if it lets me put it before the OS because being able to just increase the storage on your VM OS “drive” is a very useful thing to have.

There are some useful tools in the recovery partition, but it is essentially WinPE with some system specific files.

Since I’m using thin provisioning on the disks (storage on an NFS share, and I don’t really occupy all the size I set, I should probably just start making my VM’s with a fairly large disk size.

That recovery partition being after the OS in new in server 2022, but old in the last few versions of Windows 10. They moved it to after the OS because the recovery partition can grow in size as the system changes. It can be used during some stages of applying updates (or so I just read). When it was put before the OS partition, it could not grow in size and this caused some issues and I had an issue once trying to perform an update because the recovery partition was too small to do what the update/upgrade wanted. So I guess it should be allowed to stay or we need to find a way to move. I may look into ways to copy the info and move it because it would be very useful if you didn’t have a snapshot or running on a physical server and needed to expand the OS drive.

[edit] apparently some third party tools can extend the OS and move the WinRE partitions which would do what we need. More research needed on this subject and some testing. Good thing this is a virtual machine and testing “recovery” is easy.

The fact that recovery of OS can be handled by XCP means this partition is redundant. You could image this and build a boot partition later if you need it.

Microsoft says that it sometimes uses this in the update process when it needs to boot into a safe mode to write some system files. I was thinking of just deleting it until I read that. I now have a fairly simple solution in the form of 13 screen captures, sharing that with people is the harder part.

Summary is that I used PartedMagic partition editor (Gparted) to move the recovery to the end of the free space. Then boot back into Windows and extend the system drive into the free space. There are a couple of gotchas, but nothing that bad and possibly something that people who use Linux are accustomed to seeing.

Does the forum allow uploading a PDF? Not really wanting to make half a dozen posts to get everything in here.

Also I used PartedMagic because I bought a version from them last year, I use it a bit and thought I should pay them to keep them going. It’s cheap and it does stuff I need. Any Linux rescue disk with Gparted should be able to perform these steps, but having a graphical tool makes it easier.



There are the first and nearly last steps. I did check with a shutdown /r /o command to make sure it still boots into recovery, and this does work, so I call it a success. The 62MB at the end was to make sure I didn’t crush the recovery partition, it was just easier to use the rounded number for start of that partition in Gparted.

Good result. Not sure about uploading PDF. Perhaps Tom will advise.