|
| 1 | +# Variable Reference |
| 2 | + |
| 3 | +All VM conversion scripts use a central configuration file: `config/variables.yml`. This file documents the common values you will need across all scripts. Future versions may support loading from this file directly. |
| 4 | + |
| 5 | +!!! tip "Getting started" |
| 6 | + Copy the example and fill in your values: |
| 7 | + ```powershell |
| 8 | + cp config/variables.example.yml config/variables.yml |
| 9 | + ``` |
| 10 | + **Never commit** `variables.yml` — it is excluded by `.gitignore` because it contains environment-specific values. |
| 11 | + |
| 12 | +!!! note "Current usage" |
| 13 | + These scripts currently accept parameters directly on the command line. |
| 14 | + This file documents the common values you will need and serves as the canonical parameter reference. |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## Naming Rules |
| 19 | + |
| 20 | +| Scope | Convention | Example | |
| 21 | +|-------|-----------|---------| |
| 22 | +| Top-level sections | `snake_case` | `azure_local`, `conversion` | |
| 23 | +| Keys within sections | `snake_case` | `subscription_id`, `max_parallel` | |
| 24 | +| Azure resource IDs | Full ARM resource ID | `/subscriptions/.../customLocations/cl-01` | |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +## Azure |
| 29 | + |
| 30 | +```yaml |
| 31 | +azure: |
| 32 | + subscription_id: "00000000-0000-0000-0000-000000000000" |
| 33 | + resource_group: "rg-azurelocal-prod" |
| 34 | + location: "eastus" |
| 35 | +``` |
| 36 | +
|
| 37 | +| Variable | Type | Required | Description | Default | |
| 38 | +|----------|------|:--------:|-------------|---------| |
| 39 | +| `azure.subscription_id` | string | **Yes** | Azure subscription ID | — | |
| 40 | +| `azure.resource_group` | string | **Yes** | Resource group containing the target VMs | — | |
| 41 | +| `azure.location` | string | **Yes** | Azure region | `eastus` | |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +## Azure Local |
| 46 | + |
| 47 | +```yaml |
| 48 | +azure_local: |
| 49 | + custom_location_id: "/subscriptions/.../customLocations/cl-azurelocal-01" |
| 50 | + logical_network_id: "/subscriptions/.../logicalNetworks/lnet-mgmt-01" |
| 51 | +``` |
| 52 | + |
| 53 | +| Variable | Type | Required | Description | Default | |
| 54 | +|----------|------|:--------:|-------------|---------| |
| 55 | +| `azure_local.custom_location_id` | string | **Yes** | Full ARM resource ID of the Azure Local custom location | — | |
| 56 | +| `azure_local.logical_network_id` | string | **Yes** | Full ARM resource ID of the logical network for the converted VM | — | |
| 57 | + |
| 58 | +--- |
| 59 | + |
| 60 | +## Conversion Settings |
| 61 | + |
| 62 | +```yaml |
| 63 | +conversion: |
| 64 | + working_directory: "C:\\ClusterStorage\\Volume01\\Gen2Conversion" |
| 65 | + max_parallel: 1 |
| 66 | +``` |
| 67 | + |
| 68 | +| Variable | Type | Required | Description | Default | |
| 69 | +|----------|------|:--------:|-------------|---------| |
| 70 | +| `conversion.working_directory` | string | **Yes** | Scratch directory for conversion work files (must have sufficient free space) | — | |
| 71 | +| `conversion.max_parallel` | integer | No | Number of VMs to process in parallel (`1` = sequential) | `1` | |
| 72 | + |
| 73 | +--- |
| 74 | + |
| 75 | +## Tags |
| 76 | + |
| 77 | +```yaml |
| 78 | +tags: |
| 79 | + project: "VM-Conversion" |
| 80 | + environment: "production" |
| 81 | + workload: "gen1-to-gen2" |
| 82 | + solution: "vmconvert-azure-local" |
| 83 | +``` |
| 84 | + |
| 85 | +| Variable | Type | Required | Description | Default | |
| 86 | +|----------|------|:--------:|-------------|---------| |
| 87 | +| `tags.project` | string | No | Project tag | `VM-Conversion` | |
| 88 | +| `tags.environment` | string | No | Environment tag | `production` | |
| 89 | +| `tags.workload` | string | No | Workload type tag | `gen1-to-gen2` | |
| 90 | +| `tags.solution` | string | No | Solution identifier tag | `vmconvert-azure-local` | |
| 91 | + |
| 92 | +--- |
| 93 | + |
| 94 | +## Script Parameter Mapping |
| 95 | + |
| 96 | +The table below maps `variables.yml` keys to the actual script parameters: |
| 97 | + |
| 98 | +| Variable Key | Azure Local Script Param | Hyper-V Script Param | |
| 99 | +|-------------|-------------------------|---------------------| |
| 100 | +| `azure.subscription_id` | `-SubscriptionId` | N/A | |
| 101 | +| `azure.resource_group` | `-ResourceGroup` | N/A | |
| 102 | +| `azure_local.custom_location_id` | `-CustomLocationId` | N/A | |
| 103 | +| `azure_local.logical_network_id` | `-LogicalNetworkId` | N/A | |
| 104 | +| `conversion.working_directory` | `-WorkingDirectory` | `-WorkingDirectory` | |
| 105 | +| `conversion.max_parallel` | `-MaxParallel` | `-MaxParallel` | |
0 commit comments