Resources

zsphere_vm_template

This resource allows you to create and manage VM templates in ZSvirt. A VM template is created by converting an existing VM instance.

zsphere_vm_template (Resource)

This resource allows you to create and manage VM templates in ZSvirt. A VM template is created by converting an existing VM instance.

Example Usage

resource "zsphere_vm_template" "example" {
  name             = "my-updated-template"
  description      = "This template was managed by Terraform"
  vm_instance_uuid = var.vm_instance_uuid
}

output "vm_template" {
  value = zsphere_vm_template.example
}

# Note: Creating a VM Template is done by converting an existing VM instance.
# This resource is used to manage existing VM templates (read, update, delete).
# The creation of VM templates needs to be done through:
# 1. Converting an existing VM instance using ZStack UI
# 2. Using API: POST /vm-instances/{uuid}/create-templated-vmInstance
# 3. Or using zsphere_instance resource with convert_to_template = true

Schema

Required

  • name (String) The name of the VM template.

Optional

  • description (String) The description of the VM template.
  • vm_instance_uuid (String) The UUID of the VM instance to convert to a template. Changing this will recreate the resource.

Read-Only

  • cluster_uuid (String) The UUID of the cluster to which the VM template belongs.
  • uuid (String) The unique identifier of the VM template. Automatically generated by ZSvirt.

On this page