https://github.com/azurelocal/azurelocal-vm-hydration
Server hydration and VM reconnect tooling for onboarding physical and existing servers into Azure Local
https://github.com/azurelocal/azurelocal-vm-hydration
azure-local azure-stack-hci azurelocal hydration powershell server-onboarding vm-reconnect
Last synced: 28 days ago
JSON representation
Server hydration and VM reconnect tooling for onboarding physical and existing servers into Azure Local
- Host: GitHub
- URL: https://github.com/azurelocal/azurelocal-vm-hydration
- Owner: AzureLocal
- License: mit
- Created: 2026-03-22T08:27:04.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-04-28T21:53:09.000Z (about 1 month ago)
- Last Synced: 2026-04-28T22:27:41.707Z (about 1 month ago)
- Topics: azure-local, azure-stack-hci, azurelocal, hydration, powershell, server-onboarding, vm-reconnect
- Language: PowerShell
- Homepage: http://azurelocal.cloud/azurelocal-vm-hydration/
- Size: 61.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Roadmap: docs/roadmap.md
Awesome Lists containing this project
README
# azurelocal-vm-hydration

[](https://azurelocal.cloud)
[](https://www.powershellgallery.com/packages/AzureLocalVMHydration)
[](LICENSE)
[](https://azurelocal.github.io/azurelocal-vm-hydration/)
[](https://github.com/PowerShell/PowerShell)
Documentation: [azurelocal.github.io/azurelocal-vm-hydration](https://azurelocal.github.io/azurelocal-vm-hydration/) | Solutions: [azurelocal.cloud](https://azurelocal.cloud)
> *Revive. Reconnect. Reclaim.*
PowerShell automation for adopting existing Hyper-V VMs into **Azure Local** management — without re-imaging or Sysprepping.
Covers two scenarios:
- **VM Hydration** — onboard an unmanaged Hyper-V VM *in place* using `az stack-hci-vm disk create-from-local`, registering it as a `Microsoft.AzureStackHCI/virtualMachineInstances` resource in Azure.
- **VM Reconnect** — restore a VM to a *different* Azure Local cluster and re-project it into Azure using `az stack-hci-vm reconnect-to-azure`.
> **Private Preview**
>
> These scripts implement the Microsoft Azure Local VM Reconnect Private Preview procedure. Requirements and CLI commands may change before general availability. Use in production at your own risk.
---
## Prerequisites
- Azure Local cluster running **2602 or later**
- `az stack-hci-vm` extension **≥ 1.11.9**
- VMs must reside in a storage path **GUID subfolder** (e.g., `C:\ClusterStorage\Volume1\\`)
- VMs must be configured as **Highly Available** in Failover Cluster Manager
- **Hyper-V Data Exchange Service (KVP)** and **Guest Service Interface** enabled on the VM
- Run as **Administrator** on a cluster node
---
## PowerShell Module (recommended)
Install from PSGallery — works anywhere PowerShell 7 is available:
```powershell
Install-Module AzureLocalVMHydration -Scope CurrentUser
```
### VM Hydration
```powershell
Invoke-VMHydration `
-VMName 'WEBSRV01' `
-ResourceGroup 'rg-azlocal-prod' `
-CustomLocation '/subscriptions//resourceGroups//providers/Microsoft.ExtendedLocation/customLocations/' `
-StoragePathId '/subscriptions//resourceGroups//providers/Microsoft.AzureStackHCI/storageContainers/' `
-NicName 'WEBSRV01-nic1' `
-SubnetId 'lnet-prod-vlan10' `
-Location 'eastus'
```
### VM Reconnect
```powershell
Invoke-VMReconnect `
-VMName 'APPSRV01' `
-LocalVMName 'APPSRV01_restored' `
-ResourceGroup 'rg-azlocal-prod' `
-CustomLocation '/subscriptions//resourceGroups//providers/Microsoft.ExtendedLocation/customLocations/' `
-NicName 'APPSRV01-nic2' `
-SubnetId 'lnet-prod-vlan10' `
-Location 'eastus' `
-RemoveSourceVM
```
### Pre-flight Check Only
```powershell
Test-VMHydrationPrerequisites -VMName 'WEBSRV01'
# Returns $true if all checks pass, $false if any fail
```
---
## Standalone Scripts
No install required — run directly on a cluster node:
```text
scripts/
├── helpers/
│ ├── Common-Functions.ps1 # Shared logging and Azure CLI wrappers
│ └── Test-HydrationPrerequisites.ps1 # Pre-flight checks (dot-sourced by both scripts)
├── Invoke-VMHydration.ps1 # Hydrate an unmanaged VM in-place
└── Invoke-VMReconnect.ps1 # Reconnect a VM after cross-cluster restore
```
Both scripts support `-WhatIf` for dry runs. See [Getting Started](https://azurelocal.github.io/azurelocal-vm-hydration/getting-started/) for full parameter reference and examples.
---
## Configuration
Copy `config/variables.example.yml` to `config/variables.yml` and fill in your environment values. `variables.yml` is gitignored — never commit it.
---
## Contributing
See [CONTRIBUTING.md](./CONTRIBUTING.md) for details.
---
## License
See [LICENSE](./LICENSE) for details.