Skip to content

Commit

Permalink
internal/cloud/gcp/compute: Add TDX_CAPABLE guest OS feature
Browse files Browse the repository at this point in the history
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: coreos/coreos-assembler#4006
See: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/5979
  • Loading branch information
bgartzi authored and thozza committed Feb 27, 2025
1 parent 9b850de commit d5a77ff
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions internal/cloud/gcp/compute.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"):
Expand Down

0 comments on commit d5a77ff

Please sign in to comment.