Skip to content

Commit 8ab08e9

Browse files
committed
Partition automatically
1 parent 3d5a238 commit 8ab08e9

File tree

2 files changed

+45
-51
lines changed

2 files changed

+45
-51
lines changed

install.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
tasks:
99
- name: |
1010
Wait for VM to install and boot.
11-
Make sure to connect to the VM (via virt-manager, virt-viewer, or similar) and follow the prompts (press any key to boot from DVD, confirm partitioning).
11+
Make sure to connect to the VM (via virt-manager, virt-viewer, or similar) and follow the prompts (press any key to boot from DVD).
1212
This will take a while.. if it times out, restart the playbook but leave the VM running to resume.
1313
It is normal to see a bunch of QEMU guest agent errors in the Ansible output while waiting.
1414
ansible.builtin.wait_for_connection:

roles/create-vm/files/windows-install-config/Autounattend.xml

Lines changed: 44 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -12,55 +12,49 @@
1212
</component>
1313
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
1414
<!-- FIXME: Auto-partitioning seems to prevent install from working? -->
15-
<!-- <DiskConfiguration> -->
16-
<!-- <Disk wcm:action="add"> -->
17-
<!-- <CreatePartitions> -->
18-
<!-- <CreatePartition wcm:action="add"> -->
19-
<!-- <Type>EFI</Type> -->
20-
<!-- <Size>200</Size> -->
21-
<!-- <Order>1</Order> -->
22-
<!-- </CreatePartition> -->
23-
<!-- <CreatePartition wcm:action="add"> -->
24-
<!-- <Type>MSR</Type> -->
25-
<!-- <Size>200</Size> -->
26-
<!-- <Order>2</Order> -->
27-
<!-- </CreatePartition> -->
28-
<!-- <CreatePartition wcm:action="add"> -->
29-
<!-- <Type>Primary</Type> -->
30-
<!-- <Size>1024</Size> -->
31-
<!-- <Order>3</Order> -->
32-
<!-- </CreatePartition> -->
33-
<!-- </CreatePartitions> -->
34-
<!-- <ModifyPartitions> -->
35-
<!-- <ModifyPartition wcm:action="add"> -->
36-
<!-- <!-\- <Active>true</Active> -\-> -->
37-
<!-- <Order>1</Order> -->
38-
<!-- <!-\- <PartitionID>1</PartitionID> -\-> -->
39-
<!-- <!-\- <Label>System</Label> -\-> -->
40-
<!-- <Format>NTFS</Format> -->
41-
<!-- <!-\- <TypeID>0x27</TypeID> -\-> -->
42-
<!-- </ModifyPartition> -->
43-
<!-- <ModifyPartition wcm:action="add"> -->
44-
<!-- <!-\- <Active>true</Active> -\-> -->
45-
<!-- <Order>2</Order> -->
46-
<!-- <!-\- <PartitionID>2</PartitionID> -\-> -->
47-
<!-- <!-\- <Label>Microsoft Reserved</Label> -\-> -->
48-
<!-- <Format>NTFS</Format> -->
49-
<!-- <!-\- <TypeID>0x27</TypeID> -\-> -->
50-
<!-- </ModifyPartition> -->
51-
<!-- <ModifyPartition wcm:action="add"> -->
52-
<!-- <Order>3</Order> -->
53-
<!-- <!-\- <PartitionID>3</PartitionID> -\-> -->
54-
<!-- <!-\- <Active>true</Active> -\-> -->
55-
<!-- <Format>NTFS</Format> -->
56-
<!-- <Extend>true</Extend> -->
57-
<!-- <Letter>C</Letter> -->
58-
<!-- </ModifyPartition> -->
59-
<!-- </ModifyPartitions> -->
60-
<!-- <DiskID>0</DiskID> -->
61-
<!-- <WillWipeDisk>true</WillWipeDisk> -->
62-
<!-- </Disk> -->
63-
<!-- </DiskConfiguration> -->
15+
<DiskConfiguration>
16+
<Disk wcm:action="add">
17+
<CreatePartitions>
18+
<CreatePartition wcm:action="add">
19+
<Type>EFI</Type>
20+
<Size>200</Size>
21+
<Order>1</Order>
22+
</CreatePartition>
23+
<CreatePartition wcm:action="add">
24+
<Type>MSR</Type>
25+
<Size>200</Size>
26+
<Order>2</Order>
27+
</CreatePartition>
28+
<CreatePartition wcm:action="add">
29+
<Type>Primary</Type>
30+
<!-- Will be extended to the full rest of the disk in ModifyPartition -->
31+
<Size>1024</Size>
32+
<Order>3</Order>
33+
</CreatePartition>
34+
</CreatePartitions>
35+
<ModifyPartitions>
36+
<ModifyPartition wcm:action="add">
37+
<Order>1</Order>
38+
<PartitionID>1</PartitionID>
39+
<Format>FAT32</Format>
40+
</ModifyPartition>
41+
<ModifyPartition wcm:action="add">
42+
<Order>2</Order>
43+
<PartitionID>2</PartitionID>
44+
<!-- MSR partition is managed by Windows, and cannot be formatted manually -->
45+
</ModifyPartition>
46+
<ModifyPartition wcm:action="add">
47+
<Order>3</Order>
48+
<PartitionID>3</PartitionID>
49+
<Format>NTFS</Format>
50+
<Extend>true</Extend>
51+
<Letter>C</Letter>
52+
</ModifyPartition>
53+
</ModifyPartitions>
54+
<DiskID>1</DiskID>
55+
<WillWipeDisk>true</WillWipeDisk>
56+
</Disk>
57+
</DiskConfiguration>
6458
<ImageInstall>
6559
<OSImage>
6660
<InstallFrom>
@@ -69,7 +63,7 @@
6963
<Value>Windows Server 2022 SERVERDATACENTER</Value>
7064
</MetaData>
7165
</InstallFrom>
72-
<!-- <InstallToAvailablePartition>true</InstallToAvailablePartition> -->
66+
<InstallToAvailablePartition>true</InstallToAvailablePartition>
7367
<!-- <WillShowUI>OnError</WillShowUI> -->
7468
</OSImage>
7569
</ImageInstall>

0 commit comments

Comments
 (0)