Hi Steve

Yes - MS have changed the OS disk partitioning scheme on both Windows 11 and 
Server 2022. We installed Server 2022 using the ISO - but created a 1Gb 
partition prior to installing the OS.

We then use a combination of DISM and diskpart commands to reconfigure the 
partitions so that we have a 1Gb Recovery partition (large enough for future OS 
updates to satisfy Microsoft) and have this partition at the beginning of the 
disk so that the "C drive" can later be extended if required

Detailed steps:

when installing the OS from the ISO - on the installation page - select 
'advanced' and choose to add a new 1024Mb partition to the unallocated disk - 
this will serve as the new partition 'D' for the Recovery partition

Then after the OS is installed:
in diskpart find the exisiting RE partition that the system has installed and 
give it drive letter 'O'

diskpart
list volume
select volume 'number of the RE partition created by the OS install'
assign letter=O
exit

Dism /Capture-Image /ImageFile:C:\recovery-partition.wim /CaptureDir:O:\ 
/Name:"Recovery"

Dism /Apply-Image /ImageFile:C:\recovery-partition.wim /Index:1 /ApplyDir:D:\

reagentc /disable
reagentc /setreimage /path D:\Recovery\WindowsRE
reagentc /enable


DISKPART> select volume 'number of the D partition'
DISKPART> set id=27
DISKPART> remove
 go into regedit
hklm/system/MountedDevices and delete the item that shows the drive letter for 
the RE partition
reboot server

diskpart
select volume 4 - if this was the original RE partition at the end of the disk
delete partition override


Gary Dixon
Senior Technical Consultant
0161 537 4980 +44 7989717661
[email protected]
www.quadris.com
Innovation House, 12-13 Bredbury Business Park
Bredbury Park Way, Bredbury, Stockport, SK6 2SN
-----Original Message-----
From: S.Fuller <[email protected]>
Sent: Friday, November 24, 2023 2:18 AM
To: [email protected]
Subject: Re: Cloudstack fail to create windows 2022 templates

Just went through this process.
- I installed Windows Server 2022 to a VM, installed the VirtIO drivers, made 
the other changes I wanted to the image
- Ran sysprep with the shutdown and OOBE experience options
- Made a template from the volume

Biggest issue I had was dealing with where Windows 2022 puts the system 
recovery partition. MS now places it after the primary partition so automatic 
resizing of the volume on deployment wouldn't work. I ended up just removing 
that partition entirely.

- Steve

On Thu, Nov 23, 2023 at 12:49 AM Yu Huang Chan <[email protected]>
wrote:

> Hi All,
>
> We are going to try to make a Windows 2022 template and follow the
> documentation guides that require downloading and installing Windows AIK.
>
> When we look at the Windows System Image Manager catalog, it shows the
> error "Details: Parameter count mismatch."
>
> The below latest documentation shows an example guide up to Windows
> 2008 guides only.
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs
> .cloudstack.apache.org%2Fen%2Flatest%2Fadminguide%2Ftemplates.html&dat
> a=05%7C01%7CGary.Dixon%40quadris.co.uk%7Cd14867f23ed74268d71a08dbec93a
> fc8%7Cf1d6abf3d3b44894ae16db0fb93a96a2%7C0%7C0%7C638363891291430927%7C
> Unknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1h
> aWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JL1ZolOAhhfvjSC3LPkybTvxz5s3F
> s6%2BJamQlCvPGto%3D&reserved=0
>
> May we know anyone facing these issues and how to create Windows 2022
> templates in the proper way?
>
> Regards,
> Yu Huang
>


--
Steve Fuller
[email protected]

Reply via email to