Python AMT Tools Documentation Release 0.8.0 Sean Dague Jan 14, 2018
Contents 1 Python AMT Tools 3 1.1 Background................................................ 3 1.2 Hardware that includes AMT...................................... 3 1.3 Configuring AMT............................................ 4 1.4 amtctrl.................................................. 4 1.5 Futures.................................................. 4 2 Installation 5 3 Usage 7 4 Contributing 9 4.1 Types of Contributions.......................................... 9 4.2 Get Started!................................................ 10 4.3 Pull Request Guidelines......................................... 11 4.4 Tips.................................................... 11 5 Credits 13 5.1 Development Lead............................................ 13 5.2 Contributors............................................... 13 6 History 15 6.1 0.8.0 (2017-06-27)............................................ 15 6.2 0.7.0 (2017-03-24)............................................ 15 6.3 0.6.0 (2016-10-27)............................................ 15 6.4 0.5.0 (2016-10-20)............................................ 15 6.5 0.4.0 (2016-10-10)............................................ 15 6.6 0.3.0 (2015-10-08)............................................ 16 6.7 0.1.0 (2015-08-09)............................................ 16 7 Indices and tables 17 i
ii
Python AMT Tools Documentation, Release 0.8.0 Contents: Contents 1
Python AMT Tools Documentation, Release 0.8.0 2 Contents
CHAPTER 1 Python AMT Tools Tools for interacting with Intel s Active Management Technology 1.1 Background AMT is a light weight hardware control interface put into some Intel based laptops and desktops as a tool for corporate fleets to manage hardware. It provides the basics of power control, as well as remote console via VNC. It functions by having a dedicated service processor sniff traffic off the network card on specific ports before it gets to the operating system. Some versions of Intel NUC boxes have AMT, which make them ideal candidates for building a reasonable cluster in your basement. There was once a tool called amttool which let you interact with these systems from Linux. This used the SOAP interface to AMT. That was removed in v9 of the firmware, which means it no longer works with modern AMT in the field. The interface that remains is CIM, a standard from the DMTF that builds XML models for all the things. There exist very few examples for how to make this work on the internet, with one exception: the OpenStack Baremetal (Ironic) service. It has native support for AMT hardware control. This project is derivative work from Ironic. The heavy lifting of understanding all the CIM magic incantations, and oh the magic they are, comes from that code. Refactored for a more minimal usage. 1.2 Hardware that includes AMT AMT is branded as vpro in products by Intel. It is found in many Intel based laptops. There are also specific models of Intel NUC that include vpro. Intel NUC KIT Core Processor BLKNUC5I5MYHE This code gets tested with 5i5MYHE NUCs as well as an older NUC that I have laying around. 3
Python AMT Tools Documentation, Release 0.8.0 1.3 Configuring AMT AMT must be enabled in the BIOS before it can be used externally. This is done by pressing Ctrl-P during initial boot. Initial user / pass is admin / admin. You will be required to create a new admin password that has at least 1: number, capital letter, and non alphanumeric symbol. One you do that, reboot and you are on your way. 1.4 amtctrl The amt library installs a binary amtctrl for working with AMT enabled machines. 1.4.1 machine enrollment To simplify the control commands amtcrtl has a machine registry. New machines are added via: amtctrl add <name> <address> <amtpassword> You can see a list of all machines with: amtctrl list And remove an existing machine with: amtctrl rm <name> 1.4.2 controlling machines Once machines are controlled you have a number of options exposed: amtctrl <name> <command> Command is one of: on - power on the machine off - power off the machine reboot - power cycle the machine pxeboot - set the machine to pxeboot the next time it reboots, and reboot the machine. This is extremely useful if you have install automation on pxeboot. status - return power status as an ugly CIM blob (TODO: make this better) 1.5 Futures More extensive in tree testing (there currently is very little of this) Retry http requests when they fail. AMT processors randomly drop some connections, built in limited retry should be done. Fault handling. The current code is very optimistic. Hence, the 0.x nature. Remove console control. There are AMT commands to expose a VNC remote console on the box. Want to support those. 4 Chapter 1. Python AMT Tools
CHAPTER 2 Installation At the command line: $ easy_install amt Or, if you have virtualenvwrapper installed: $ mkvirtualenv amt $ pip install amt 5
Python AMT Tools Documentation, Release 0.8.0 6 Chapter 2. Installation
CHAPTER 3 Usage To use Python AMT Tools in a project: import amt 7
Python AMT Tools Documentation, Release 0.8.0 8 Chapter 3. Usage
CHAPTER 4 Contributing Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. You can contribute in many ways: 4.1 Types of Contributions 4.1.1 Report Bugs Report bugs at https://github.com/sdague/amt/issues. If you are reporting a bug, please include: Your operating system name and version. Any details about your local setup that might be helpful in troubleshooting. Detailed steps to reproduce the bug. 4.1.2 Fix Bugs Look through the GitHub issues for bugs. Anything tagged with bug is open to whoever wants to implement it. 4.1.3 Implement Features Look through the GitHub issues for features. Anything tagged with feature is open to whoever wants to implement it. 9
Python AMT Tools Documentation, Release 0.8.0 4.1.4 Write Documentation Python AMT Tools could always use more documentation, whether as part of the official Python AMT Tools docs, in docstrings, or even on the web in blog posts, articles, and such. 4.1.5 Submit Feedback The best way to send feedback is to file an issue at https://github.com/sdague/amt/issues. If you are proposing a feature: Explain in detail how it would work. Keep the scope as narrow as possible, to make it easier to implement. Remember that this is a volunteer-driven project, and that contributions are welcome :) 4.2 Get Started! Ready to contribute? Here s how to set up amt for local development. 1. Fork the amt repo on GitHub. 2. Clone your fork locally: $ git clone git@github.com:your_name_here/amt.git 3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development: $ mkvirtualenv amt $ cd amt/ $ python setup.py develop 4. Create a branch for local development: $ git checkout -b name-of-your-bugfix-or-feature Now you can make your changes locally. 5. When you re done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox: $ flake8 amt tests $ python setup.py test $ tox To get flake8 and tox, just pip install them into your virtualenv. 6. Commit your changes and push your branch to GitHub: $ git add. $ git commit -m "Your detailed description of your changes." $ git push origin name-of-your-bugfix-or-feature 7. Submit a pull request through the GitHub website. 10 Chapter 4. Contributing
Python AMT Tools Documentation, Release 0.8.0 4.3 Pull Request Guidelines Before you submit a pull request, check that it meets these guidelines: 1. The pull request should include tests. 2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst. 3. The pull request should work for Python 2.6, 2.7, 3.3, and 3.4, and for PyPy. Check https://travis-ci.org/sdague/ amt/pull_requests and make sure that the tests pass for all supported Python versions. 4.4 Tips To run a subset of tests: $ python -m unittest tests.test_amt 4.3. Pull Request Guidelines 11
Python AMT Tools Documentation, Release 0.8.0 12 Chapter 4. Contributing
CHAPTER 5 Credits 5.1 Development Lead Sean Dague <sean@dague.net> 5.2 Contributors None yet. Why not be the first? 13
Python AMT Tools Documentation, Release 0.8.0 14 Chapter 5. Credits
CHAPTER 6 History 6.1 0.8.0 (2017-06-27) add support for hybernate power state (thanks Chen Rotem Levy) ensure hostdb is not world readable when created (thanks bodo-riediger) 6.2 0.7.0 (2017-03-24) add support for -p flag to prompt for password and bypass hostdb nice errors to the user when auth fails 6.3 0.6.0 (2016-10-27) add support for stand-by power state (thanks Chen Rotem Levy) 6.4 0.5.0 (2016-10-20) python 2 fixes for python 3 issues (thanks Chen Rotem Levy) 6.5 0.4.0 (2016-10-10) python 3 fixes and testing (thanks Rixillo) 15
Python AMT Tools Documentation, Release 0.8.0 6.6 0.3.0 (2015-10-08) python 3 print fix (thanks Mike Nawrocki) add set_next_boot and change_boot_order_request (thanks John L. Villalovos) 6.7 0.1.0 (2015-08-09) First release on PyPI. 16 Chapter 6. History
CHAPTER 7 Indices and tables genindex modindex search 17