Hi Alvaro,
I have tried the command as you suggested but it's not working,
"PACKER_LOG=1 C:\Users\....\bin\packer build .\azure.json".
I just realised that the above console missed the reasoning part of why it
failed:
azure-arm: VERBOSE: Performing the operation "Join in domain
'enett.local'" on target "tmppackervm".
azure-arm: WARNING: The changes will take effect after you restart the
computer tmppackervm.
azure-arm:
azure-arm: about to restart world
==> azure-arm: Restarting Machine
==> azure-arm: Waiting for machine to restart...
==> azure-arm: Timeout waiting for machine to restart.
==> azure-arm: Pausing before cleanup of step 'StepConnectWinRM'. Press
enter to continue. ==> azure-arm: Pausing before cleanup of step
'StepGetIPAddress'. Press enter to continue. ==> azure-arm: Pausing before
cleanup of step 'StepDeployTemplate'. Press enter to continue. ==>
azure-arm: Pausing before cleanup of step 'StepValidateTemplate'. Press
enter to continue. ==> azure-arm: Pausing before cleanup of step
'StepSetCertificate'. Press enter to continue. ==> azure-arm: Pausing
before cleanup of step 'StepGetCertificate'. Press enter to continue. ==>
azure-arm: Pausing before cleanup of step 'StepDeployTemplate'. Press enter
to continue. ==> azure-arm: Pausing before cleanup of step
'StepValidateTemplate'. Press enter to continue. ==> azure-arm: Pausing
before cleanup of step 'StepCreateResourceGroup'. Press enter to continue.
==> azure-arm:
==> azure-arm: Cleanup requested, deleting resource group ...
It failed because of the timeout, I guess the join-domain script worked but
it also somehow disconnected the tempVM and Packer, that's why it couldn't
move to the next stage of packer and couldn't continue running other
scripts in the template. I have tried other attempts but it still threw the
same issue about disconnection with Packer. I have tried to run another the
script after running the domain_join script instead of moving to
"windows_restart" packer command, but it still failed to run that script as
after joining the domain, packer lost its connection with the tempVM. To
sum up, after several different attempts, I found out that after the
PowerShell command to join domain be executed, packer couldn't continue
running ANYTHING. I am not quite sure if this is a bug in Packer or not, as
packer is supposed to continue running the script after domain join right
(I have tested the domain join script in my local VM, and it
didn't automatically restart the VM after the execution).
Thanks,
On Tuesday, April 3, 2018 at 7:47:48 AM UTC+10, Alvaro Miranda Aguilera
wrote:
>
> run this with debug mode
>
> set PACKER_LOG=1
>
> checking the sequence I would assume the restart work but the exit code
> wasn;t 0, that could explain it started the clean up process
>
> if you run this in debug mode, we should be able to see more, like the
> exit code before the clean up process
>
> alvaro
>
>
>
--
This mailing list is governed under the HashiCorp Community Guidelines -
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of
those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/packer-tool/8ce66acf-a6ec-4732-ad5b-22b0b0b00ffb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.