Announcing Packer-MAAS for creating custom MAAS images

Introduction

Packer is a tool for building operating system images. Packer accepts a template which describes how an image should be built. The installation is done by the operating system vendor’s own tools. Canonical has created templates for CentOS, RHEL, and VMware ESXi. These templates contain post-processing hooks to convert the image into either a tar.gz or dd.gz which can be used by MAAS.

Images can be customized by making changes to the kickstart files. See README.md in the operating system’s directory for more information.

Getting Started

  1. Install Packer on Ubuntu 18.04+
  2. Checkout Packer MAAS
    git clone --recurse-submodules git@github.com:canonical/packer-maas.git
  3. cd into the directory of the template you wish to use
  4. Run Packer as specified in README.md
6 Likes

Why is there no template for building Ubuntu images using Packer?

We suggest using the official Ubuntu images from Canonical and customizing them with cloud-init, as is done with other clouds, or Curtin preseeds.

Is this vmware ESXi vcenter autoregistration working for you ? I’m getting:

/vmfs/volumes/f571cf7d-1a1a9f99-ddee-38c33bfa02f3/maas/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.9.1) or chardet (3.0.4) doesn't match a supported version!
  RequestsDependencyWarning)
Traceback (most recent call last):
  File "/altbootbank/maas/vcenter", line 23, in <module>
    from requests.exceptions import (
  File "/vmfs/volumes/f571cf7d-1a1a9f99-ddee-38c33bfa02f3/maas/requests/__init__.py", line 105, in <module>
    from urllib3.exceptions import DependencyWarning
ImportError: cannot import name 'DependencyWarning'

seems like issue in a versions of a libraries.

Are these images only good for deploying vms or can you do bare metal?

I do bare metal only.

In environments where directly connecting to public repositories is prohibited, it would certainly be helpful to be able to deploy a customized Ubuntu image (rather than making CentOS, RHEL and/or windows actively preferred!).

Yes, one can mirror the repositories, and may well need to be done anyway … but it would certainly simplify things if Ubuntu could be treated just as any other OS.

See, Creating a custom Ubuntu image. Keep in mind this isn’t supported for reasons detailed in the article. The suggested way to use MAAS in an offline environment is to mirror images and the Ubuntu archive then configure MAAS to deploy using the offline mirror.

Hello. I also try but autoregistration doesn’t work. Were you store vcenter credentials? In the UI (Settings -> Images -> vmware)?

I’m working on adding VMware ESXi 7.0 support and will be retesting all VMware ESXi features with MAAS. If I see any issues with vCenter registration I will be fixing them soon :slight_smile:

2 Likes