[pve-devel] applied: [PATCH pve-manager] pvenode: Add CLI call interface for wake on LAN

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Jan 18 09:05:31 CET 2019


On 1/17/19 3:46 PM, Christian Ebner wrote:
> Adds a CLI call interface to pvenode which allows to wake sleeping nodes in a
> cluster via a wake on LAN packet.
> 
> pvenode wakeonlan <node>
> 
> Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
> ---
>  PVE/CLI/pvenode.pm | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/PVE/CLI/pvenode.pm b/PVE/CLI/pvenode.pm
> index 5cd855be..b698d2a5 100644
> --- a/PVE/CLI/pvenode.pm
> +++ b/PVE/CLI/pvenode.pm
> @@ -206,6 +206,9 @@ our $cmddef = {
>  	    revoke => [ 'PVE::API2::ACME', 'revoke_certificate', [], { node => $nodename }, $upid_exit ],
>  	},
>      },
> +
> +    wakeonlan => [ 'PVE::API2::Nodes::Nodeinfo', 'wakeonlan', [ 'node' ], { } ],
> +
>  };
>  
>  1;
> 

applied, thanks!

I noticed two things which could be slightly improved:

* If I pass an arbitrary node, which does not exists in the cluster, I only get
  the "No wake on LAN MAC address defined for 'notexisting'!" error, so maybe add
  a check_node_exists at the beginning of the call?

* Maybe either print, or return the MAC addressed used, this would allow for some
  user feedback besides just silently return, the CLI and a future WebUI
  implemenation could then output something like "Sent magic packet to '$MAC'"
  Not 100% sure about this though, just an idea




More information about the pve-devel mailing list