资源
zsphere_image_storage
管理 ZSvirt 镜像存储,用于存放云主机镜像文件。
zsphere_image_storage(资源)
管理 ZSvirt 镜像存储,用于存放云主机镜像文件。
示例用法
data "zsphere_datacenter" "test" {
name = "zone_example"
}
resource "zsphere_image_storage" "image_store" {
name = "image_store_from_terraform"
description = "Add An example image storage from terraform"
type = "ImageStore"
hostname = "192.168.1.100"
url = "/zstack/imagestore"
ssh_port = 22
username = "root"
password = "password"
zone_uuid = data.zsphere_datacenter.test.data_centers[0].uuid
import_images = false
}
resource "zsphere_image_storage" "ceph" {
name = "ceph_backup_storage_from_terraform"
description = "Add An example Ceph backup storage from terraform"
type = "Ceph"
pool_name = "images"
mon_urls = ["ceph-user:password@192.168.1.10:6789"]
zone_uuid = data.zsphere_zone.test.zones[0].uuid
}
output "zsphere_image_storage_image_store" {
value = zsphere_image_storage.image_store
}
output "zsphere_image_storage_ceph" {
value = zsphere_image_storage.ceph
}参数说明
必填参数
name(字符串)Image名称 Storagetype(字符串)Image类型 Storage (ImageStore or Ceph)
可选参数
description(字符串)镜像存储描述hostname(字符串)Hostname for ImageStore typeimport_images(布尔值)Import images for ImageStore typemon_urls(字符串列表)MON URLs for Ceph typepassword(字符串,敏感)Password for ImageStore typepool_name(字符串)Pool name for Ceph typessh_port(数字)SSH port for ImageStore typeurl(字符串)URL for ImageStore typeusername(字符串)Username for ImageStore typezone_uuid(字符串)Zone UUID to attach the Image Storage
只读属性
attached_zone_uuids(字符串列表)Attached zone UUIDsavailable_capacity(数字)Available capacity of the Image Storagestate(字符串)State of the Image Storagestatus(字符串)Status of the Image Storagetotal_capacity(数字)Total capacity of the Image Storageuuid(字符串)UUID of the Image Storage