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.
- Clone this repository:
git clone https://github.com/dfreemyer/wol-vmware-connector
- Fill in the connection details for your vCenter Server in
settings.py
- Run it directly:
python connector.py
or in a background task (tmux, screen)
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.
- Create a new Role,
WOL User
, and add theVM -> Interaction -> Power On
privilege. - Create a new User, and assign it the
WOL User
role. - For each Guest you wish to be able to Wake-On-Lan, right click on it in your inventory and choose
Add Permission...
- Enter your newly created user and select the
WOL Role
and clickOK