New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add wake-on-LAN feature to saltify create #44194

Merged
merged 4 commits into from Oct 23, 2017

Conversation

Projects
None yet
3 participants
@vernondcole
Contributor

vernondcole commented Oct 20, 2017

What does this PR do?

The saltify driver can shut a machine off using the shutdown_on_destroy parameter.

Now it can restart that machine by sending a WoL message before trying to bootstrap
Salt to it. This opens the door to completely reconfigure the target machine (depending
on how the bootstrap is configured.)

This PR may be a bit controversial, so I submitted it separately from the cleanup.
This is the last work I anticipate on this module for a long time.

P.S. -- I also fixed a one-letter typo in a completely unrelated file.

What issues does this PR fix or reference?

None.

Previous Behavior

Target machine stays dead. Other means of starting it must be used.

New Behavior

Target machine reacts to WoL packet, turns itself on, and boots up.

Tests written?

Yes.

vernondcole added some commits Oct 20, 2017

@vernondcole

This comment has been minimized.

Show comment
Hide comment
@vernondcole

vernondcole Oct 20, 2017

Contributor

@gtmanfred @cachedout
Did I get the design of this correct?

Particularly, are the names of the control parameters okay?

I want them to be pretty-much self-documenting, but not too long, so I spelled one
out, then used the wol abbreviation for the other two. My readers here found this
compromise to be understandable.

Contributor

vernondcole commented Oct 20, 2017

@gtmanfred @cachedout
Did I get the design of this correct?

Particularly, are the names of the control parameters okay?

I want them to be pretty-much self-documenting, but not too long, so I spelled one
out, then used the wol abbreviation for the other two. My readers here found this
compromise to be understandable.

local = salt.client.LocalClient()
if isinstance(wol_mac, six.string_types):
wol_mac = [wol_mac] # a smart user may have passed more params
ret = local.cmd(wol_host, 'network.wol', wol_mac)

This comment has been minimized.

@gtmanfred

gtmanfred Oct 20, 2017

Member

This comment has been minimized.

@vernondcole

vernondcole Oct 20, 2017

Contributor

Well, first of all, because I was not aware that it existed. Thanks for the reference.

Now that I read up on it, this built-in option has two advantages:

  • it seems the runner can only wake machines which are on the same network segment as the master. This option can use a distant minion to command the wakeup. In my use case, the hardware machine will often be in a different data center from the master.
  • It does not require a separate operation. The data for this option is contained right in the profile where it is easy to keep track of.
@vernondcole

vernondcole Oct 20, 2017

Contributor

Well, first of all, because I was not aware that it existed. Thanks for the reference.

Now that I read up on it, this built-in option has two advantages:

  • it seems the runner can only wake machines which are on the same network segment as the master. This option can use a distant minion to command the wakeup. In my use case, the hardware machine will often be in a different data center from the master.
  • It does not require a separate operation. The data for this option is contained right in the profile where it is easy to keep track of.

@rallytime rallytime merged commit 4278a08 into saltstack:develop Oct 23, 2017

8 checks passed

GPG All commits have a verified GPG signature
codeclimate All good!
Details
default Build finished.
Details
jenkins/PR/salt-pr-clone Pull Requests » Salt PR - Clone #18609 — SUCCESS
Details
jenkins/PR/salt-pr-docs-n Pull Requests » Salt PR - Docs #11297 — SUCCESS
Details
jenkins/PR/salt-pr-linode-ubuntu14-n Pull Requests » Salt PR - Linode Ubuntu14.04 #16005 — SUCCESS
Details
jenkins/PR/salt-pr-linode-ubuntu16-py3 Pull Requests » Salt PR - Linode Ubuntu16.04 - PY3 #3096 — SUCCESS
Details
jenkins/PR/salt-pr-lint-n Pull Requests » Salt PR - Code Lint #15862 — SUCCESS
Details

@vernondcole vernondcole deleted the vernondcole:saltify-create-with-wake-on-lan branch Oct 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment