@@ -86,12 +86,37 @@ func (a *API) CreateImage(spec *ImageSpec, overwrite bool) (*compute.Operation,
86
86
}
87
87
}
88
88
89
+ features := []* compute.GuestOsFeature {
90
+ // https://cloud.google.com/compute/docs/images/create-delete-deprecate-private-images
91
+ {
92
+ Type : "VIRTIO_SCSI_MULTIQUEUE" ,
93
+ },
94
+ // RHEL supports this since 8.4; TODO share logic here with
95
+ // https://github.com/osbuild/osbuild-composer/blob/c6570f6c94149b47f2f8e2f82d7467d6b96755bb/internal/cloud/gcp/compute.go#L16
96
+ {
97
+ Type : "SEV_CAPABLE" ,
98
+ },
99
+ {
100
+ Type : "GVNIC" ,
101
+ },
102
+ {
103
+ Type : "UEFI_COMPATIBLE" ,
104
+ },
105
+ // https://cloud.google.com/blog/products/identity-security/rsa-snp-vm-more-confidential
106
+ {
107
+ Type : "SEV_SNP_CAPABLE" ,
108
+ },
109
+ }
110
+
89
111
if spec .Architecture == "" {
90
112
spec .Architecture = runtime .GOARCH
91
113
}
92
114
switch spec .Architecture {
93
115
case "amd64" , "x86_64" :
94
116
spec .Architecture = "X86_64"
117
+ // Enables support for live migration of AMD SEV SNP capable images in GCP.
118
+ // See: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=ac3f9c9f1b37edaa7d1a9b908bc79d843955a1a2
119
+ features = append (features , & compute.GuestOsFeature {Type : "SEV_LIVE_MIGRATABLE_V2" })
95
120
case "arm64" , "aarch64" :
96
121
spec .Architecture = "ARM64"
97
122
default :
@@ -116,28 +141,6 @@ func (a *API) CreateImage(spec *ImageSpec, overwrite bool) (*compute.Operation,
116
141
}
117
142
}
118
143
119
- features := []* compute.GuestOsFeature {
120
- // https://cloud.google.com/compute/docs/images/create-delete-deprecate-private-images
121
- {
122
- Type : "VIRTIO_SCSI_MULTIQUEUE" ,
123
- },
124
- // RHEL supports this since 8.4; TODO share logic here with
125
- // https://github.com/osbuild/osbuild-composer/blob/c6570f6c94149b47f2f8e2f82d7467d6b96755bb/internal/cloud/gcp/compute.go#L16
126
- {
127
- Type : "SEV_CAPABLE" ,
128
- },
129
- {
130
- Type : "GVNIC" ,
131
- },
132
- {
133
- Type : "UEFI_COMPATIBLE" ,
134
- },
135
- // https://cloud.google.com/blog/products/identity-security/rsa-snp-vm-more-confidential
136
- {
137
- Type : "SEV_SNP_CAPABLE" ,
138
- },
139
- }
140
-
141
144
image := & compute.Image {
142
145
Architecture : spec .Architecture ,
143
146
Family : spec .Family ,
0 commit comments