I am not able to create new Azure VMs using images I have captured through PowerShell.
Here is the situation I am in.
- I create 2 Windows VMs "mydevbox1" and "mydevbox2" using the latest image of Windows Server 2012 R2 in Azure gallery
- I install necessary software and configure both exactly the same
- 3a. I capture the the image of mydevbox1 called mydevbox1-image-PS using the powershell script below.
- 3b. I capture the image of mydevbox2 called mydevbox2-image-Manual using the manual/portal process (sysprep -> capture image) (ofcourse I do it from a separate vm).
- 4a. When I try to create a new vm using the mydevbox1-image-PS created through powershell, the VM creation process fails (provisioning times out)
- 4b. When I try to create a new vm using the mydevbox2-image-Manual created through the manual process, the VM creation is successful.
Please help.
PowerShell Script I am using the capture the image
Save-AzureVMImage –ServiceName $serviceName_toCapture –Name $vmName_toCapture –ImageName $imageName_Captured_Generalized –OSState "Generalized" -ImageLabel $imageLabel_Captured_Generalized -Verbose