-
Notifications
You must be signed in to change notification settings - Fork 0
Home
This repository is intended to provide code samples to help you build immutable VMware Patterns.
❗ WARNING: the contents of this repository are not intended for production networks in their current state. It is recommended that these scripts are certified in a Development environment, functionally tested, and refactored with the appropriate security and operational considerations. Proper SDLC practices are advised.
Think of a "Pattern" like a Docker Image. A Docker Image might be very generic or it might be fully baked with specific packages. Similarly, a Pattern is a set of packages (from this repo) designed to function on a PhotonOS virtual machine. The result of a Pattern (a Docker Container using the Docker analogy) is the VMware environment that the Pattern creates. For example: a Workload Domain Pattern might consist of a vCenter Server, an NSX Manager, and a few nested ESXi hosts. The Pattern in this example would contain all code from this repo to automate the build of a workload domain, formatted to run on PhotonOS.
All VMware software in this lab must be downloaded manually prior to running the pattern. Each pattern will contain instructions for obtaining the proper packages. It is recommended you download an SFTP tool such as FileZilla or WinSCP to make it easier to drop software bundles onto a given photon machine, although this is not mandatory.
To run these patterns you will need a physical ESXi host and a /24 subnet. Development and testing of these labs were facilitated using:
- 1x Ubiquiti Edgerouter 4 uplinked to home wifi
- 1x Cisco Catalyst 2950 uplinked to the Edgerouter
- 1x PowerEdge R710 with 8 CPU (Intel Xeon E5620 @ 2.40GHz), 192 GB of RAM, and 2.72 TB of storage uplinked to the Cisco switch
It is not mandatory to have these exact specs in your home lab. In fact its not even mandatory that you use a server (a beefy laptop will suffice) or a switch. The more resources the better the experience, but build with what is available. The following ESXi version was used on the PowerEdge:
- ESXi version 6.7.0 (build 8169922)
If your primary use case for this repository is as a VCF automation incubator please see this note about nested ESXi 8 compatability.
All Patterns are designed to be immutable. Licensing is not required. If a VMware environment has been running longer than the duration of the evaluation, you may choose to buy the appropriate licenses from VMware or you may choose to destroy and rebuild the environment.
There is one PhotonOS server used as the master control plane for all Patterns. This PhotonOS server will be referred to as the Master Photon Controller. The steps to deploy the Master Photon Controller are outlined in the Quick Start README.md page. If you haven't already, the following are the steps to configure the Master Photon Controller.
Step 1: Deploy Photon (photon-ova-4.0-ca7c9e9330.ova) For downloads visit: https://github.com/vmware/photon/wiki/Downloading-Photon-OS
The default password is changeme
. For all labs, use /usr/local/
as the working directory.
cd /usr/local/
Step 2: Download controller prep script
curl https://raw.githubusercontent.com/boconnor2017/e2e-patterns/main/prep-photon.sh >> prep-photon.sh
Step 3: Download refresher script
curl https://raw.githubusercontent.com/boconnor2017/e2e-patterns/main/refresh-e2e-patterns.sh >> refresh-e2e-patterns.sh
Step 4: Run E2E lab PhotonOS prep script. (Optional: open a second terminal and watch progress with tail -f _prep_photon.log
).
sh prep-photon.sh >> _prep_photon.log
Step 5: Refresh local repo (as needed)
sh refresh-e2e-patterns.sh
The configuration file contains all environment specific information. The configuration file is located at:
/usr/local/e2e-patterns/config2024.py
Note: its obviously a bad practice to store sensitive information in a code repository. The configuration file in this repo contains sample data so that you understand the proper syntax when creating your own file. Its recommended to store your config file in a safe location. Replace the config2024.py
file stored in /usr/local/e2e-patterns
after every refresh.
IMPORTANT: the configuration file is designed to work with ONE ESXi host. In the event that your lab contains multiple ESXi hosts, run a Master Controller PER host. The config file used by the associated Master Controller should contain the proper E2EP_ENVIRONMENT().esxi_host_xxxx
parameter for the host it is paired with. Other parameters that are not specific to the esxi host can remain global. Patterns can be GLOBAL across as many physical ESXi hosts as desired. As long as the Pattern prerequisites are met somewhere in the ecosystem, the Pattern will work.
Step 1: using the master controller on a secondary ESXi host, navigate to /usr/local/
cd /usr/local/
Step 2: Make a copy of the default configuration file
cp e2e-patterns/config2024.py /usr/local/config_esxiN.py
Step 3: Make necessary edits using vi
editor. Copy the file back to the e2e-patterns
repo.
cp config_esxiN.py e2e-patterns/config2024.py
See table of contents. It is recommended to review Patterns in order starting with (A) to ensure all prerequisites are met.