Skip to main content

Managing Instance Templates

Create a new Template

Use the compute templates create command to create a template:

crusoe compute templates create \
--name myfirsttemplate \
--type c1a.8x \
--location us-east1-a \
--image ubuntu22.04:latest \
--vpc-subnet-id 7a2f1b6a-9e48-4f3c-a0d7-1d9a8c2f3e0b \
--keyfile ~/.ssh/id_ed25519.pub


Creating VMs from Templates

VM creation from a template uses the Bulk VM create method under the hood. This means that the desired number of VMs are created atomically, with automated rollbacks in the event of any instance creation failures.

VMs (and disks created and attached to VMs) also inherit their naming from the template name by default. For example, VMs created from a template called 'test' will be named 'test-1', 'test-2', etc., with disks qualified with a further -disk prefix ('test-disk-1'). This may be overriden during individual creation requests.

Use the compute vms bulk-create command, passing a template-id field associated with the chosen template:

crusoe compute vms bulk-create \
--template-id 9b6f2a8c-4e39-1d7a-0c8f-3e0a9b2c8f3e \
--count 3
...

If you are using a global template, you may optionally choose to specify a VPC subnet ID. Additionally, the InfiniBand network and partition IDs must be specified for IB-enabled instances provisioned via a template.

Updating Templates

Templates once created cannot be modified. You may choose to clone your templates to make changes or delete outdated / unused templates.

Deleting Templates

Use the compute vms delete command, passing the name of with the template to be deleted.

crusoe compute templates delete --name TEMPLATE_NAME