File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -233,3 +233,19 @@ function Wait-AnkaVMSSHService {
233233 exit 1
234234 }
235235}
236+
237+ function Set-AnkaVMUuid {
238+ param (
239+ [Parameter (Mandatory )]
240+ [ValidateNotNullOrEmpty ()]
241+ [string ] $VMName ,
242+
243+ [Parameter (Mandatory )]
244+ [ValidateNotNullOrEmpty ()]
245+ [string ] $Uuid
246+ )
247+
248+ $command = " anka modify $VMName set custom-variable hw.uuid $Uuid "
249+ Write-Host " `t [*] Setting $VMName uuid to $Uuid "
250+ Invoke-AnkaCommand - Command $command
251+ }
Original file line number Diff line number Diff line change 2727 [int ] $RamSizeGb = 7 ,
2828 [int ] $DiskSizeGb = 300 ,
2929 [string ] $DisplayResolution = " 1920x1080" ,
30- [string ] $TagName = [DateTimeOffset ]::Now.ToUnixTimeSeconds()
30+ [string ] $TagName = [DateTimeOffset ]::Now.ToUnixTimeSeconds(),
31+ [string ] $Uuid = " 4203018E-580F-C1B5-9525-B745CECA79EB"
3132)
3233
3334$ErrorActionPreference = " Stop"
@@ -205,6 +206,9 @@ Set-AnkaVMVideoController -VMName $TemplateName -ShortMacOSVersion $ShortMacOSVe
205206Write-Host " `t [*] Setting screen resolution to $DisplayResolution for $TemplateName "
206207Set-AnkaVMDisplayResolution - VMName $TemplateName - DisplayResolution $DisplayResolution
207208
209+ # Set static UUID
210+ Set-AnkaVMUuid - VMName $TemplateName - Uuid $Uuid
211+
208212if ($PushToRegistry ) {
209213 # Push a VM template (and tag) to the Cloud
210214 Write-Host " `t [*] Pushing '$TemplateName ' image with '$TagName ' tag to the '$RegistryUrl ' registry..."
You can’t perform that action at this time.
0 commit comments