Skip to content

Commit bafa179

Browse files
authored
Add Windows image (#1850)
This adds a new image to the populate-images script based on `Windows Server 2022 Standard Evaluation (Desktop Experience)` ([scripts used](https://github.com/oxidecomputer/windows-image-builder)). It has the VirtIO network driver installed so guest networking works (both inbound & outbound). While we use NVMe for storage, it also has the VirtIO block driver installed which is needed for the cloud-init configdrive we expose to guests. Similarly, it also comes with [cloudbase-init](https://cloudbase-init.readthedocs.io/en/latest/intro.html) installed and configured to work with the cloud-init metadata we provide. (There were a few small tweaks made to the in-memory FAT drive we generate for the metadata to get it working.) First boot can take a few minutes as it begins up in a state as if you had just left the initial Windows Setup. It will skip past the Out of Box Experience (OOBE). After a reboot or two it'll be ready to SSH into. (Subsequent boots will be faster.) By default it configures an admin user "oxide" with a random password, copies over the SSH key provided by the control plane. It will also update the hostname to match the control plane value. It will also automatically extend the OS partition size (which is ~14G in the base image) to match the configured disk size. RDP is also enabled but you must configure a password first which can be done over SSH by running `net user oxide *`. This also pulls in a rev of propolis (& crucible) with the updated bootrom.
1 parent 93f4854 commit bafa179

File tree

6 files changed

+42
-15
lines changed

6 files changed

+42
-15
lines changed

Cargo.lock

+7-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nexus/Cargo.toml

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ base64 = "0.13.1"
1515
bb8 = "0.8.0"
1616
clap = { version = "4.0", features = ["derive"] }
1717
cookie = "0.16"
18-
crucible-agent-client = { git = "https://github.com/oxidecomputer/crucible", rev = "bacffd142fc38a01fe255407b0c8d5d0aacfe778" }
18+
crucible-agent-client = { git = "https://github.com/oxidecomputer/crucible", rev = "144d8dafa41715e00b08a5929cc62140ff0eb561" }
1919
diesel = { version = "2.0.2", features = ["postgres", "r2d2", "chrono", "serde_json", "network-address", "uuid"] }
2020
diesel-dtrace = { git = "https://github.com/oxidecomputer/diesel-dtrace", rev = "18748d9f76c94e1f4400fbec0859b3e77a221a8d" }
21-
fatfs = "0.3.5"
21+
# TODO(luqman): Update once merged & new release is cut
22+
# https://github.com/rafalh/rust-fatfs/pull/76
23+
fatfs = { git = "https://github.com/luqmana/rust-fatfs", branch = "stable-0.3" }
24+
#fatfs = "0.3.5"
2225
futures = "0.3.25"
2326
headers = "0.3.8"
2427
hex = "0.4.3"

nexus/src/cidata.rs

+6
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,18 @@ fn build_vfat(meta_data: &[u8], user_data: &[u8]) -> io::Result<Vec<u8>> {
6060
// Additionally, fatfs refuses to format a disk that is smaller than 42
6161
// sectors.
6262
let sectors = 42.max(file_sectors + 37);
63+
// Some tools also require that the number of sectors is a multiple of the
64+
// sectors-per-track. fatfs uses a default of 32 which won't evenly divide
65+
// sectors as we compute above generally. To fix that we simply set it to
66+
// match the number of sectors to make it trivially true.
67+
let sectors_per_track = sectors.try_into().unwrap();
6368

6469
let mut disk = Cursor::new(vec![0; sectors * 512]);
6570
fatfs::format_volume(
6671
&mut disk,
6772
FormatVolumeOptions::new()
6873
.bytes_per_cluster(512)
74+
.sectors_per_track(sectors_per_track)
6975
.fat_type(FatType::Fat12)
7076
.volume_label(*b"cidata "),
7177
)?;

package-manifest.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ service_name = "crucible"
9292
# 3. Use source.type = "manual" instead of "prebuilt"
9393
source.type = "prebuilt"
9494
source.repo = "crucible"
95-
source.commit = "1d67a53042f19ff7ca30dd20a04da94b7715ed7c"
95+
source.commit = "144d8dafa41715e00b08a5929cc62140ff0eb561"
9696
# The SHA256 digest is automatically posted to:
9797
# https://buildomat.eng.oxide.computer/public/file/oxidecomputer/crucible/image/<commit>/crucible.sha256.txt
98-
source.sha256 = "d43fcfabc3f6402cfdbe3a0d31d49ae903f76b5ddec955dcee63236e4a60fdb0"
98+
source.sha256 = "2de086b0ba27efc638c88ff46a6d110236c2db92499266eccbd2a3ec28acc693"
9999
output.type = "zone"
100100

101101
# Refer to
@@ -105,10 +105,10 @@ output.type = "zone"
105105
service_name = "propolis-server"
106106
source.type = "prebuilt"
107107
source.repo = "propolis"
108-
source.commit = "c59b1ac246b19130bd489cdce217e40a4e51c094"
108+
source.commit = "9da9cea30adfcce6d8185d7060a20f55df00a72a"
109109
# The SHA256 digest is automatically posted to:
110110
# https://buildomat.eng.oxide.computer/public/file/oxidecomputer/propolis/image/<commit>/propolis-server.sha256.txt
111-
source.sha256 = "0e75d9a22f1ff14b90d04d91e5642d654563cc82f69e2e9cca5a983668d25764"
111+
source.sha256 = "41d8e20cff02c073b7347bf2d88086c32720031bfdbb10392dcbd5dd8fa158ee"
112112
output.type = "zone"
113113

114114
[package.maghemite]

sled-agent/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ cfg-if = "1.0"
1414
chrono = { version = "0.4", features = [ "serde" ] }
1515
clap = { version = "4.0", features = ["derive"] }
1616
# Only used by the simulated sled agent.
17-
crucible-client-types = { git = "https://github.com/oxidecomputer/crucible", rev = "bacffd142fc38a01fe255407b0c8d5d0aacfe778" }
18-
crucible-agent-client = { git = "https://github.com/oxidecomputer/crucible", rev = "bacffd142fc38a01fe255407b0c8d5d0aacfe778" }
17+
crucible-client-types = { git = "https://github.com/oxidecomputer/crucible", rev = "144d8dafa41715e00b08a5929cc62140ff0eb561" }
18+
crucible-agent-client = { git = "https://github.com/oxidecomputer/crucible", rev = "144d8dafa41715e00b08a5929cc62140ff0eb561" }
1919
ddm-admin-client = { path = "../ddm-admin-client" }
2020
dropshot = { git = "https://github.com/oxidecomputer/dropshot", branch = "main", features = [ "usdt-probes" ] }
2121
futures = "0.3.25"
@@ -31,7 +31,7 @@ oximeter-producer = { version = "0.1.0", path = "../oximeter/producer" }
3131
p256 = "0.9.0"
3232
percent-encoding = "2.2.0"
3333
progenitor = { git = "https://github.com/oxidecomputer/progenitor" }
34-
propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "c0776be03bf0928651996eb00ad6f3665e99ebe7" }
34+
propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "9da9cea30adfcce6d8185d7060a20f55df00a72a" }
3535
rand = { version = "0.8.5", features = ["getrandom"] }
3636
reqwest = { version = "0.11.12", default-features = false, features = ["rustls-tls", "stream"] }
3737
schemars = { version = "0.8.10", features = [ "chrono", "uuid1" ] }

tools/populate/populate-images.sh

+17
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,20 @@ oxide api /system/images --method POST --input - <<EOF
9191
}
9292
}
9393
EOF
94+
95+
echo "Populating windows"
96+
oxide api /system/images --method POST --input - <<EOF
97+
{
98+
"name": "windows-server-2022",
99+
"description": "Windows Server 2022",
100+
"block_size": 512,
101+
"distribution": {
102+
"name": "windows-server",
103+
"version": "2022"
104+
},
105+
"source": {
106+
"type": "url",
107+
"url": "http://${CATACOMB_TUNNEL}/media/cloud/windows-server-2022-genericcloud-amd64.raw"
108+
}
109+
}
110+
EOF

0 commit comments

Comments
 (0)