From c94b94e45b9526c36565ee1ad94fa55467c50787 Mon Sep 17 00:00:00 2001 From: Markus Keil Date: Mon, 15 Apr 2024 18:31:47 +0200 Subject: [PATCH] fix image selection --- CloudController.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CloudController.cs b/CloudController.cs index 4a3ff0a..fb5ce6d 100644 --- a/CloudController.cs +++ b/CloudController.cs @@ -51,10 +51,16 @@ public async Task CreateNewRunner(string arch, string size, string runne string name = $"ghr-{NameGenerator.Identifiers.Get(separator: "-")}".ToLower(); _logger.LogInformation($"Creating VM {name} from image {imageName} of size {size}"); + + string htzArch = "x86"; + if (arch == "arm64") + { + htzArch = "arm"; + } // Grab image var images = await _client.Image.Get(); - long? imageId = images.FirstOrDefault(x => x.Description == imageName)?.Id; + long? imageId = images.FirstOrDefault(x => x.Description == imageName && x.Architecture == htzArch)?.Id; if (!imageId.HasValue) {