Skip to content

Commit

Permalink
feat: validate the free space in AKS Windows VHDs (#4117)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbelHu authored Feb 27, 2024
1 parent cad498d commit 938a298
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
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

0 comments on commit 938a298

Please sign in to comment.