Scale with templates and golden images
Build reusable VM images for fast, consistent provisioning.
- Use templates and image pipelines to reduce drift.
A golden image is a vetted VM image with baseline OS, updates, and required agents. Teams clone from templates to create consistent environments quickly. Image pipelines rebuild and patch templates regularly, then deprecate old versions. This improves repeatability and shortens incident recovery.
1images = [
2 {"name": "ubuntu-web-v1", "patched": True},
3 {"name": "ubuntu-web-v2", "patched": True},
4 {"name": "ubuntu-web-v0", "patched": False}
5]
6valid = [img["name"] for img in images if img["patched"]]
7print(len(valid))
8print(valid[-1])2 ubuntu-web-v2
Treat images like code artifacts: version them, scan them, test boot and service health, and promote through environments. Immutable infrastructure principles pair well with VM templates because replacement is safer than manual in-place drift.
Key takeaways
Use templates and image pipelines to reduce drift.
VMs are powerful when automation and guardrails stay strong.
Observe before scaling; recover before incidents become outages.
Lesson quiz
5 questions · pass with 4 correct · up to 50 XP
Passing this quiz completes the lesson and keeps your streak going. Questions you miss come back in review sessions later.
Practice: write Python
Write Python in the editor and run it against sample inputs. Python runs locally in your browser using a WebAssembly runtime.
Pick the latest patched image
Read three image version numbers and three patch flags (1 patched, 0 unpatched) in order. Print the highest version among patched images.
- mixed image states
- only first and third patched
Python runs in a sandboxed browser worker with a 60 second time limit. Its runtime loads from the Pyodide CDN; your code stays in this browser.
Questions about this lesson
Stuck? Ask. Figured something out? Share it. Explaining is one of the best ways to learn.
Loading posts…