Skip to content

Commit 3c0b4df

Browse files
authored
Merge pull request #901 from CecileRobertMichon/boot-diagnostics
✨ Enable VM boot diagnostics
2 parents 3386cdd + 0ccb197 commit 3c0b4df

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

cloud/services/scalesets/vmss.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ func (s *Service) Reconcile(ctx context.Context) error {
141141
},
142142
},
143143
StorageProfile: storageProfile,
144+
DiagnosticsProfile: &compute.DiagnosticsProfile{
145+
BootDiagnostics: &compute.BootDiagnostics{
146+
Enabled: to.BoolPtr(true),
147+
},
148+
},
144149
NetworkProfile: &compute.VirtualMachineScaleSetNetworkProfile{
145150
NetworkInterfaceConfigurations: &[]compute.VirtualMachineScaleSetNetworkConfiguration{
146151
{

cloud/services/scalesets/vmss_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,11 @@ func TestReconcileVMSS(t *testing.T) {
313313
},
314314
},
315315
},
316+
DiagnosticsProfile: &compute.DiagnosticsProfile{
317+
BootDiagnostics: &compute.BootDiagnostics{
318+
Enabled: to.BoolPtr(true),
319+
},
320+
},
316321
NetworkProfile: &compute.VirtualMachineScaleSetNetworkProfile{
317322
NetworkInterfaceConfigurations: &[]compute.VirtualMachineScaleSetNetworkConfiguration{
318323
{
@@ -453,6 +458,11 @@ func TestReconcileVMSS(t *testing.T) {
453458
},
454459
},
455460
},
461+
DiagnosticsProfile: &compute.DiagnosticsProfile{
462+
BootDiagnostics: &compute.BootDiagnostics{
463+
Enabled: to.BoolPtr(true),
464+
},
465+
},
456466
NetworkProfile: &compute.VirtualMachineScaleSetNetworkProfile{
457467
NetworkInterfaceConfigurations: &[]compute.VirtualMachineScaleSetNetworkConfiguration{
458468
{
@@ -580,6 +590,11 @@ func TestReconcileVMSS(t *testing.T) {
580590
},
581591
},
582592
},
593+
DiagnosticsProfile: &compute.DiagnosticsProfile{
594+
BootDiagnostics: &compute.BootDiagnostics{
595+
Enabled: to.BoolPtr(true),
596+
},
597+
},
583598
NetworkProfile: &compute.VirtualMachineScaleSetNetworkProfile{
584599
NetworkInterfaceConfigurations: &[]compute.VirtualMachineScaleSetNetworkConfiguration{
585600
{
@@ -660,6 +675,11 @@ func TestReconcileVMSS(t *testing.T) {
660675
DisablePasswordAuthentication: to.BoolPtr(true),
661676
},
662677
},
678+
DiagnosticsProfile: &compute.DiagnosticsProfile{
679+
BootDiagnostics: &compute.BootDiagnostics{
680+
Enabled: to.BoolPtr(true),
681+
},
682+
},
663683
StorageProfile: &compute.VirtualMachineScaleSetUpdateStorageProfile{
664684
ImageReference: &compute.ImageReference{
665685
Publisher: to.StringPtr("fake-publisher"),

cloud/services/virtualmachines/virtualmachines.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ func (s *Service) Reconcile(ctx context.Context) error {
137137
Priority: priority,
138138
EvictionPolicy: evictionPolicy,
139139
BillingProfile: billingProfile,
140+
DiagnosticsProfile: &compute.DiagnosticsProfile{
141+
BootDiagnostics: &compute.BootDiagnostics{
142+
Enabled: to.BoolPtr(true),
143+
},
144+
},
140145
},
141146
}
142147

cloud/services/virtualmachines/virtualmachines_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,11 @@ func TestReconcileVM(t *testing.T) {
376376
},
377377
},
378378
},
379+
DiagnosticsProfile: &compute.DiagnosticsProfile{
380+
BootDiagnostics: &compute.BootDiagnostics{
381+
Enabled: to.BoolPtr(true),
382+
},
383+
},
379384
NetworkProfile: &compute.NetworkProfile{
380385
NetworkInterfaces: &[]compute.NetworkInterfaceReference{
381386
{
@@ -1013,6 +1018,11 @@ func TestReconcileVM(t *testing.T) {
10131018
},
10141019
},
10151020
},
1021+
DiagnosticsProfile: &compute.DiagnosticsProfile{
1022+
BootDiagnostics: &compute.BootDiagnostics{
1023+
Enabled: to.BoolPtr(true),
1024+
},
1025+
},
10161026
OsProfile: &compute.OSProfile{
10171027
ComputerName: to.StringPtr("my-vm"),
10181028
AdminUsername: to.StringPtr("capi"),

0 commit comments

Comments
 (0)