Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: validate the free space in AKS Windows VHDs #4117

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions vhdbuilder/packer/configure-windows-vhd.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,10 @@ function Get-SystemDriveDiskInfo {
foreach($disk in $disksInfo) {
if ($disk.DeviceID -eq "C:") {
Write-Log "Disk C: Free space: $($disk.FreeSpace), Total size: $($disk.Size)"

if ($disk.FreeSpace -lt $global:lowestFreeSpace) {
throw "Disk C: Free space is less than $($global:lowestFreeSpace)"
}
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions vhdbuilder/packer/generate-windows-vhd-configuration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ if (-not ($validSKU -contains $windowsSKU)) {
throw "Unsupported windows image SKU: $windowsSKU"
}

# We need to guarantee that the node provisioning will not fail because the vhd is full before resize-osdisk is called in AKS Windows CSE script.
$global:lowestFreeSpace = 2*1024*1024*1024 # 2GB

# defaultContainerdPackageUrl refers to the stable containerd package used to pull and cache container images
# Add cache for another containerd version which is not installed by default
$global:defaultContainerdPackageUrl = "https://acs-mirror.azureedge.net/containerd/windows/v1.6.21-azure.1/binaries/containerd-v1.6.21-azure.1-windows-amd64.tar.gz"
Expand Down
Loading