Skip to content

A python script that listens for UDP wake on lan packets and sends an API call to vCenter to Power On the guest with the matching MAC

Notifications You must be signed in to change notification settings

dfreemyer/wol-vmware-connector

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

wol-vmware-connector

A very simple python script that listens for UDP Wake-On-Lan packets and connects to a vCenter server to power on the Guest with the matching MAC Address.

A Fork of wol-packet-replicator by Jaime Martínez Rincón

The built in WOL capabilities of vSphere/vCenter only allow for waking guests that are in standby, not powered off completely. By utilizing the REST API provided in vCenter 6.5/6.7 we can power on any Guest, providing we have the appropriate permissions.

Usage

  1. Clone this repository: git clone https://github.com/dfreemyer/wol-vmware-connector
  2. Fill in the connection details for your vCenter Server in settings.py
  3. Run it directly: python connector.py or in a background task (tmux, screen)

Creating a vCenter user for API use

You can test it out using your vCenter Admin user, usually [email protected] but that's far more permission than the script needs. All we require is the VM -> Interaction -> Power On Privilege, and permissions on the Guests you want the script to be able to act on.

  1. Create a new Role, WOL User, and add the VM -> Interaction -> Power On privilege.
  2. Create a new User, and assign it the WOL User role.
  3. For each Guest you wish to be able to Wake-On-Lan, right click on it in your inventory and choose Add Permission...
  4. Enter your newly created user and select the WOL Role and click OK

About

A python script that listens for UDP wake on lan packets and sends an API call to vCenter to Power On the guest with the matching MAC

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%