I built a Nutanix workflow and Python code for Alfred (Thanks to Nick Weaver for briefly introducing me to the tool). Alfred is an app for Mac OS X which boosts productivity with hotkeys and keywords. It enabled searching your Mac and the web, and control your Mac using customized actions and workflows.
The workflow I built enable Nutanix administrators to view and manage hosts and virtual machines from their own desktops (MacOS only) in a very easy manner.
I have also published the workflow export and the Python source code in my Github repository here. Feel free to download the package and contribute back with your own implementations and triggers.
The best way to understand what is possible with this tool is watching this video I created:
How to use the workflow:
- To configure the workflow use: ntnx config (do not hit enter)
- To get entities use: ntnx get hosts or ntnx get vms
- To power off a vm use ALT + PowerOn after selecting a vm
If you plan to modify the code please be aware that Nutanix API has two interfaces, being one to manage entities that are common to all hypervisors, while the second one is specific to manage AHV virtual machines and few host operations.
After the initial configuration Alfred will automatically create a file called ntnxapi_data.json in /Users/yourusername/Library/Application Support/Alfred 2/Workflow Data/com.aleibovici.ntnxapi/. If for any reason your workflow is not able to connect to your cluster, delete this file and re-run the configuration process.
If the requests module is not pre-loaded the workflow will not work. Type easy_install requests in a terminal session to install the module.
If you have any other issues just leave a message here.
[Update] April, 290th. 2016
Added self-update capabilities, and a new function to show VMs from a particular host
[Update] April, 19th, 2016
Added ability to search hosts and virtual machines by name instead by ‘uuid’. Before this update the users would have to select items from a displayed list; now it is also possible to type them.
[Update] April, 18th, 2016
Since the video was recorded I have already done few improvements to the workflow, including AHV icons and a Alerts option.
This article was first published by Andre Leibovici (@andreleibovici) at myvirtualcloud.net.