VM-Creator Weekly MX
The vm-creator requires weekly maintenance to ensure it builds properly. Occasionally updates are introduced to part of the builders phase of the packer build
that may break the boot sequence in the builders boot_command of the build out. Running a weekly build requires the user to analyze the build for any discrepancies and make the changes as needed. Below is a checklist of steps to take when running the build.
Pre-requisites for the task:
- Have packer installed
brew install packer
- VirtualBox
- Clone the vm-creator repo here
-
Navigate to the vm-creator repo and clone it down. -
Ensure you have virtualbox installed on your host machine -
Open vs source code editor and navigate to the directory where you plan on storing the repo, i.e./ Repo1/vm-creator -
Create a new branch to work out of i.e., git checkout -b "branch-name-here"
-
Optional, but suggested, open the packer.json file in vs code and scroll down to "headless" in the builder phase, and change "true" to "false" -
Note: Having virtualbox install on your host machine and running
"headless": false,
allows you to watch the build in realtime. -
In the top level directory of the project, run packer build packer.json
. This will handle all build steps. -
Note: Running with
--debug
will require you to press enter multiple times for the initialization of packer. Theseenter
strokes are not part of the boot order. -
Note: You can follow along with the boot order as the VM is created or start a VM of your own and then keep track of time waited and each key stroke. If boot order changes, update the boot_command in the packer.json file.
-
Follow through the boot command as the build is in process and look for any issues. -
If any issues are discovered with the boot command, cancel the build using ctl + c, remediate the deficiency and run the build again. -
If the boot command runs fine, continue with the rest of the build and look for any additional errors. The build can take anywhere from 40 minutes to an hour, and depends on hosts resources. -
If the build is successful, and no errors discovered, an output directory will be created in the directory tree of the project with the vm files. You can delete this directory when done. -
(Note: Every-time a build command is run, this directory path is created so don't worry about deleting it when its done. If you don't delete it, and try to run a build command again you will run into a conflict due to the variable for name set to ubuntu-xxx.xx already made.
-
If any issues were discovered and changes made to the packer.json file ensure you merge the changes.
11-10-2023
looking into updating VM. this is still on latest sha and boot order is fine. working on pushing a new opa for newest packages at runtime.