Import-DSvRepo - One Script to Import Everything

Import-DSvRepo - One Script to Import Everything

Available now

This is the third piece of the air-gapped VMware patching puzzle. DSvClient downloads the repository from Broadcom, DSvRepoImport is the PowerShell module that knows how to talk to each vCenter API, and Import-DSvRepo is the wrapper script that ties them together into a single command.

If you’ve read my posts on DSvClient 0.8.0 and DSvRepoImport, you know the individual pieces. This post covers how the wrapper orchestrates them.

Why a Wrapper Script?

The DSvRepoImport module exports eight functions, each handling a different data type. Calling them one by one with the right parameters and credentials gets tedious fast — especially when you’re doing it regularly across multiple vCenter instances.

Import-DSvRepo.ps1 reduces it to:

.\Import-DSvRepo.ps1 -VCenterServer vcsa.domain.local `
    -RepoPath D:\VMware-repo `
    -VersionFilter '8.0*' `
    -BuildFilter '2*'

Two credential prompts (one for the vCenter REST API, one for VCSA OS root), then it runs through everything automatically.

What It Does, In Order

The script calls the module functions in dependency order:

  1. Import-VsanHclDatabase — uploads the vSAN Hardware Compatibility List JSON from hcl/all.json in the repo
  2. Import-VsanReleaseCatalog — uploads the vSAN Release Catalog from vcg/vsan_release_catalog.json
  3. Import-VcgDatabase — uploads the VCG compatibility database from vvs_data.gz
  4. Import-VlcmOfflineBundle — scans the repo for all four depot types (main/, addon-main/, iovp-main/, vmtools-main/) and imports each as vLCM offline depot bundles. Handles version/build filtering, size-based chunking for the 2 GB API limit, and deduplication of already-imported depots.

VCSA appliance patching (Install-VcsaPatch) is intentionally not called by the wrapper. Patching is destructive — it restarts all vCenter services and can take 30+ minutes — so it should be a conscious decision, not something that runs as part of a bulk import.

Parameters

ParameterDescription
-VCenterServerFQDN or IP of the vCenter instance
-RepoPathPath to the DSvClient-downloaded repository root
-VCSAUserUsername for VCSA OS access (default: root)
-VersionFilterWildcard filter for ESXi/vCenter versions to import (e.g. 8.0*)
-BuildFilterWildcard filter for build numbers
-CleanupBeforeImportRemove all existing vLCM offline depots before importing. Off by default — use this when you want a clean slate.

Version and Build Filtering

The -VersionFilter and -BuildFilter parameters are passed through to Import-VlcmOfflineBundle and control which ESXi builds get packaged into offline depot bundles. If your repo contains every ESXi 7.x and 8.x build from the last two years but you only care about 8.0 Update 3, filtering saves significant time and disk space on the VCSA:

# Only import ESXi 8.0 builds starting with "24" or "25" (U3 era)
.\Import-DSvRepo.ps1 -VCenterServer vcsa.domain.local `
    -RepoPath D:\VMware-repo `
    -VersionFilter '8.0*' `
    -BuildFilter '2[45]*'

Without filters, everything in the repo gets imported — which is fine if that’s what you want, just slower.

The Typical Air-Gapped Workflow

Here’s how the three tools fit together end-to-end:

On your internet-connected machine:

# 1. Download everything from Broadcom
./DSvClient --config sources.toml --output /mnt/usb/VMware-repo

Transfer the repo to the air-gapped network (USB drive, data diode, sneakernet, whatever your security policy requires).

On your management workstation inside the air gap:

# 2. Import depot data into vCenter
.\Import-DSvRepo.ps1 -VCenterServer vcsa.domain.local `
    -RepoPath D:\VMware-repo

# 3. If there's a VCSA appliance patch to apply
Install-VcsaPatch -VCSAHost vcsa.domain.local -Credential $cred `
    -SourcePath 'D:\VMware-repo\valm\8.0.3.00800' -Install

Step 2 takes 10-30 minutes depending on how many depot bundles need uploading (the SFTP transfer of multi-GB bundles to the appliance is the bottleneck). Step 3 takes another 20-40 minutes for the actual patch installation.

Prerequisites

The script requires the DSvRepoImport module and its dependencies:

Install-Module VMware.PowerCLI -Scope CurrentUser
Install-Module WinSCP -Scope CurrentUser
Install-Module Posh-SSH -Scope CurrentUser

Place DSvRepoImport.psm1 and DSvRepoImport.psd1 somewhere on your $env:PSModulePath, or Import-Module them explicitly before running the wrapper.

What’s Next

For the next iteration I’m considering adding a -WhatIf mode that scans the repo and reports what would be imported without actually doing it — useful for reviewing the scope of an import before committing. Also on the list is support for generating a diff report between what’s already in vCenter’s vLCM depot and what’s in the local repo, so you can see exactly what’s new before importing.

Both the module and the wrapper script are on my OneDev instance. DSvClient is on GitHub. Questions or issues — reach out. 🛠️

This article was updated on 25 Apr 2026