Create a reusable Vultr instance template with a plan, OS, SSH keys, and user data using the API for consistent setups.
An instance template is a reusable blueprint that defines the plan, OS, SSH keys, and Cloud-Init user data for instances. Templates ensure consistent deployments across a cluster and simplify scaling by eliminating the need to specify configuration details for each new instance.
This guide explains how to create an instance template from scratch using the Vultr API. To capture an existing instance's configuration instead, including its startup script, see How to Create an Instance Template From an Instance.
The following table describes the available fields for creating an instance template:
plan field. All other fields are optional.os_id, iso_id, snapshot_id, marketplace_app_id, or marketplace_image_id.Send a POST request to the Create Instance Template endpoint to create a new template. Replace PLAN with the compute plan identifier, OS_ID with the operating system ID, TEMPLATE_LABEL with a descriptive label, and SSH_KEY_ID with an SSH key's ID.
A successful request returns an HTTP 200 OK response containing an array of template details, unlike the Retrieve and Update endpoints, which return a single object. Note the template id at instance_template[0].id for use when creating clusters or instances. The response also includes read-only fields such as plan_details, os, os_shortname, disk_config, and ephemeral, which indicates whether a cluster created the template and still owns it.
0 Comments
Be the first to comment and share your perspective with the community.