mirror of
https://github.com/actions/runner-images.git
synced 2025-12-10 19:16:48 +00:00
Set static UUID to the clean image (#8564)
This commit is contained in:
@@ -233,3 +233,19 @@ function Wait-AnkaVMSSHService {
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
function Set-AnkaVMUuid {
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string] $VMName,
|
||||
|
||||
[Parameter(Mandatory)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string] $Uuid
|
||||
)
|
||||
|
||||
$command = "anka modify $VMName set custom-variable hw.uuid $Uuid"
|
||||
Write-Host "`t[*] Setting $VMName uuid to $Uuid"
|
||||
Invoke-AnkaCommand -Command $command
|
||||
}
|
||||
|
||||
@@ -27,7 +27,8 @@ param(
|
||||
[int] $RamSizeGb = 7,
|
||||
[int] $DiskSizeGb = 300,
|
||||
[string] $DisplayResolution = "1920x1080",
|
||||
[string] $TagName = [DateTimeOffset]::Now.ToUnixTimeSeconds()
|
||||
[string] $TagName = [DateTimeOffset]::Now.ToUnixTimeSeconds(),
|
||||
[string] $Uuid = "4203018E-580F-C1B5-9525-B745CECA79EB"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
@@ -205,6 +206,9 @@ Set-AnkaVMVideoController -VMName $TemplateName -ShortMacOSVersion $ShortMacOSVe
|
||||
Write-Host "`t[*] Setting screen resolution to $DisplayResolution for $TemplateName"
|
||||
Set-AnkaVMDisplayResolution -VMName $TemplateName -DisplayResolution $DisplayResolution
|
||||
|
||||
# Set static UUID
|
||||
Set-AnkaVMUuid -VMName $TemplateName -Uuid $Uuid
|
||||
|
||||
if ($PushToRegistry) {
|
||||
# Push a VM template (and tag) to the Cloud
|
||||
Write-Host "`t[*] Pushing '$TemplateName' image with '$TagName' tag to the '$RegistryUrl' registry..."
|
||||
|
||||
Reference in New Issue
Block a user