Advice on how to implement graceful image builder shutdown with Packer

23 views
Skip to first unread message

Rémy Léone

unread,
May 3, 2018, 11:46:39 AM5/3/18
to Packer
Hello,

The Scaleway provisioner for Packer uses a poweroff call to shut down the image builder machine. 

While this is simple approach it does not guarantee that all buffers are emptied. At the moment a workaround could be to run sync to ensure that all data are persisted on disk.
I would like to ask you what would be the recommended Packer way to handle graceful shutdown? Are there Packer abstractions around this?
Would it be running a shutdown command through ssh for instance to perform a graceful shutdown? Do you have other recommendations?

Best regards

Rémy

Rickard von Essen

unread,
May 3, 2018, 12:25:09 PM5/3/18
to packe...@googlegroups.com
I assume that sends a ACPI poweroff which should shutdown graceful. At least that is how all other cloud providers works. The local builders don't have so much control over the environment and instead have an explicit "shutdown_command" which is usually set to something like "echo 'packer' | sudo -S shutdown -P now".

// 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/86986f70-ab56-492c-a242-2f08beb5ff31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Remy 'Sieben' Leone

unread,
May 7, 2018, 5:41:15 AM5/7/18
to packe...@googlegroups.com
How could I use packer functions to launch a command through SSH? My plan is to change the step_shutdown to use an SSH-based shutdown first and then using an API call as a last resort. 

Le jeu. 3 mai 2018 à 18:25, Rickard von Essen <rickard....@gmail.com> a écrit :
I assume that sends a ACPI poweroff which should shutdown graceful. At least that is how all other cloud providers works. The local builders don't have so much control over the environment and instead have an explicit "shutdown_command" which is usually set to something like "echo 'packer' | sudo -S shutdown -P now".

// Rickard
On 3 May 2018 at 17:46, Rémy Léone <remy....@gmail.com> wrote:
Hello,

The Scaleway provisioner for Packer uses a poweroff call to shut down the image builder machine. 

While this is simple approach it does not guarantee that all buffers are emptied. At the moment a workaround could be to run sync to ensure that all data are persisted on disk.
I would like to ask you what would be the recommended Packer way to handle graceful shutdown? Are there Packer abstractions around this?
Would it be running a shutdown command through ssh for instance to perform a graceful shutdown? Do you have other recommendations?

Best regards

Rémy

--
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...@googlegroups.com.

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CALz9Rt87DMdSjVq1f4XqNAkGDnA9SXnZyH7JCyBMVe%3DodWonaA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages