From 40be9dd5bb4c37bfb55c6e9079af225b6dee3bf4 Mon Sep 17 00:00:00 2001 From: "M. Rehan" Date: Fri, 24 Jan 2025 16:00:03 +0500 Subject: [PATCH] Ignore cloud based images in virt plugin for VMs --- src/middlewared/middlewared/plugins/virt/instance.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/middlewared/middlewared/plugins/virt/instance.py b/src/middlewared/middlewared/plugins/virt/instance.py index 90e196abe74c2..77ee9539ace31 100644 --- a/src/middlewared/middlewared/plugins/virt/instance.py +++ b/src/middlewared/middlewared/plugins/virt/instance.py @@ -284,6 +284,12 @@ async def image_choices(self, data): async with session.get(url) as resp: for v in (await resp.json())['products'].values(): alias = v['aliases'].split(',', 1)[0] + if v['requirements'].get('cdrom_agent'): + # We are adding this check to ignore such images because these are cloud images + # and require agent to be installed/configured which is obviously not going to + # happen + continue + if alias not in choices: instance_types = set() for i in v['versions'].values():