-
Notifications
You must be signed in to change notification settings - Fork 11
/
create_vhd_from_azure_vm.ps1
33 lines (27 loc) · 1.76 KB
/
create_vhd_from_azure_vm.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#
# Copies user VHDs it finds for VMs in the reference resource group into the 'clean-vhds'
# storage container. The target blobs will have the name of the VM, as a .vhd
#
# Author: John W. Fawcett, Principal Software Development Engineer, Microsoft
#
param (
[Parameter(Mandatory=$false)] [string] $sourceSA="smokevhds",
[Parameter(Mandatory=$false)] [string] $sourceRG="smoke_source_resource_group",
[Parameter(Mandatory=$false)] [string] $sourceContainer="vhds",
[Parameter(Mandatory=$false)] [string] $sourceExtension=".vhd",
#
# Normally you don't need to change these...
[Parameter(Mandatory=$false)] [string] $destSA="smokesourcestorageacct",
[Parameter(Mandatory=$false)] [string] $destRG="smoke_source_resource_group",
[Parameter(Mandatory=$false)] [string] $destContainer="clean-vhds",
[Parameter(Mandatory=$false)] [string] $destExtension="-Smoke-1.vhd",
[Parameter(Mandatory=$false)] [string] $location="westus",
[Parameter(Mandatory=$false)] [string[]] $vmNames=""
)
Start-Transcript C:\temp\transcripts\create_vhd_from_azure_vm.log -Force
Write-Host "Launching jobs to copy machine image from $sourceRG/$sourceSA/$sourceContainer to $destRG/$destSA/$destContainer..." -ForegroundColor Yellow
C:\Framework-Scripts\copy_single_image_container_to_container.ps1 -sourceSA $sourceSA -sourceRG $sourceRG -sourceContainer $sourceContainer -destSA $destSA `
-destRG $destRG -sourceExtension ".vhd" -destExtension $destExtension -destContainer $destContainer `
-location $location -makeDronesFromAll -overwriteVHDs -vmNamesIn $vmNames
Write-Host "Machines are ready for assimilation..."
Stop-Transcript