diff --git a/README.md b/README.md index 028f485..a80340d 100644 --- a/README.md +++ b/README.md @@ -533,6 +533,8 @@ target hosts visible to the operator who creates or edits them. VMware vCenter import uses the effective Config / Integrations values (`vcenter_*` settings or the `VCENTER_*` environment variables). The backend creates a vCenter REST session with `POST /api/session`, lists VMs from `/api/vcenter/vm`, and then best-effort enriches each candidate from guest identity/networking endpoints. FQDN and IP discovery depends on VMware Tools data; when guest data is unavailable, the import falls back to the VM name as the host address and records the limitation in host notes. +For `field: "name"` filters, the API scans the full VM summary list returned by vCenter before guest enrichment, so large inventories are not accidentally missed by the preview limit. The preview response includes `diagnostics` with `totalFromVCenter`, `summaryMatched`, `scanned`, `resultLimit`, and `sampleNames`; the wizard displays those values when troubleshooting a no-result preview. + Preview payload: ```json diff --git a/client/src/App.vue b/client/src/App.vue index 3c7a24b..8cb0e2b 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -425,6 +425,7 @@ :loading="vcenterImportLoading" :error="vcenterImportError" :status="vcenterImportStatus" + :diagnostics="vcenterImportDiagnostics" @close="vcenterImportOpen = false" @preview="previewVCenterImport" @import="importVCenterHosts" @@ -980,6 +981,7 @@ const vcenterImportLoading = ref(false); const vcenterImportError = ref(''); const vcenterPreviewRows = ref([]); const vcenterImportStatus = ref(null); +const vcenterImportDiagnostics = ref(null); const credentialModalOpen = ref(false); const runPlanModalOpen = ref(false); const variableModalOpen = ref(false); @@ -2349,6 +2351,7 @@ async function saveHost() { async function openVCenterImport() { vcenterImportOpen.value = true; vcenterImportError.value = ''; + vcenterImportDiagnostics.value = null; try { vcenterImportStatus.value = await api.get('/api/hosts/import/vcenter/status'); } catch (err) { @@ -2362,8 +2365,9 @@ async function previewVCenterImport(payload) { try { const result = await api.post('/api/hosts/import/vcenter/preview', payload); vcenterImportStatus.value = result.status; + vcenterImportDiagnostics.value = result.diagnostics || null; vcenterPreviewRows.value = result.candidates || []; - notify(`Found ${result.count || 0} vCenter host candidate(s)`); + notify(`Found ${result.count || 0} vCenter host candidate(s) from ${result.diagnostics?.totalFromVCenter ?? 'unknown'} VM(s)`); } catch (err) { vcenterImportError.value = err.message; notify(err.message, 'error'); @@ -2379,6 +2383,7 @@ async function importVCenterHosts(payload) { const result = await api.post('/api/hosts/import/vcenter', payload); await refreshAll(); vcenterPreviewRows.value = []; + vcenterImportDiagnostics.value = null; vcenterImportOpen.value = false; const skipped = result.skipped?.length || 0; notify(`Imported ${result.imported?.length || 0} host(s)${skipped ? `, skipped ${skipped} duplicate(s)` : ''}`); diff --git a/client/src/components/hosts/VCenterImportModal.vue b/client/src/components/hosts/VCenterImportModal.vue index 7b02118..d3e2e47 100644 --- a/client/src/components/hosts/VCenterImportModal.vue +++ b/client/src/components/hosts/VCenterImportModal.vue @@ -115,6 +115,13 @@
{{ error }}
+
+ Preview diagnostics + {{ diagnostics.totalFromVCenter }} VM(s) returned by vCenter + {{ diagnostics.summaryMatched }} VM(s) matched before guest enrichment + {{ diagnostics.scanned }} VM(s) scanned for guest FQDN/IP details + Sample inventory names: {{ diagnostics.sampleNames.join(', ') }} +