Skip to content

Latest commit

 

History

History
240 lines (173 loc) · 5.74 KB

File metadata and controls

240 lines (173 loc) · 5.74 KB
description page_title sidebar_title nav_title
The proxmox ISO builder is able to create new images for use with Proxmox VE. The builder takes an ISO source, runs any provisioning necessary on the image after launching it, then creates a virtual machine template.
Proxmox ISO - Builders
proxmox-iso
ISO

Proxmox Builder (from an ISO)

Type: proxmox-iso Artifact BuilderId: proxmox.iso

The proxmox-iso Packer builder is able to create new images for use with Proxmox. The builder takes an ISO image, runs any provisioning necessary on the image after launching it, then creates a virtual machine template. This template can then be used as to create new virtual machines within Proxmox.

The builder does not manage templates. Once it creates a template, it is up to you to use it or delete it.

Configuration Reference

@include 'builder/proxmox/common/Config.mdx'

Required:

@include 'builder/proxmox/iso/Config-required.mdx'

Optional:

@include 'builder/proxmox/common/Config-not-required.mdx'

@include 'builder/proxmox/iso/Config-not-required.mdx'

@include 'packer-plugin-sdk/multistep/commonsteps/ISOConfig-not-required.mdx'

ISOs

@include 'builder/proxmox/common/ISOsConfig.mdx'

Required

@include 'packer-plugin-sdk/multistep/commonsteps/ISOConfig-required.mdx'

Optional

@include 'packer-plugin-sdk/multistep/commonsteps/ISOConfig-not-required.mdx'

@include 'builder/proxmox/common/ISOsConfig-not-required.mdx'

@include 'packer-plugin-sdk/multistep/commonsteps/CDConfig.mdx'

@include 'packer-plugin-sdk/multistep/commonsteps/CDConfig-not-required.mdx'

VGA Config

@include 'builder/proxmox/common/vgaConfig.mdx'

Optional:

@include 'builder/proxmox/common/vgaConfig-not-required.mdx'

Network Adapters

@include 'builder/proxmox/common/NICConfig.mdx'

Optional:

@include 'builder/proxmox/common/NICConfig-not-required.mdx'

Disks

@include 'builder/proxmox/common/diskConfig.mdx'

Optional:

@include 'builder/proxmox/common/diskConfig-not-required.mdx'

EFI Config

@include 'builder/proxmox/common/efiConfig.mdx'

Optional:

@include 'builder/proxmox/common/efiConfig-not-required.mdx'

VirtIO RNG device

@include 'builder/proxmox/common/rng0Config.mdx'

Required:

@include 'builder/proxmox/common/rng0Config-required.mdx'

Optional:

@include 'builder/proxmox/common/rng0Config-not-required.mdx'

PCI devices

@include 'builder/proxmox/common/pciDeviceConfig.mdx'

Optional:

@include 'builder/proxmox/common/pciDeviceConfig-not-required.mdx'

Boot Command

@include 'packer-plugin-sdk/bootcommand/BootConfig.mdx'

Optional:

@include 'packer-plugin-sdk/bootcommand/BootConfig-not-required.mdx'

Http directory configuration

@include 'packer-plugin-sdk/multistep/commonsteps/HTTPConfig.mdx'

Optional:

@include 'packer-plugin-sdk/multistep/commonsteps/HTTPConfig-not-required.mdx'

  • http_interface - (string) - Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface.

Example: Fedora with kickstart

Here is a basic example creating a Fedora 29 server image with a Kickstart file served with Packer's HTTP server. Note that the iso file needs to be manually downloaded.

HCL2

variable "password" {
  type    = string
  default = "supersecret"
}

variable "username" {
  type    = string
  default = "apiuser@pve"
}

source "proxmox-iso" "fedora-kickstart" {
  boot_command = ["<up><tab> ip=dhcp inst.cmdline inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg<enter>"]
  boot_wait    = "10s"
  disks {
    disk_size         = "5G"
    storage_pool      = "local-lvm"
    type              = "scsi"
  }
  efi_config {
    efi_storage_pool  = "local-lvm"
    efi_type          = "4m"
    pre_enrolled_keys = true
  }
  http_directory           = "config"
  insecure_skip_tls_verify = true
  iso {
    iso_file                 = "local:iso/Fedora-Server-dvd-x86_64-29-1.2.iso"
  }
  network_adapters {
    bridge = "vmbr0"
    model  = "virtio"
  }
  node                 = "my-proxmox"
  password             = "${var.password}"
  proxmox_url          = "https://my-proxmox.my-domain:8006/api2/json"
  ssh_password         = "packer"
  ssh_timeout          = "15m"
  ssh_username         = "root"
  template_description = "Fedora 29-1.2, generated on ${timestamp()}"
  template_name        = "fedora-29"
  username             = "${var.username}"
}

build {
  sources = ["source.proxmox-iso.fedora-kickstart"]
}

JSON

{
  "variables": {
    "username": "apiuser@pve",
    "password": "supersecret"
  },
  "builders": [
    {
      "type": "proxmox-iso",
      "proxmox_url": "https://my-proxmox.my-domain:8006/api2/json",
      "insecure_skip_tls_verify": true,
      "username": "{{user `username`}}",
      "password": "{{user `password`}}",
      "node": "my-proxmox",
      "network_adapters": [
        {
          "model": "virtio",
          "bridge": "vmbr0"
        }
      ],
      "disks": [
        {
          "type": "scsi",
          "disk_size": "5G",
          "storage_pool": "local-lvm"
        }
      ],
      "efi_config": {
          "efi_storage_pool": "local-lvm",
          "pre_enrolled_keys": true,
          "efi_type": "4m"
      },
      "iso": {
          "iso_file": "local:iso/Fedora-Server-dvd-x86_64-29-1.2.iso"
      },
      "http_directory": "config",
      "boot_wait": "10s",
      "boot_command": [
        "<up><tab> ip=dhcp inst.cmdline inst.ks=http://{{.HTTPIP}}:{{.HTTPPort}}/ks.cfg<enter>"
      ],
      "ssh_username": "root",
      "ssh_timeout": "15m",
      "ssh_password": "packer",
      "template_name": "fedora-29",
      "template_description": "Fedora 29-1.2, generated on {{ isotime \"2006-01-02T15:04:05Z\" }}"
    }
  ]
}