Managing Images
Create Custom Images
- CLI
- UI
Use the compute images create to create a custom image:
crusoe compute images create \
--name <image-name> \
--vm-name <vm-name> \
--tags <tag1,tag2> \
--description <description> \
--project-name <project-name>
To create a new custom image via the console:
- From the console, select Compute > Instances in the left nav.
- Select the instance you want to use for the custom image (make sure it's powered off).
- Click Create a custom image.
- Enter the custom image name, description, and tags and click Create.
You can also create a custom image from the Custom Images page in the console:
- From the console, select Compute > Custom Images in the left nav.
- Click Create Custom Image.
- Enter a name and description, and select your source VM. If you don't see the VM you want to use, power it off and retry the operation.
The Create Custom Image workflow can take a few minutes to complete and the time taken depends on the used capacity of the source VM OS disk. Do not turn the source VM on while it is being created.
Listing Images
- CLI
- UI
- Terraform
Use the compute images list to list all images:
crusoe compute images list
You can view custom images in the Custom Images page.
# Data source to get all custom images
data "crusoe_compute_custom_image" "clean_list_images" {
}
output "custom_image_list" {
value = data.crusoe_compute_custom_image.clean_list_images.custom_images
}
Using Images
- CLI
- UI
- Terraform
Use the compute vms create command, passing an image flag with the chosen curated image or passing a --custom-image flag with the chosen custom image:
crusoe compute vms create \
--image ubuntu:22.04 \
...
crusoe compute vms create \
--custom-image my-custom-image \
...
To use a VM image in the console:
- From the console, select Compute > Instances in the left nav.
- Click Create Instance.
- Select one of the Instance Options:
- Default: Enables you to create an instance with a curated image.
- Custom: Enables you to create an instance with a custom image.
- Use the Select an image and Select an image version dropdowns to select an image and version.
- Continue with the remainder of the Create Instance flow.
# Create the VM using the custom image
resource "crusoe_compute_instance" "my_vm_with_custom_image" {
name = "my-vm"
location = "us-east1-a"
type = "c1a.2x"
custom_image = "my-custom-image" # Use custom_image parameter with image name
ssh_key = file("~/.ssh/id_ed25519.pub")
}
Update Custom Images
- CLI
- UI
Use the compute images update command, passing an description flag to update the description:
crusoe compute images update <vm-name>\
--description my-new-description \
...
Use the compute images add-tags command, passing an tags flag to add tags to the custom image:
crusoe compute images add-tags <vm-name>\
--tags my-new-tag1,my-new-tag2 \
...
Use the compute images delete-tags command, passing an tags flag to delete tags from the custom image:
crusoe compute images delete-tags <vm-name>\
--tags my-tags-to-delete1,my-tags-to-delete2 \
...
To update a custom image in the console:
- From the console, select Compute > Custom Images in the left nav.
- Find the custom image you want to edit and click the edit icon.
- Edit the tags and description as necessary.
- Click Update to apply the changes.
Delete Custom Images
- CLI
- UI
Use the compute images delete command:
crusoe compute images delete <my-custom-image>
To delete a custom image in the console:
- From the console, select Compute > Custom Images in the left nav.
- Find the custom image you want to delete.
- Click the delete icon in the row for that image.
- Input the name of the custom image in the input box and click Confirm.