├── .gitignore ├── NOTICE ├── LICENSE ├── README.md ├── CODE_OF_CONDUCT.md └── CONTRIBUTING_DCO.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2023 VMware, Inc. 2 | 3 | This product is licensed to you under the BSD 2 clause (the "License"). You may not use this product except in compliance with the License. 4 | 5 | This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Redistribution and use in source and binary forms, with or without 2 | modification, are permitted provided that the following conditions are 3 | met: 4 | 5 | 1. Redistributions of source code must retain the above copyright 6 | notice, this list of conditions and the following disclaimer. 7 | 8 | 2. Redistributions in binary form must reproduce the above 9 | copyright notice, this list of conditions and the following 10 | disclaimer in the documentation and/or other materials provided 11 | with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 14 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 15 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 16 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 17 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 18 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 19 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Welcome to E2E Patterns 2 | ℹ️ Please be informed, patterns-lab repository is being refactored for use using [this GitHub repository](https://github.com/boconnor2017/e2e-patterns.git). All labs and code snippets are developed in [this GitHub repository](https://github.com/boconnor2017/e2e-patterns.git), tested, and migrated here to patterns-lab. In the meantime, please feel free to use [this GitHub repository](https://github.com/boconnor2017/e2e-patterns.git) while patterns-lab is being finalized. 3 | 4 | ![alt text](https://github.com/boconnor2017/e2e-patterns/blob/main/img/E2E-Patterns-Logo-01.png) 5 | This repository is intended to provide code samples to help you build immutable VMware Patterns. 6 | 7 | :heavy_exclamation_mark: ***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.*** 8 | 9 | # What is a Pattern? 10 | 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. 11 | 12 | # Prerequisites for Running a Pattern 13 | ## VMware Software 14 | 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. 15 | 16 | ## Hardware and Networking Requirements 17 | To run these patterns you will need a physical ESXi host and a /24 subnet. Development and testing of these labs were facilitated using: 18 | * 1x Ubiquiti Edgerouter 4 uplinked to home wifi 19 | * 1x Cisco Catalyst 2950 uplinked to the Edgerouter 20 | * 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 21 | 22 | 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: 23 | 24 | * ESXi version 6.7.0 (build 8169922) 25 | 26 | ## Licensing 27 | 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. 28 | 29 | # Pattern 00: Deploy the Master Controller 30 | 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. 31 | 32 | Step 1: Deploy Photon (photon-ova-4.0-ca7c9e9330.ova) 33 | For downloads visit: https://github.com/vmware/photon/wiki/Downloading-Photon-OS 34 | 35 | The default password is `changeme`. For all labs, use `/usr/local/` as the working directory. 36 | ``` 37 | cd /usr/local/ 38 | ``` 39 | 40 | Step 2: Download controller prep script 41 | ``` 42 | curl https://raw.githubusercontent.com/boconnor2017/e2e-patterns/main/prep-photon.sh >> prep-photon.sh 43 | ``` 44 | 45 | Step 3: Download refresher script 46 | ``` 47 | curl https://raw.githubusercontent.com/boconnor2017/e2e-patterns/main/refresh-e2e-patterns.sh >> refresh-e2e-patterns.sh 48 | ``` 49 | 50 | Step 4: Run E2E lab PhotonOS prep script 51 | ``` 52 | sh prep-photon.sh >> _prep_photon.log 53 | ``` 54 | 55 | Step 5: Refresh local repo (as needed) 56 | ``` 57 | sh refresh-e2e-patterns.sh 58 | ``` 59 | 60 | ## Update Configuration File 61 | The configuration file contains all environment specific information. The configuration file is located at: 62 | ``` 63 | /usr/local/e2e-patterns/config.py 64 | ``` 65 | 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 `config.py` file stored in `/usr/local/e2e-patterns` after every refresh. 66 | 67 | # Next Steps (see table of contents) 68 | [Basic Photon OS Patterns](https://github.com/boconnor2017/e2e-patterns/wiki/Basic-PhotonOS-Patterns) 69 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in patterns-lab project and our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at oss-coc@vmware.com. 63 | All complaints will be reviewed and investigated promptly and fairly. 64 | 65 | All community leaders are obligated to respect the privacy and security of the 66 | reporter of any incident. 67 | 68 | ## Enforcement Guidelines 69 | 70 | Community leaders will follow these Community Impact Guidelines in determining 71 | the consequences for any action they deem in violation of this Code of Conduct: 72 | 73 | ### 1. Correction 74 | 75 | **Community Impact**: Use of inappropriate language or other behavior deemed 76 | unprofessional or unwelcome in the community. 77 | 78 | **Consequence**: A private, written warning from community leaders, providing 79 | clarity around the nature of the violation and an explanation of why the 80 | behavior was inappropriate. A public apology may be requested. 81 | 82 | ### 2. Warning 83 | 84 | **Community Impact**: A violation through a single incident or series 85 | of actions. 86 | 87 | **Consequence**: A warning with consequences for continued behavior. No 88 | interaction with the people involved, including unsolicited interaction with 89 | those enforcing the Code of Conduct, for a specified period of time. This 90 | includes avoiding interactions in community spaces as well as external channels 91 | like social media. Violating these terms may lead to a temporary or 92 | permanent ban. 93 | 94 | ### 3. Temporary Ban 95 | 96 | **Community Impact**: A serious violation of community standards, including 97 | sustained inappropriate behavior. 98 | 99 | **Consequence**: A temporary ban from any sort of interaction or public 100 | communication with the community for a specified period of time. No public or 101 | private interaction with the people involved, including unsolicited interaction 102 | with those enforcing the Code of Conduct, is allowed during this period. 103 | Violating these terms may lead to a permanent ban. 104 | 105 | ### 4. Permanent Ban 106 | 107 | **Community Impact**: Demonstrating a pattern of violation of community 108 | standards, including sustained inappropriate behavior, harassment of an 109 | individual, or aggression toward or disparagement of classes of individuals. 110 | 111 | **Consequence**: A permanent ban from any sort of public interaction within 112 | the community. 113 | 114 | ## Attribution 115 | 116 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 117 | version 2.0, available at 118 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 119 | 120 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 121 | enforcement ladder](https://github.com/mozilla/diversity). 122 | 123 | [homepage]: https://www.contributor-covenant.org 124 | 125 | For answers to common questions about this code of conduct, see the FAQ at 126 | https://www.contributor-covenant.org/faq. Translations are available at 127 | https://www.contributor-covenant.org/translations. 128 | -------------------------------------------------------------------------------- /CONTRIBUTING_DCO.md: -------------------------------------------------------------------------------- 1 | # Contributing to patterns-lab 2 | 3 | We welcome contributions from the community and first want to thank you for taking the time to contribute! 4 | 5 | Please familiarize yourself with the [Code of Conduct](https://github.com/vmware/.github/blob/main/CODE_OF_CONDUCT.md) before contributing. 6 | 7 | Before you start working with patterns-lab, please read our [Developer Certificate of Origin](https://cla.vmware.com/dco). All contributions to this repository must be signed as described on that page. Your signature certifies that you wrote the patch or have the right to pass it on as an open-source patch. 8 | 9 | ## Ways to contribute 10 | 11 | We welcome many different types of contributions and not all of them need a Pull request. Contributions may include: 12 | 13 | * New features and proposals 14 | * Documentation 15 | * Bug fixes 16 | * Issue Triage 17 | * Answering questions and giving feedback 18 | * Helping to onboard new contributors 19 | * Other related activities 20 | 21 | ## Getting started 22 | 23 | ![alt text](https://github.com/boconnor2017/e2e-patterns/blob/main/img/E2E-Patterns-Logo-01.png) 24 | This repository is intended to provide code samples to help you build immutable VMware Patterns. 25 | 26 | :heavy_exclamation_mark: ***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.*** 27 | 28 | # What is a Pattern? 29 | 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. 30 | 31 | # Prerequisites for Running a Pattern 32 | ## VMware Software 33 | 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. 34 | 35 | ## Hardware and Networking Requirements 36 | To run these patterns you will need a physical ESXi host and a /24 subnet. Development and testing of these labs were facilitated using: 37 | * 1x Ubiquiti Edgerouter 4 uplinked to home wifi 38 | * 1x Cisco Catalyst 2950 uplinked to the Edgerouter 39 | * 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 40 | 41 | 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: 42 | 43 | * ESXi version 6.7.0 (build 8169922) 44 | 45 | ## Licensing 46 | 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. 47 | 48 | # Pattern 00: Deploy the Master Controller 49 | 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. 50 | 51 | Step 1: Deploy Photon (photon-ova-4.0-ca7c9e9330.ova) 52 | For downloads visit: https://github.com/vmware/photon/wiki/Downloading-Photon-OS 53 | 54 | The default password is `changeme`. For all labs, use `/usr/local/` as the working directory. 55 | ``` 56 | cd /usr/local/ 57 | ``` 58 | 59 | Step 2: Download controller prep script 60 | ``` 61 | curl https://raw.githubusercontent.com/boconnor2017/e2e-patterns/main/prep-photon.sh >> prep-photon.sh 62 | ``` 63 | 64 | Step 3: Download refresher script 65 | ``` 66 | curl https://raw.githubusercontent.com/boconnor2017/e2e-patterns/main/refresh-e2e-patterns.sh >> refresh-e2e-patterns.sh 67 | ``` 68 | 69 | Step 4: Run E2E lab PhotonOS prep script 70 | ``` 71 | sh prep-photon.sh >> _prep_photon.log 72 | ``` 73 | 74 | Step 5: Refresh local repo (as needed) 75 | ``` 76 | sh refresh-e2e-patterns.sh 77 | ``` 78 | 79 | ## Update Configuration File 80 | The configuration file contains all environment specific information. The configuration file is located at: 81 | ``` 82 | /usr/local/e2e-patterns/config.py 83 | ``` 84 | 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 `config.py` file stored in `/usr/local/e2e-patterns` after every refresh. 85 | 86 | # Next Steps (see table of contents) 87 | [Basic Photon OS Patterns](https://github.com/boconnor2017/e2e-patterns/wiki/Basic-PhotonOS-Patterns) 88 | 89 | 90 | ## Contribution Flow 91 | 92 | This is a rough outline of what a contributor's workflow looks like: 93 | 94 | * Make a fork of the repository within your GitHub account 95 | * Create a topic branch in your fork from where you want to base your work 96 | * Make commits of logical units 97 | * Make sure your commit messages are with the proper format, quality and descriptiveness (see below) 98 | * Push your changes to the topic branch in your fork 99 | * Create a pull request containing that commit 100 | 101 | We follow the GitHub workflow and you can find more details on the [GitHub flow documentation](https://docs.github.com/en/get-started/quickstart/github-flow). 102 | 103 | ### Pull Request Checklist 104 | 105 | Before submitting your pull request, we advise you to use the following: 106 | 107 | 1. Check if your code changes will pass both code linting checks and unit tests. 108 | 2. Ensure your commit messages are descriptive. We follow the conventions on [How to Write a Git Commit Message](http://chris.beams.io/posts/git-commit/). Be sure to include any related GitHub issue references in the commit message. See [GFM syntax](https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown) for referencing issues and commits. 109 | 3. Check the commits and commits messages and ensure they are free from typos. 110 | 111 | ## Reporting Bugs and Creating Issues 112 | 113 | For specifics on what to include in your report, please follow the guidelines in the issue and pull request templates when available. 114 | 115 | ## Ask for Help 116 | 117 | The best way to reach us with a question when contributing is to ask on: 118 | 119 | * The original GitHub issue 120 | * The developer mailing list 121 | * Our Slack channel 122 | --------------------------------------------------------------------------------