-on-error=ask not working, vsphere post-processor diagnostic not shown

68 views
Skip to first unread message

andr...@gmail.com

unread,
Oct 18, 2017, 10:09:24 PM10/18/17
to Packer
Hello all,

I'm running packer as follows:

packer build -on-error=ask -var-file="rancheros-config.json" -var-file="vsphere.json" -var-file="vsphere_password.json" rancheros.json

The config files and packer log are available here: https://gist.github.com/AndrewSav/c2fa438f82701b9826e3800fad516ec5

Questions:

1) Why am I not asked on failure if I'd like to clean up? Instead packer goes ahead and deletes the built VM leaving me with know means to diagnose.


-on-error=cleanup (default), -on-error=abort-on-error=ask - Selects what to do when the build fails. cleanupcleans up after the previous steps, deleting temporary files and virtual machines. abort exits without any cleanup, which might require the next build to use -forceask presents a prompt and waits for you to decide to clean up, abort, or retry the failed step.

As you can see above I do specify ask, the build fails but there is no prompt to cleanup/abort. What am I doing wrong?

2) The reason why the build fails is a error code from ovftool. ovftool also writes stderr/stdout output that give more diagnostic information as to why it failed. This output cannot be found anywhere. How do I see it?

Andrew

Rickard von Essen

unread,
Oct 19, 2017, 12:37:42 AM10/19/17
to packe...@googlegroups.com
1) the -on-error only influence the execution of builders (which provisioning is a part of). That should be made clear in the docs.

2) unfortunately stdout/stderr gets swallowed, it looks like someone intended it to be passed to packer but did it wrong. (in the meantime the best way to troubleshoot is to run the command manually) 

Can you file two issues on github one for each of these. Thanks! 

/ Rickard 



--
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 packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/c0452937-caca-4650-b1a6-d5a0e34c5aef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

andr...@gmail.com

unread,
Oct 19, 2017, 4:45:27 PM10/19/17
to Packer
Thank you, Rickard,

just to confirm I understood you correctly, you see no value whatsoever in adding an ability to preserve the VM after post-processor starts running and then fails in order to investigate the VM state? To me it's surprising because it's a) inconsistent (why you can preserve it with builder but not post-processor) and b) impeding any issues investigation during post-provisioning phase.

Since this is surprising to me, I'd like to check maybe I misunderstood you, and there is a value in actually making it consistently work all the way through?

Cheers,
Andrew
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.

Rickard von Essen

unread,
Oct 20, 2017, 12:38:21 AM10/20/17
to packe...@googlegroups.com
you see no value whatsoever in adding an ability to preserve the VM after post-processor starts running and then fails in order to investigate the VM state?

I didn't say that, just that the docs doesn't reflect current behaviour. 

To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/47d2c9f5-623b-4cfa-b9b1-0fd2687bc6d4%40googlegroups.com.

andr...@gmail.com

unread,
Oct 20, 2017, 2:12:55 AM10/20/17
to Packer
So do you think that the issue to correct the behavior (as opposed to to correct the docks) might be accepted on github? Thanks!

Rickard von Essen

unread,
Oct 20, 2017, 3:22:14 AM10/20/17
to packe...@googlegroups.com
I don't have any opinion yet, but please open an issue and request that feature or at least that the docs should be corrected.

Rickard

To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/18437f9b-10b4-42dc-9f73-47def692892f%40googlegroups.com.

andr...@gmail.com

unread,
Oct 23, 2017, 5:55:24 PM10/23/17
to Packer
Reply all
Reply to author
Forward
0 new messages