Menu
April 19th, 2018

New Custom Image Handling

We recently moved over our image-based OSes to Github and added the ability to peg to an older version to guarantee immutability. We have now also updated the way our customers specify custom images when creating an instance.

Old Way

Previously, custom images were specified using cloud-config:

#cloud-config
#image_url=http://webserver/image.tar.gz

This method has been deprecated and removed.

New Way

We now accept the following variables in cloud-config provided via user-data at instance creation time:

#cloud-config
#image_repo=https://gitserver/user/images-repo.git
#image_tag=<commit sha>

Why Bring Your Own Image?

Packet’s default images are optimized for speed and will only have a minimum amount of packages installed. However, some people and companies prefer to bring their own kernel as it allows for packages and software to be pre-installed and configured.

Since this customization is front-loaded only once, less heavy lifting is required by devops automation after each server is provisioned. This greatly reduces the deployment time and need for other types of automation like Ansible, Chef, Salt, etc.

The custom image can then be maintained in the git repo where the image lives.

Example Use Cases

  • Customer A plans to deploy a nameserver infrastructure and wants to install DNS/network packages.
  • Customer B wants to install build servers catered to development tools/libraries for compiling software.

Checking/Using Immutability

The same way as with default images, you can check which image_tag you've deployed and “pin” to that particular image_tag each time when provisioning.

Example API Call:

curl \
  -s \
  -H "Content-Type: application/json" \
  -H "X-Auth-Token: '<API-TOKEN>" \
  -d '{
  "hostname":"test.image.com",
  "plan":"baremetal_0",
  "operating_system":"ubuntu_16_04",
"userdata":"#cloud-config\n#image_repo=https://somegitserver/user/image-repo.git\n#image_tag=<commit sha>",
  "facility":"ewr1"
}' \
https://api.packet.net/projects/<PROJECT-ID>/devices

To read further details of our Git-based OSes, please read this post. For more information about custom image handling please read here.

As always, if you have any questions please feel free to reach out via email.

Don't see what you need? Need a platform demo? Contact us so we can chat about options, and help you get the most out of our platform.