Resources
zsphere_image
This resource allows you to manage images in ZSvirt. An image represents a virtual machine image format qcow2, raw, vmdk or an ISO file that can be used to create or boot virtual machines. You can define the image's properties, such as its URL, format, architecture, and backup storage locations.
zsphere_image (Resource)
This resource allows you to manage images in ZSvirt. An image represents a virtual machine image format qcow2, raw, vmdk or an ISO file that can be used to create or boot virtual machines. You can define the image's properties, such as its URL, format, architecture, and backup storage locations.
Example Usage
data "zsphere_image_storages" "test" {
name = "image_storage_from_terraform"
}
resource "zsphere_image" "image" {
name = "image_from_terraform"
description = "Add An example image from terraform"
url = "http://minio.zstack.io:9001/packer/logserver-by-packer-image-compressed.qcow2"
guest_os_type = "Linux"
platform = "Linux"
format = "qcow2"
architecture = "x86_64"
virtio = true
image_storage_uuids = [data.zsphere_image_storages.test.image_storages.0.uuid]
boot_mode = "Legacy"
expunge = true
}
output "zsphere_image" {
value = zsphere_image.image
}Schema
Required
image_storage_uuids(List of String) A list of UUIDs for the image storages where the image is stored.name(String) The name of the image. This is a mandatory field.url(String) The URL where the image is located. This can be a file path or an HTTP link. Changing this will force recreation of the resource.
Optional
architecture(String) The architecture of the image, such as 'x86_64' or 'aarch64'.boot_mode(String) The boot mode supported by the image, such as 'Legacy', 'UEFI', or 'UEFI_WITH_CSM'.description(String) A description of the image, providing additional context or details.enable(Boolean) Enable or disable the image. When set to true, the image will be enabled.expunge(Boolean) Indicates if the image should be expunged (permanently deleted) after deletion. If true, the image will be expunged instead of just deleted.format(String) The format of the image file, such as 'qcow2', 'raw', or 'vmdk'.guest_os_type(String) The guest operating system type that the image is optimized for.media_type(String) The type of media for the image. Examples include 'ISO' or 'RootVolumeTemplate' or DataVolumeTemplate.platform(String) The platform that the image is intended for, such as 'Linux', 'Windows', or others.virtio(Boolean) Indicates if the VirtIO drivers are required for the image.
Read-Only
actual_size(Number) The actual size of the image in bytes after compression.backup_storage_refs(Attributes List) References to the backup storages where this image is stored. (see below for nested schema)md5_sum(String) The MD5 checksum of the image.size(Number) The size of the image in bytes.state(String) The state of the image, such as 'Enabled' or 'Disabled'.status(String) The status of the image, such as 'Ready' or 'NotReady'.system(String) Indicates if the image is a system image. Set automatically by ZStack.type(String) The type of the image, such as 'zstack' or 'iso'.uuid(String) The unique identifier of the image. Automatically generated by ZSvirt.
Nested Schema for backup_storage_refs
Read-Only:
backup_storage_uuid(String) The UUID of the backup storage.install_path(String) The install path of the image on the backup storage.