Skip to content

Commit

Permalink
platform/api/azure: Narrow down trusted launch enablement
Browse files Browse the repository at this point in the history
Only amd64 instances support trusted launch. When pre-creating a
gallery, we also want TL to be used.

Signed-off-by: Jeremi Piotrowski <[email protected]>
  • Loading branch information
jepio committed Apr 12, 2024
1 parent 661f09c commit 5bdfe19
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion platform/api/azure/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"io"
"io/ioutil"
"regexp"
"strings"
"time"

"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
Expand Down Expand Up @@ -152,7 +153,9 @@ func (a *API) getVMParameters(name, userdata, sshkey, storageAccountURI string,
},
}

if a.Opts.HyperVGeneration == string(compute.HyperVGenerationTypeV2) && a.Opts.UseGallery {
if a.Opts.HyperVGeneration == string(compute.HyperVGenerationTypeV2) &&
(a.Opts.UseGallery || strings.Contains(a.Opts.DiskURI, "galleries")) &&
a.Opts.Board == "amd64-usr" {
vm.SecurityProfile = &compute.SecurityProfile{
SecurityType: compute.SecurityTypesTrustedLaunch,
UefiSettings: &compute.UefiSettings{
Expand Down

0 comments on commit 5bdfe19

Please sign in to comment.