Skip to content

Commit 5ef5765

Browse files
author
Jeremi Piotrowski
committed
platform/api/azure: Narrow down trusted launch enablement
Only amd64 instances support trusted launch. When pre-creating a gallery, we also want TL to be used. Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
1 parent 661f09c commit 5ef5765

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

platform/api/azure/instance.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"io"
2222
"io/ioutil"
2323
"regexp"
24+
"strings"
2425
"time"
2526

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

155-
if a.Opts.HyperVGeneration == string(compute.HyperVGenerationTypeV2) && a.Opts.UseGallery {
156+
if a.Opts.HyperVGeneration == string(compute.HyperVGenerationTypeV2) &&
157+
(a.Opts.UseGallery || strings.Contains(a.Opts.DiskURI, "galleries")) &&
158+
a.Opts.Board == "amd64-usr" {
156159
vm.SecurityProfile = &compute.SecurityProfile{
157160
SecurityType: compute.SecurityTypesTrustedLaunch,
158161
UefiSettings: &compute.UefiSettings{

0 commit comments

Comments
 (0)