github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/website/source/docs/providers/openstack/r/images_image_v2.html.markdown (about) 1 --- 2 layout: "openstack" 3 page_title: "OpenStack: openstack_images_image_v2" 4 sidebar_current: "docs-openstack-resource-images-image-v2" 5 description: |- 6 Manages a V2 Image resource within OpenStack Glance. 7 --- 8 9 # openstack\_images\_image_v2 10 11 Manages a V2 Image resource within OpenStack Glance. 12 13 ## Example Usage 14 15 ``` 16 resource "openstack_images_image_v2" "rancheros" { 17 name = "RancherOS" 18 image_source_url = "https://releases.rancher.com/os/latest/rancheros-openstack.img" 19 container_format = "bare" 20 disk_format = "qcow2" 21 } 22 ``` 23 24 ## Argument Reference 25 26 The following arguments are supported: 27 28 * `container_format` - (Required) The container format. Must be one of 29 "ami", "ari", "aki", "bare", "ovf". 30 31 * `disk_format` - (Required) The disk format. Must be one of 32 "ami", "ari", "aki", "vhd", "vmdk", "raw", "qcow2", "vdi", "iso". 33 34 * `local_file_path` - (Optional) This is the filepath of the raw image file 35 that will be uploaded to Glance. Conflicts with `image_source_url`. 36 37 * `image_cache_path` - (Optional) This is the directory where the images will 38 be downloaded. Images will be stored with a filename corresponding to 39 the url's md5 hash. Defaults to "$HOME/.terraform/image_cache" 40 41 * `image_source_url` - (Optional) This is the url of the raw image that will 42 be downloaded in the `image_cache_path` before being uploaded to Glance. 43 Glance is able to download image from internet but the `gophercloud` library 44 does not yet provide a way to do so. 45 Conflicts with `local_file_path`. 46 47 * `min_disk_gb` - (Optional) Amount of disk space (in GB) required to boot image. 48 Defaults to 0. 49 50 * `min_ram_mb` - (Optional) Amount of ram (in MB) required to boot image. 51 Defauts to 0. 52 53 * `name` - (Required) The name of the image. 54 55 * `protected` - (Optional) If true, image will not be deletable. 56 Defaults to false. 57 58 * `region` - (Required) The region in which to obtain the V2 Glance client. 59 A Glance client is needed to create an Image that can be used with 60 a compute instance. If omitted, the `OS_REGION_NAME` environment variable 61 is used. Changing this creates a new Image. 62 63 * `tags` - (Optional) The tags of the image. It must be a list of strings. 64 At this time, it is not possible to delete all tags of an image. 65 66 * `visibility` - (Optional) The visibility of the image. Must be one of 67 "public", "private", "community", or "shared". The ability to set the 68 visibility depends upon the configuration of the OpenStack cloud. 69 70 Note: The `properties` attribute handling in the gophercloud library is currently buggy 71 and needs to be fixed before being implemented in this resource. 72 73 ## Attributes Reference 74 75 The following attributes are exported: 76 77 * `checksum` - The checksum of the data associated with the image. 78 * `container_format` - See Argument Reference above. 79 * `created_at` - The date the image was created. 80 * `disk_format` - See Argument Reference above. 81 * `file` - the trailing path after the glance 82 endpoint that represent the location of the image 83 or the path to retrieve it. 84 * `id` - A unique ID assigned by Glance. 85 * `metadata` - The metadata associated with the image. 86 Image metadata allow for meaningfully define the image properties 87 and tags. See http://docs.openstack.org/developer/glance/metadefs-concepts.html. 88 * `min_disk_gb` - See Argument Reference above. 89 * `min_ram_mb` - See Argument Reference above. 90 * `name` - See Argument Reference above. 91 * `owner` - The id of the openstack user who owns the image. 92 * `protected` - See Argument Reference above. 93 * `region` - See Argument Reference above. 94 * `schema` - The path to the JSON-schema that represent 95 the image or image 96 * `size_bytes` - The size in bytes of the data associated with the image. 97 * `status` - The status of the image. It can be "queued", "active" 98 or "saving". 99 * `tags` - See Argument Reference above. 100 * `update_at` - The date the image was last updated. 101 * `visibility` - See Argument Reference above. 102 103 ## Import 104 105 Images can be imported using the `id`, e.g. 106 107 ``` 108 $ terraform import openstack_images_image_v2.rancheros 89c60255-9bd6-460c-822a-e2b959ede9d2 109 ```