Skip to content

Commit

Permalink
cloud/gcp: update guest OS features to match prod RHEL images
Browse files Browse the repository at this point in the history
We need to update these to match what is being set for the rhel9
and rhel8 images produced by Google (on behalf of Red Hat) today.

Also rework the comments to add context.

```
root@24de7c60b75c:~# gcloud compute images describe-from-family --project rhel-cloud rhel-8
architecture: X86_64
archiveSizeBytes: '9314286336'
creationTimestamp: '2024-09-10T13:40:19.727-07:00'
description: Red Hat, Red Hat Enterprise Linux, 8, x86_64 built on 20240910
diskSizeGb: '20'
enableConfidentialCompute: false
family: rhel-8
guestOsFeatures:
- type: UEFI_COMPATIBLE
- type: VIRTIO_SCSI_MULTIQUEUE
- type: SEV_CAPABLE
- type: SEV_SNP_CAPABLE
- type: SEV_LIVE_MIGRATABLE
- type: SEV_LIVE_MIGRATABLE_V2
- type: GVNIC
- type: IDPF
id: '2720211119037550684'
kind: compute#image
labelFingerprint: 42WmSpB8rSM=
licenseCodes:
- '601259152637613565'
licenses:
- https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-8-server
name: rhel-8-v20240910
rawDisk:
  containerType: TAR
  source: ''
selfLink: https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/images/rhel-8-v20240910
sourceType: RAW
status: READY
storageLocations:
- asia
- us
- eu
```

```
root@24de7c60b75c:~# gcloud compute images describe-from-family --project rhel-cloud rhel-9
architecture: X86_64
archiveSizeBytes: '8386093056'
creationTimestamp: '2024-09-10T13:40:19.697-07:00'
description: Red Hat, Red Hat Enterprise Linux, 9, x86_64 built on 20240910
diskSizeGb: '20'
enableConfidentialCompute: false
family: rhel-9
guestOsFeatures:
- type: UEFI_COMPATIBLE
- type: VIRTIO_SCSI_MULTIQUEUE
- type: SEV_CAPABLE
- type: SEV_SNP_CAPABLE
- type: SEV_LIVE_MIGRATABLE
- type: SEV_LIVE_MIGRATABLE_V2
- type: GVNIC
- type: IDPF
id: '4739446824535658588'
kind: compute#image
labelFingerprint: 42WmSpB8rSM=
licenseCodes:
- '7883559014960410759'
licenses:
- https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-9-server
name: rhel-9-v20240910
rawDisk:
  containerType: TAR
  source: ''
selfLink: https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/images/rhel-9-v20240910
sourceType: RAW
status: READY
storageLocations:
- asia
- eu
- us
```
  • Loading branch information
dustymabe committed Sep 13, 2024
1 parent 70fce2f commit 796231d
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions pkg/cloud/gcp/compute.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,42 @@ import (
"github.com/osbuild/images/internal/common"
)

// Default Guest OS Features [1]. Note that officially Google creates the
// RHEL images in the rhel-cloud project in the rhel8,rhel9,etc image
// families. Periodically we'll want to make sure that the lists here
// are up to date with what is being produced there. You can see this
// with a command like:
// gcloud compute images describe-from-family --project rhel-cloud rhel-9
//
// Note also for the time being that we should make sure the image upload
// code for CoreOS [2] should be kept in sync with this until CoreOS
// starts using OSBuild for image uploading.
//
// [1] https://cloud.google.com/compute/docs/images/create-custom#guest-os-features
// [2] https://github.com/coreos/coreos-assembler/blob/main/mantle/platform/api/gcloud/image.go

// Guest OS Features for RHEL8 images
var GuestOsFeaturesRHEL8 []*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_SEV_SNP_CAPABLE.String())},
{Type: common.ToPtr(computepb.GuestOsFeature_SEV_LIVE_MIGRATEABLE.String())},

Check failure on line 35 in pkg/cloud/gcp/compute.go

View workflow job for this annotation

GitHub Actions / ⌨ Lint

undefined: computepb.GuestOsFeature_SEV_LIVE_MIGRATEABLE

Check failure on line 35 in pkg/cloud/gcp/compute.go

View workflow job for this annotation

GitHub Actions / ⌨ Lint

undefined: computepb.GuestOsFeature_SEV_LIVE_MIGRATEABLE
{Type: common.ToPtr(computepb.GuestOsFeature_SEV_LIVE_MIGRATEABLE_V2.String())},

Check failure on line 36 in pkg/cloud/gcp/compute.go

View workflow job for this annotation

GitHub Actions / ⌨ Lint

undefined: computepb.GuestOsFeature_SEV_LIVE_MIGRATEABLE_V2

Check failure on line 36 in pkg/cloud/gcp/compute.go

View workflow job for this annotation

GitHub Actions / ⌨ Lint

undefined: computepb.GuestOsFeature_SEV_LIVE_MIGRATEABLE_V2
{Type: common.ToPtr(computepb.GuestOsFeature_GVNIC.String())},
{Type: common.ToPtr(computepb.GuestOsFeature_IDPF.String())},
}

// Guest OS Features for RHEL9 images. Note that if you update this, also
// consider changing the code in https://github.com/coreos/coreos-assembler/blob/0083086c4720b602b8243effb85c0a1f73f013dd/mantle/platform/api/gcloud/image.go#L105
// for RHEL CoreOS which uses coreos-assembler today.
// Guest OS Features for RHEL9 images.
var GuestOsFeaturesRHEL9 []*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_SEV_SNP_CAPABLE.String())},
{Type: common.ToPtr(computepb.GuestOsFeature_SEV_LIVE_MIGRATEABLE.String())},

Check failure on line 47 in pkg/cloud/gcp/compute.go

View workflow job for this annotation

GitHub Actions / ⌨ Lint

undefined: computepb.GuestOsFeature_SEV_LIVE_MIGRATEABLE

Check failure on line 47 in pkg/cloud/gcp/compute.go

View workflow job for this annotation

GitHub Actions / ⌨ Lint

undefined: computepb.GuestOsFeature_SEV_LIVE_MIGRATEABLE
{Type: common.ToPtr(computepb.GuestOsFeature_SEV_LIVE_MIGRATEABLE_V2.String())},

Check failure on line 48 in pkg/cloud/gcp/compute.go

View workflow job for this annotation

GitHub Actions / ⌨ Lint

undefined: computepb.GuestOsFeature_SEV_LIVE_MIGRATEABLE_V2 (typecheck)

Check failure on line 48 in pkg/cloud/gcp/compute.go

View workflow job for this annotation

GitHub Actions / ⌨ Lint

undefined: computepb.GuestOsFeature_SEV_LIVE_MIGRATEABLE_V2) (typecheck)
{Type: common.ToPtr(computepb.GuestOsFeature_GVNIC.String())},
{Type: common.ToPtr(computepb.GuestOsFeature_IDPF.String())},
}

// GuestOsFeaturesByDistro returns the the list of Guest OS Features, which
Expand Down

0 comments on commit 796231d

Please sign in to comment.