From 3243ea36ef0c080a48f7a9f2c4517370ec075297 Mon Sep 17 00:00:00 2001 From: Mikhail Koliada <88318005+mikhailkoliada@users.noreply.github.com> Date: Tue, 30 Jan 2024 13:05:32 +0100 Subject: [PATCH] [Ubuntu] reduce disks size in packer template (#9251) --- images/ubuntu/scripts/tests/System.Tests.ps1 | 4 ++-- images/ubuntu/templates/ubuntu-20.04.pkr.hcl | 2 +- images/ubuntu/templates/ubuntu-22.04.pkr.hcl | 2 +- images/ubuntu/templates/ubuntu-minimal.pkr.hcl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/images/ubuntu/scripts/tests/System.Tests.ps1 b/images/ubuntu/scripts/tests/System.Tests.ps1 index 1abe5593..457eae07 100644 --- a/images/ubuntu/scripts/tests/System.Tests.ps1 +++ b/images/ubuntu/scripts/tests/System.Tests.ps1 @@ -1,8 +1,8 @@ # The $env:AGENT_NAME and $env:RUNNER_NAME are predefined variables for the ADO pipelines and for the GitHub actions respectively. # If the test is running on the ADO pipeline or on the GitHub actions, the test will be skipped Describe "Disk free space" -Skip:(-not [String]::IsNullOrEmpty($env:AGENT_NAME) -or -not [String]::IsNullOrEmpty($env:RUNNER_NAME)) { - It "Image has more than 31GB free space" { + It "Image has enough free space" { $freeSpace = (Get-PSDrive "/").Free - $freeSpace | Should -BeGreaterOrEqual 31GB + $freeSpace | Should -BeGreaterOrEqual 17GB } } diff --git a/images/ubuntu/templates/ubuntu-20.04.pkr.hcl b/images/ubuntu/templates/ubuntu-20.04.pkr.hcl index 7a35f657..fd3a295b 100644 --- a/images/ubuntu/templates/ubuntu-20.04.pkr.hcl +++ b/images/ubuntu/templates/ubuntu-20.04.pkr.hcl @@ -155,7 +155,7 @@ source "azure-arm" "build_image" { location = "${var.location}" managed_image_name = "${local.managed_image_name}" managed_image_resource_group_name = "${var.managed_image_resource_group_name}" - os_disk_size_gb = "86" + os_disk_size_gb = "75" os_type = "Linux" private_virtual_network_with_public_ip = "${var.private_virtual_network_with_public_ip}" subscription_id = "${var.subscription_id}" diff --git a/images/ubuntu/templates/ubuntu-22.04.pkr.hcl b/images/ubuntu/templates/ubuntu-22.04.pkr.hcl index 25fce43f..473e597c 100644 --- a/images/ubuntu/templates/ubuntu-22.04.pkr.hcl +++ b/images/ubuntu/templates/ubuntu-22.04.pkr.hcl @@ -155,7 +155,7 @@ source "azure-arm" "build_image" { location = "${var.location}" managed_image_name = "${local.managed_image_name}" managed_image_resource_group_name = "${var.managed_image_resource_group_name}" - os_disk_size_gb = "86" + os_disk_size_gb = "75" os_type = "Linux" private_virtual_network_with_public_ip = "${var.private_virtual_network_with_public_ip}" subscription_id = "${var.subscription_id}" diff --git a/images/ubuntu/templates/ubuntu-minimal.pkr.hcl b/images/ubuntu/templates/ubuntu-minimal.pkr.hcl index dc472575..f2cef0e0 100644 --- a/images/ubuntu/templates/ubuntu-minimal.pkr.hcl +++ b/images/ubuntu/templates/ubuntu-minimal.pkr.hcl @@ -149,7 +149,7 @@ source "azure-arm" "build_image" { // VM Configuration vm_size = "${var.vm_size}" - os_disk_size_gb = "86" + os_disk_size_gb = "75" os_type = "Linux" dynamic "azure_tag" {