GithubHelp home page GithubHelp logo

ncgeek / packer-template-debian-11 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jacaudi/packer-template-debian-11

0.0 0.0 0.0 23 KB

This repository uses Packer to build VM template for Proxmox

License: MIT License

HCL 100.00%

packer-template-debian-11's Introduction

Packer Debian 11 (Bullseye) Template for Proxmox

Packer configuration for creating Debian 11 virtual machine templates for Proxmox VE. Inspired by, and based upon the work started by, Roman Tomjak

Requirements

Minimum background information

Launching a virtual machine requires an operating system to be installed. VM installation is usually done using an ISO image file and depending on the OS, this can be a time consuming task one might want to avoid. Luckily, this can be automated using a process known as preseeding.

Preseeding provides a way to answer questions asked during the installation process, without having to manually enter the answers while the installation is running. You can check out the configuration for a standard Debian 10 installation in preseed.cfg and read more about this method in the preseed documentation.

Proxmox Templates provide an easy way to deploy many VMs of the same type, but naturally we don't want them to be completely identical. They may need a different hostname, an IP address, etc. This is what cloud-init takes care of.

Cloud-init is used for initial machine configuration like creating users or preseeding authorized_keys file for SSH authentication. You can check out the configuration in cloud.cfg and read more about this in cloud-init documentation.

Creating a new VM Template

Templates are created by converting an existing VM to a template. As soon as the VM is converted, it cannot be started anymore. If you want to modify an existing template, you need to create a new template.

Here's how:

Variables from the debian-11-bullseye.source.pkr.hcl can be overridden like so:

$ packer init
$ packer build -var "proxmox_host=10.100.150.10:8006" "proxmox_api_user=<<NOTAREALUSER>>" "proxmox_api_password=<<NOTAREALPASSWORD>>" .

or you can just as easily specify a file that contains the variables and multiple files as well:

$ packer init
$ packer build -var-file vars/debian_11.pkrvars.hcl -var-file vars.pkrvars.hcl.sample .

Be sure to adjust this code as necessary for your setup and to make sure NOT to commit the .pkrvars.hcl file that contains your credentials to your git repository.


Deploy a VM from a Template

Right-click the template in Proxmox VE, and select "Clone".

  • full clone is a complete copy and is fully independent from the original VM or VM Template, but it requires the same disk space as the original
  • linked clone requires less disk space but cannot run without access to the base VM Template. Not supported with LVM & ISCSI storage types

Contributing

You can contribute in many ways and not just by changing the code! If you have any ideas, just open an issue and tell me what you think.

Contributing code-wise - please fork the repository and submit a pull request.

License

MIT

packer-template-debian-11's People

Contributors

jacaudi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.