From f793d219b2d081325454e8a0ddf887728d117cb9 Mon Sep 17 00:00:00 2001 From: David Tesar Date: Wed, 16 May 2018 15:29:54 -0400 Subject: [PATCH 1/2] Only show Windows Sysprep code with validation The first example completes successfully, but will not let you know that the image is not actually able to be deployed to a VM. --- website/source/docs/builders/azure.html.md | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/website/source/docs/builders/azure.html.md b/website/source/docs/builders/azure.html.md index 976268232..6af8986cd 100644 --- a/website/source/docs/builders/azure.html.md +++ b/website/source/docs/builders/azure.html.md @@ -260,23 +260,7 @@ Please refer to the Azure [examples](https://github.com/hashicorp/packer/tree/ma ### Windows -The following provisioner snippet shows how to sysprep a Windows VM. Deprovision should be the last operation executed by a build. - -``` json -{ - "provisioners": [ - { - "type": "powershell", - "inline": [ - "if( Test-Path $Env:SystemRoot\\windows\\system32\\Sysprep\\unattend.xml ){ rm $Env:SystemRoot\\windows\\system32\\Sysprep\\unattend.xml -Force}", - "& $Env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /shutdown /quiet" - ] - } - ] -} -``` - -In some circumstances the above isn't enough to reliably know that the sysprep is actually finished generalizing the image, the code below will wait for sysprep to write the image status in the registry and will exit after that. The possible states, in case you want to wait for another state, [are documented here](https://technet.microsoft.com/en-us/library/hh824815.aspx) +The following provisioner snippet shows how to sysprep a Windows VM. The code below will wait for sysprep to write the image status in the registry and will exit after that. The possible states, in case you want to wait for another state, [are documented here](https://technet.microsoft.com/en-us/library/hh824815.aspx) ``` json { @@ -290,8 +274,6 @@ In some circumstances the above isn't enough to reliably know that the sysprep i } ] } - - ``` ### Linux From f81492ef9d8f563ba6257834fe4317b9b99b3d88 Mon Sep 17 00:00:00 2001 From: David Tesar Date: Wed, 16 May 2018 15:35:14 -0400 Subject: [PATCH 2/2] Add back last step comment --- website/source/docs/builders/azure.html.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/source/docs/builders/azure.html.md b/website/source/docs/builders/azure.html.md index 6af8986cd..e3a4100d1 100644 --- a/website/source/docs/builders/azure.html.md +++ b/website/source/docs/builders/azure.html.md @@ -260,7 +260,7 @@ Please refer to the Azure [examples](https://github.com/hashicorp/packer/tree/ma ### Windows -The following provisioner snippet shows how to sysprep a Windows VM. The code below will wait for sysprep to write the image status in the registry and will exit after that. The possible states, in case you want to wait for another state, [are documented here](https://technet.microsoft.com/en-us/library/hh824815.aspx) +The following provisioner snippet shows how to sysprep a Windows VM. Deprovision should be the last operation executed by a build. The code below will wait for sysprep to write the image status in the registry and will exit after that. The possible states, in case you want to wait for another state, [are documented here](https://technet.microsoft.com/en-us/library/hh824815.aspx) ``` json {