Use this when automating VMware datastore creation, rescans and space checks.
Datastores · VMware Automation
Datastore automation creates and monitors VMFS and NFS datastores with New-Datastore, rescans HBAs, reports free space and moves VMs with Storage vMotion.
1. Datastore automation: capacity reports, placement via datastore clusters/SPBM, rescans.
2. Alert on low space.
3. Automate Storage vMotion for balancing.
4. Tag-based policies.
5. Clean orphaned files.
policy → placement → datastore
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
The negative fixture should deliberately exercise risks such as duplicate names, stale inventory, task still running after client timeout, vCenter/host permission gaps, storage/network dependency failure and assuming task success shows guest service health, choosing the cases most relevant to running/candidate/startup identity, capability advertisement, edit/commit semantics and correct separation of configuration from operational state.
Step 2 Common mistakes Narrow the fault
- Placing VMs without free-space checks.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- New-Datastore creates datastores.
- Rescan HBAs before creating.
- Monitor free space.
Get-Datastore | ft Name,FreeSpaceGB,CapacityGB— capacityGet-DatastoreCluster— SDRS clusters- Storage policies (SPBM) assignment — placement
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
Datastore automation selects, monitors and maintains VM storage: choosing where new VMs go, checking free space, moving VMs between datastores and cleaning up orphaned files and old snapshots.
Get-Datastore | Select-Object Name, @{n='FreeGB';e={[math]::Round($_.FreeSpaceGB)}}, @{n='Pct';e={[math]::Round(100*$_.FreeSpaceGB/$_.CapacityGB)}} | Sort-Object Pct
Get-VM | Get-Snapshot | Where-Object Created -lt (Get-Date).AddDays(-7)
Move-VM -VM app01 -Datastore ds-ssd-02
Use datastore clusters with Storage DRS or tag-based storage policies so provisioning picks a datastore by policy rather than by hard-coded name, and alert on free space before thin-provisioned disks fill a datastore.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in VMware Automation > Datastores. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://developer.broadcom.com/powercli · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
For running/candidate/startup identity, capability advertisement, edit/commit semantics and correct separation of configuration from operational state, prefer typed fields and stable IDs over human presentation text.