diff --git a/azure/scope/machinepool.go b/azure/scope/machinepool.go index c2509749390..dfebca01b84 100644 --- a/azure/scope/machinepool.go +++ b/azure/scope/machinepool.go @@ -334,14 +334,18 @@ func (m *MachinePoolScope) applyAzureMachinePoolMachines(ctx context.Context) er } func (m *MachinePoolScope) createMachine(ctx context.Context, machine azure.VMSSVM) error { + ctx, _, done := tele.StartSpanWithLogger(ctx, "scope.MachinePoolScope.createMachine") + defer done() + parsed, err := azure2.ParseResourceID(machine.ID) if err != nil { return errors.Wrap(err, fmt.Sprintf("failed to parse resource id %q", machine.ID)) } + instanceID := strings.ReplaceAll(parsed.ResourceName, "_", "-") ampm := infrav1exp.AzureMachinePoolMachine{ ObjectMeta: metav1.ObjectMeta{ - Name: strings.ReplaceAll(parsed.ResourceName, "_", "-"), + Name: m.AzureMachinePool.Name + "-" + instanceID, Namespace: m.AzureMachinePool.Namespace, OwnerReferences: []metav1.OwnerReference{ {