diff --git a/docs/resources/virtual_environment_file.md b/docs/resources/virtual_environment_file.md index 8867dd16..5e7c29d3 100644 --- a/docs/resources/virtual_environment_file.md +++ b/docs/resources/virtual_environment_file.md @@ -13,18 +13,42 @@ Manages a file. ## Example Usage +### Backups + +-> **Note:** The resource with this content type uses SSH access to the node. You might need to configure the [`ssh` option in the `provider` section](../index.md#node-ip-address-used-for-ssh-connection). + ```terraform -resource "proxmox_virtual_environment_file" "ubuntu_container_template" { - content_type = "vztmpl" +resource "proxmox_virtual_environment_file" "backup" { + content_type = "backup" datastore_id = "local" - node_name = "first-node" + node_name = "pve" source_file { - path = "https://download.proxmox.com/images/system/ubuntu-20.04-standard_20.04-1_amd64.tar.gz" + path = "vzdump-lxc-100-2023_11_08-23_10_05.tar" } } ``` +### Images + +```terraform +resource "proxmox_virtual_environment_file" "ubuntu_container_template" { + content_type = "iso" + datastore_id = "local" + node_name = "pve" + + source_file { + path = "https://cloud-images.ubuntu.com/jammy/20230929/jammy-server-cloudimg-amd64-disk-kvm.img" + } +} +``` + +### Snippets + +-> **Note:** Snippets are not enabled by default in new Proxmox installations. You need to enable them in the 'Datacenter>Storage' section of the proxmox interface before first using this resource. + +-> **Note:** The resource with this content type uses SSH access to the node. You might need to configure the [`ssh` option in the `provider` section](../index.md#node-ip-address-used-for-ssh-connection). + ```terraform resource "proxmox_virtual_environment_file" "cloud_config" { content_type = "snippets" @@ -56,6 +80,21 @@ EOF } ``` +### Container Template (`vztmpl`) + +```terraform +resource "proxmox_virtual_environment_file" "ubuntu_container_template" { + content_type = "vztmpl" + datastore_id = "local" + node_name = "first-node" + + source_file { + path = "https://download.proxmox.com/images/system/ubuntu-20.04-standard_20.04-1_amd64.tar.gz" + } +} +``` + + ## Argument Reference - `content_type` - (Optional) The content type. If not specified, the content type will be inferred from the file @@ -107,10 +146,6 @@ unconditionally replace it and take ownership of the resource. On destruction, the file will be deleted as if it did not exist before. If you want to prevent the resource from replacing the file, set `overwrite` to `false`. -Make sure the target datastore supports the content type you are uploading. For -example, the `snippets` content type can be disabled by default on the `local` -datastore. - ## Import Instances can be imported using the `node_name`, `datastore_id`, `content_type` diff --git a/docs/resources/virtual_environment_vm.md b/docs/resources/virtual_environment_vm.md index d8c5a018..63a0a5bf 100644 --- a/docs/resources/virtual_environment_vm.md +++ b/docs/resources/virtual_environment_vm.md @@ -11,6 +11,8 @@ subcategory: Virtual Environment Manages a virtual machine. +> This resource uses SSH access to the node. You might need to configure the [`ssh` option in the `provider` section](../index.md#node-ip-address-used-for-ssh-connection). + ## Example Usage ```terraform