From d5a77ffcb57a2330fd911e342f84edd130885ae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Be=C3=B1at=20Gartzia=20Arruabarrena?= Date: Wed, 22 Jan 2025 17:10:37 +0100 Subject: [PATCH] internal/cloud/gcp/compute: Add TDX_CAPABLE guest OS feature Latest RHEL images (from 9.6 on) should be able to run as TDX guests. CentOS guests also fully support it at the moment. See: https://issues.redhat.com/browse/COS-3111 See: https://github.com/coreos/coreos-assembler/pull/4006 See: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/5979 --- internal/cloud/gcp/compute.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/internal/cloud/gcp/compute.go b/internal/cloud/gcp/compute.go index f64aa0b9e..e7ccc335d 100644 --- a/internal/cloud/gcp/compute.go +++ b/internal/cloud/gcp/compute.go @@ -29,6 +29,18 @@ var GuestOsFeaturesRHEL9 []*computepb.GuestOsFeature = []*computepb.GuestOsFeatu {Type: common.ToPtr(computepb.GuestOsFeature_GVNIC.String())}, {Type: common.ToPtr(computepb.GuestOsFeature_SEV_SNP_CAPABLE.String())}, {Type: common.ToPtr(computepb.GuestOsFeature_SEV_LIVE_MIGRATABLE_V2.String())}, + {Type: common.ToPtr(computepb.GuestOsFeature_TDX_CAPABLE.String())}, +} + +// Guest OS Features for RHEL images up to RHEL9.5. +// The TDX support was added since RHEL-9.6. +var GuestOsFeaturesRHEL95 []*computepb.GuestOsFeature = []*computepb.GuestOsFeature{ + {Type: common.ToPtr(computepb.GuestOsFeature_UEFI_COMPATIBLE.String())}, + {Type: common.ToPtr(computepb.GuestOsFeature_VIRTIO_SCSI_MULTIQUEUE.String())}, + {Type: common.ToPtr(computepb.GuestOsFeature_SEV_CAPABLE.String())}, + {Type: common.ToPtr(computepb.GuestOsFeature_GVNIC.String())}, + {Type: common.ToPtr(computepb.GuestOsFeature_SEV_SNP_CAPABLE.String())}, + {Type: common.ToPtr(computepb.GuestOsFeature_SEV_LIVE_MIGRATABLE_V2.String())}, } // Guest OS Features for RHEL9.1 images. @@ -71,6 +83,14 @@ func GuestOsFeaturesByDistro(distroName string) []*computepb.GuestOsFeature { // TODO: this should be updated for the dot-notation case distroName == "rhel-91": return GuestOsFeaturesRHEL91 + case distroName == "rhel-92": + fallthrough + case distroName == "rhel-93": + fallthrough + case distroName == "rhel-94": + fallthrough + case distroName == "rhel-95": + return GuestOsFeaturesRHEL95 case strings.HasPrefix(distroName, "centos-9"): fallthrough case strings.HasPrefix(distroName, "rhel-9"):