Milestone 4: pyVmomi
Repo for the code used in this milestone Link
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 a view similar to the one below that also 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 googledrive 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 deliverables 1 and 2 and your python program. Provide a very brief walkthrough of the python code you wrote in the execution of this milestone.
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. Update: Pull the domain/username and source ip from the connection information and vcenter server can be the variable you read from your configuration file. See the following video for debugging advice.
Requirement 3: Create a search function that filters all vms in vcenter by name. If no filter is added, return all VMs
How this works is the the first if statement under the for loop is looking for the type of the object if the type is a folder it drops into another for loop to check for vms in that folder.
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.
Both of the else statements are made to print out just all vms.