mechinn / rpipc

Server Power Control using a Raspberry Pi
GNU General Public License v3.0
1 stars 0 forks source link

MAAS 2.2.2 Issues #1

Open keithkk opened 6 years ago

keithkk commented 6 years ago

Thanks for providing this driver and your updated write-up. Much appreciated!

I finished reading through your blog post and followed all the steps listed here, http://mechinn.com/blog/2017/06/01/rpipc.html

I'm running into a few issues though and have been unsuccessful with getting it to work with MAAS v2.2.2. MAAS also fails to load correctly after a reboot and I've been reverting to a backup after each attempt.

What I've encountered after combining notes from your post and a few Wake on LAN driver re-addition posts, along with me reading through all the power driver py files currently supported and installed by default, it seems that the primary reason for the issues is that the directory and file structures have changed from v2.1 to v2.2. Specifically:

This directory is no longer present: /usr/lib/python3/dist-packages/provisioningserver/power/

The new location looks like: /usr/lib/python3/dist-packages/provisioningserver/drivers/power/

The schema.py file is no longer used that was previously at this location: /usr/lib/python3/dist-packages/provisioningserver/power/schema.py

It looks like the new schema is defined in /usr/lib/python3/dist-packages/provisioningserver/drivers/power/registry.py

Since those files and folders are not used or in a different location, I struggled to pinpoint the exact locations that I should be putting the entries needed to work with your schema and API notes. My lack of Python syntax knowledge seems to be where my struggles are primarily preventing me from piecing things together so they work with the updated v2.2.2 configuration.

Please let me know any thoughts, pointers, or input you have to get me on the right troubleshooting track of updating everything needed to work with the new MAAS v2.2.2 configuration. My objective is to understand how each power driver file and function works so that I can update my custom drivers as needed with any future updates and changes made to the MAAS core platform.

mechinn commented 6 years ago

Admittedly I stopped using MAAS after building this. This isn't the first time they have refactored the structure of their code so you'll likely have to figure this out in the future too, I can try and take a look the new version as soon as I can but life is a little busy right now unfortunately so I can't give you a timeline of when. If you figure it out submit a pull request or at least report back with what you found for anyone else

keithkk commented 6 years ago

Will do. I'll keep at it and report back once things are working. I've been playing with MAAS for a few different hobby and home automation projects over the past year. I finally have a mostly stable Pi setup for my BMC controllers that I connect to the ATX motherboards that don't have built-in out-of-band controllers. With MAAS axing WOL and then the patches only being short-lived that can be found a on a few sites, learning how to do it myself is the conclusion I've drawn to be able to adjust with all future changes that follow the same type of path. Plus, the full power control compared to just WOL does add a lot more flexibility to things.

Separately but related, have you looked at the recently available power types supported to see if any of those act as a simple rest API? My thoughts here are to just emulate the response through my own APIs if I knew what the correct format MAAS would be looking to receive. Mainly, power on, power off, and power state are all I'm after. I tried using a few API debugging tools to diagnose the format of a Get request being sent when querying a machines power status that I redirected the IP on, but I wasn't able to decipher much at all from a small amount of attempts.

Thanks again for article and time spent on making it public. I'll circle back in the near future.