Managing Templates
Create a new Template
- CLI
- UI
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
To create a template using the console:
- From the console, select Compute > Instance Templates in the left nav.
- Click Create Template.
- Follow the UI flow to input all required elements.
- Click Create.
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.
- CLI
- UI
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.
To create VMs from an available instance template:
- From the console, select Compute > Instance Templates in the left nav.
- Find the template you want to use and click Create VMs.
- Specify the number of instances you want to create along with any other required fields based on your template type.
- Click Create.
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
- CLI
- UI
Use the compute vms delete command, passing the name of the template to be deleted.
crusoe compute templates delete --name TEMPLATE_NAME
To delete an instance template:
- From the console, select Compute > Instance Templates in the left nav.
- Find the template you want to delete and select the Delete icon.
- Confirm the deletion by typing in the name.