···611611 return nil
612612}
613613614614-// getAvailableDevices gets list of available HSM devices from HSMPools in the operator namespace
614614+// getAvailableDevices gets list of available physical HSM devices from HSMPools in the operator namespace
615615func (mm *MirrorManager) getAvailableDevices(ctx context.Context, operatorNamespace string) ([]string, error) {
616616 var hsmPoolList hsmv1alpha1.HSMPoolList
617617 // HSMPools are always in the operator namespace (where controller-manager runs)
···623623624624 for _, pool := range hsmPoolList.Items {
625625 if pool.Status.Phase == hsmv1alpha1.HSMPoolPhaseReady {
626626- for _, deviceRef := range pool.Spec.HSMDeviceRefs {
627627- deviceNames[deviceRef] = true
626626+ // Count actual aggregated physical devices, not just device references
627627+ for i, aggregatedDevice := range pool.Status.AggregatedDevices {
628628+ if aggregatedDevice.Available {
629629+ // Create unique device name for each physical device instance
630630+ // This matches the agent naming scheme: deviceRef-i
631631+ for _, deviceRef := range pool.Spec.HSMDeviceRefs {
632632+ physicalDeviceName := fmt.Sprintf("%s-%d", deviceRef, i)
633633+ deviceNames[physicalDeviceName] = true
634634+ }
635635+ }
628636 }
629637 }
630638 }