Milestone 4 ‐ Automation with pyvmomi - lpcyber1/SYS350 GitHub Wiki
pyvmomi Install
sudo apt update
thensudo apt upgrade -y
sudo apt install python3-pip
pip3 install wheel
pip3 install pyvmomi
pip3 install pyvim
sudo snap install code --classic
Github Setup
sudo apt install git -y
- Open Visual Studio Code and browse to
Source Control
- A menu will open about files but at the top select the 3 dots and the
Clone
option
- Your web browser will automatically open to sign in and authenticate to github. Select
Clone from GitHub
and your repositories will appear
- Next I selected my SYS350 repository and decided to store it in my users home directory
Deliverables
Deliverable 1. Figure out how to clone your course git repository. Open the base directory in visual studio code(1), and cover in your video demo with a view similar to the screenshot below that shows a terminal with your mgmt1 IP address(2)
Deliverable 2. Demo your own interactive session with vcenter via pyvmomi. Print out an element of the aboutInfo object. Similar to the one below.
Deliverable 3. Provide a link to a short video hosted on google drive or panopto that clearly demonstrates that you've met the following requirements.
Ensure you share this video with your instructor. Your video must be captured at 1080p or better and must have voice. Talk through the demonstration of all deliverables/requirements and your python program. Provide a very brief walkthrough of the python code you wrote in the execution of this milestone, explain what the code is doing. See demo video in resources at the top of this document
Requirement 1: Read your vmware username and vcenter hostname from a file.
Requirement 2: Provide data from your current pyvmomi session. This must include DOMAIN/username, vcenter server and your source IP address. Pull the domain/username and source ip from the connection information and vcenter_server can be the variable you read from your configuration file.
Requirement 3: Create a search function that filters all vms in vcenter by name. If no filter is added, return all VMs
Requirement 4: For each VM returned, provide the following meta-data
- VM Name
- Power State
- Number of CPUs
- Memory in GB
- IP Address (don't forget to add vmware tools to pf and any other "on" system that does not have an IP address returned.
Deliverable 4: Tech Journaling - Technical (Demo) Briefly demonstrate your documentation and code for this milestone. The demo provided allows us to easily navigate your journal's technical components. The journal is easy to read, there are screenshots where appropriate and formatted commands when it would be useful to copy paste. You link to repository content rather than formatting lengthy commands in markdown. Content that is suitable to multiple courses should be elevated and linked to rather than hidden in your course specific wiki.
Deliverable 5: Tech Journaling - Reflection (Demo) You discuss the task in general terms and you highlight where you went off course, where you burned time and any breakthroughs you had.
- The biggest breakthrough I had for this one was figuring out how to pull the variables from my json file that I was importing. As one of the deliverables was making sure to do that when initiating the connection so that was a top priority for me. Another breakthrough I had was trying to get my vm search function working properly. For awhile it was broken until I realized the reason I was getting traceback errors was that I needed to connect to vcenter before doing anything else