From 55d076a42fe1daca4efddbac6b41d28c91cc6bfd Mon Sep 17 00:00:00 2001 From: Vinay Gahlout Date: Tue, 3 Dec 2024 06:13:01 +0000 Subject: [PATCH] Fix: include N1 custom machines into supported VM types for vm-performance runbook bug: 381179565 Change-Id: I47951d4a5d668ebf1aaa043dd3ad85f97b47a95b GitOrigin-RevId: 877e8f65595de3250dc1f521803238735ff6f074 --- gcpdiag/runbook/gce/vm_performance.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gcpdiag/runbook/gce/vm_performance.py b/gcpdiag/runbook/gce/vm_performance.py index 1e30bc7f0..50eb44ee3 100644 --- a/gcpdiag/runbook/gce/vm_performance.py +++ b/gcpdiag/runbook/gce/vm_performance.py @@ -524,6 +524,8 @@ def execute(self): file.close() vm_family = vm.machine_type()[0] + if vm.machine_type().split('-')[0] == 'custom': + vm_family = 'n' # Load instance level iops/throughput limits from json file vm_family_file = f'{dirname(__file__)}/disk_performance_benchmark/{vm_family}-family.json' @@ -1065,9 +1067,14 @@ def execute(self): ' H3, N1, N2, N2D, M1, M2, M3, T2D, T2A, Z3') elif vm_family == 'n': - if vm.machine_type().split('-')[0].upper() in ['N1', 'N2', 'N2D']: + if vm.machine_type().split('-')[0].upper() in [ + 'N1', 'N2', 'N2D', 'CUSTOM' + ]: next_hop = 'VM vCPU count' - search_str = vm.machine_type().split('-')[0].upper() + ' VMs' + if vm.machine_type().split('-')[0] == 'custom': + search_str = 'N1 VMs' + else: + search_str = vm.machine_type().split('-')[0].upper() + ' VMs' if disktype in ['pd-balanced', 'pd-ssd']: if cpu_count == 1: next_hop_val = '1'