diff --git a/.all-contributorsrc b/.all-contributorsrc index cb780f44..a09bab71 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1452,6 +1452,15 @@ "contributions": [ "doc" ] + }, + { + "login": "kam193", + "name": "Kamil Mańkowski", + "avatar_url": "https://avatars.githubusercontent.com/u/8472271?v=4", + "profile": "https://github.com/kam193", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 9455ff0b..feec47f6 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,6 +1,6 @@ -FROM golang:1.24.5@sha256:ef5b4be1f94b36c90385abd9b6b4f201723ae28e71acacb76d00687333c17282 +FROM golang:1.24.6@sha256:2c89c41fb9efc3807029b59af69645867cfe978d2b877d475be0d72f6c6ce6f6 -ARG GOLANGCI_LINT_VERSION=2.3.0 # renovate: depName=golangci/golangci-lint datasource=github-releases +ARG GOLANGCI_LINT_VERSION=2.3.1 # renovate: depName=golangci/golangci-lint datasource=github-releases RUN apt update && apt upgrade -y && \ apt-get install --no-install-recommends -y ca-certificates curl gnupg lsb-release jq zsh neovim gh && \ diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 9feb9eb5..55ca1d4a 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -16,7 +16,7 @@ jobs: pull-requests: write checks: write steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 with: ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit fetch-depth: 0 # a full history is required for pull request analysis diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index cf82beb4..679da4c4 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 with: fetch-depth: 0 @@ -42,6 +42,6 @@ jobs: if: ${{ steps.filter.outputs.go == 'true' || steps.filter.outputs.linter == 'true'}} uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8 with: - version: v2.3.0 # renovate: depName=golangci/golangci-lint datasource=github-releases + version: v2.3.1 # renovate: depName=golangci/golangci-lint datasource=github-releases skip-cache: true args: -v --timeout=10m diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index 56acf5f4..a9858b66 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Generate Short Lived OAuth App Token - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 + uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1 id: app-token with: app-id: "${{ secrets.BOT_APP_ID }}" @@ -19,10 +19,10 @@ jobs: repositories: "${{ github.event.repository.name }}" - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Link Checker - uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332 # v2.4.1 + uses: lycheeverse/lychee-action@5c4ee84814c983aa7164eaee476f014e53ff3963 # v2.5.0 id: lychee env: GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5e2d2aa3..40083aa0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Generate Short Lived OAuth App Token - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 + uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1 id: app-token with: app-id: "${{ secrets.BOT_APP_ID }}" @@ -32,7 +32,7 @@ jobs: repositories: "${{ github.event.repository.name }}" - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 with: fetch-depth: 0 diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 8ce0d0b1..f7982586 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -13,7 +13,7 @@ jobs: contents: write steps: - name: Generate Short Lived OAuth App Token - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 + uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1 id: app-token with: app-id: "${{ secrets.BOT_APP_ID }}" diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml index 01c23749..5c5be86f 100644 --- a/.github/workflows/stale.yaml +++ b/.github/workflows/stale.yaml @@ -12,7 +12,7 @@ jobs: pull-requests: write steps: - name: Generate Short Lived OAuth App Token - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 + uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1 id: app-token with: app-id: "${{ secrets.BOT_APP_ID }}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 95213691..027f99f1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: timeout-minutes: 5 steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 with: fetch-depth: 1 @@ -51,7 +51,7 @@ jobs: run: echo "$GITHUB_CONTEXT" - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 with: fetch-depth: 1 diff --git a/.github/workflows/testacc.yml b/.github/workflows/testacc.yml index e0852070..07017613 100644 --- a/.github/workflows/testacc.yml +++ b/.github/workflows/testacc.yml @@ -35,7 +35,7 @@ jobs: run: echo "$GITHUB_CONTEXT" - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 with: fetch-depth: 1 ref: ${{ github.event.inputs.ref || github.ref}} diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 94c285d8..64ea4d4a 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -205,6 +205,7 @@ Ryan W
Ryan W

📖 + Kamil Mańkowski
Kamil Mańkowski

💻 diff --git a/Makefile b/Makefile index a762da4d..bb73b0dd 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ TARGETS=darwin linux windows TERRAFORM_PLUGIN_EXTENSION= VERSION=0.81.0# x-release-please-version -GOLANGCI_LINT_VERSION=2.3.0# renovate: depName=golangci/golangci-lint datasource=github-releases +GOLANGCI_LINT_VERSION=2.3.1# renovate: depName=golangci/golangci-lint datasource=github-releases # check if opentofu is installed and use it if it is, # otherwise use terraform diff --git a/docs/guides/clone-vm.md b/docs/guides/clone-vm.md index 813850f8..abf7bcaf 100644 --- a/docs/guides/clone-vm.md +++ b/docs/guides/clone-vm.md @@ -3,21 +3,21 @@ layout: page page_title: "Clone a VM" subcategory: Guides description: |- - This guide explains how to create a VM template and then clone it to another VM. + This guide explains how to create a VM template and clone it to a new VM. --- # Clone a VM ## Create a VM template -VM templates in Proxmox provide an efficient way to create multiple identical VMs. Templates act as a base image that can be cloned to create new VMs, ensuring consistency and reducing the time needed to provision new instances. When a VM is created as a template, it is read-only and can't be started, but can be cloned multiple times to create new VMs. +VM templates in Proxmox provide an efficient way to create multiple identical VMs. Templates act as a base image that can be cloned to create new VMs, ensuring consistency and reducing the time needed to provision new instances. When a VM is created as a template, it is read-only and cannot be started, but can be cloned multiple times to create new VMs. -You can create a template directly in Proxmox by setting the `template` attribute to `true` when creating the VM resource: +You can create a template with Terraform by setting the `template` attribute to `true` when creating the VM resource: ```terraform resource "proxmox_virtual_environment_vm" "ubuntu_template" { name = "ubuntu-template" - node_name = "pve" + node_name = var.virtual_environment_node_name template = true started = false @@ -35,12 +35,12 @@ resource "proxmox_virtual_environment_vm" "ubuntu_template" { } efi_disk { - datastore_id = "local" + datastore_id = var.datastore_id type = "4m" } disk { - datastore_id = "local-lvm" + datastore_id = var.datastore_id file_id = proxmox_virtual_environment_download_file.ubuntu_cloud_image.id interface = "virtio0" iothread = true @@ -67,18 +67,18 @@ resource "proxmox_virtual_environment_vm" "ubuntu_template" { resource "proxmox_virtual_environment_download_file" "ubuntu_cloud_image" { content_type = "iso" datastore_id = "local" - node_name = "pve" + node_name = var.virtual_environment_node_name url = "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img" } ``` -Once you have a template, you can clone it to create new VMs. The cloned VMs will inherit all the configuration from the template but can be customized further as needed. +Once you have a template, you can clone it to create new VMs. The cloned VMs will inherit all configuration from the template but can be customized further as needed. ```terraform resource "proxmox_virtual_environment_vm" "ubuntu_clone" { name = "ubuntu-clone" - node_name = "pve" + node_name = var.virtual_environment_node_name clone { vm_id = proxmox_virtual_environment_vm.ubuntu_template.id @@ -113,3 +113,5 @@ output "vm_ipv4_address" { value = proxmox_virtual_environment_vm.ubuntu_clone.ipv4_addresses[1][0] } ``` + +Full example is available in the [examples/guides/clone-vm](https://github.com/bpg/terraform-provider-proxmox/tree/main/examples/guides/clone-vm) directory. diff --git a/examples/guides/clone-vm/clone.tf b/examples/guides/clone-vm/clone.tf index e881eb20..4f3f14af 100644 --- a/examples/guides/clone-vm/clone.tf +++ b/examples/guides/clone-vm/clone.tf @@ -1,6 +1,6 @@ resource "proxmox_virtual_environment_vm" "ubuntu_clone" { name = "ubuntu-clone" - node_name = "pve" + node_name = var.virtual_environment_node_name clone { vm_id = proxmox_virtual_environment_vm.ubuntu_template.id diff --git a/examples/guides/clone-vm/cloud-config.tf b/examples/guides/clone-vm/cloud-config.tf index 05f57509..053f617d 100644 --- a/examples/guides/clone-vm/cloud-config.tf +++ b/examples/guides/clone-vm/cloud-config.tf @@ -5,7 +5,7 @@ data "local_file" "ssh_public_key" { resource "proxmox_virtual_environment_file" "user_data_cloud_config" { content_type = "snippets" datastore_id = "local" - node_name = "pve" + node_name = var.virtual_environment_node_name source_raw { data = <<-EOF diff --git a/examples/guides/clone-vm/template.tf b/examples/guides/clone-vm/template.tf index c96dd86b..e8406bbb 100644 --- a/examples/guides/clone-vm/template.tf +++ b/examples/guides/clone-vm/template.tf @@ -1,6 +1,6 @@ resource "proxmox_virtual_environment_vm" "ubuntu_template" { name = "ubuntu-template" - node_name = "pve" + node_name = var.virtual_environment_node_name template = true started = false @@ -18,12 +18,12 @@ resource "proxmox_virtual_environment_vm" "ubuntu_template" { } efi_disk { - datastore_id = "local" + datastore_id = var.datastore_id type = "4m" } disk { - datastore_id = "local-lvm" + datastore_id = var.datastore_id file_id = proxmox_virtual_environment_download_file.ubuntu_cloud_image.id interface = "virtio0" iothread = true @@ -50,7 +50,7 @@ resource "proxmox_virtual_environment_vm" "ubuntu_template" { resource "proxmox_virtual_environment_download_file" "ubuntu_cloud_image" { content_type = "iso" datastore_id = "local" - node_name = "pve" + node_name = var.virtual_environment_node_name url = "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img" } diff --git a/examples/guides/clone-vm/variables.tf b/examples/guides/clone-vm/variables.tf index 62017de9..01377701 100644 --- a/examples/guides/clone-vm/variables.tf +++ b/examples/guides/clone-vm/variables.tf @@ -8,3 +8,15 @@ variable "virtual_environment_token" { description = "The token for the Proxmox Virtual Environment API" sensitive = true } + +variable "virtual_environment_node_name" { + type = string + description = "The node name for the Proxmox Virtual Environment API" + default = "pve" +} + +variable "datastore_id" { + type = string + description = "Datastore for VM disks" + default = "local-lvm" +} diff --git a/go.mod b/go.mod index 3b646dd2..1c985bb6 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( github.com/rogpeppe/go-internal v1.14.1 github.com/skeema/knownhosts v1.3.1 github.com/stretchr/testify v1.10.0 - golang.org/x/crypto v0.40.0 - golang.org/x/net v0.42.0 + golang.org/x/crypto v0.41.0 + golang.org/x/net v0.43.0 ) require ( @@ -89,11 +89,11 @@ require ( github.com/zclconf/go-cty v1.16.3 // indirect go.abhg.dev/goldmark/frontmatter v0.2.0 // indirect golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect - golang.org/x/mod v0.25.0 // indirect + golang.org/x/mod v0.26.0 // indirect golang.org/x/sync v0.16.0 // indirect - golang.org/x/sys v0.34.0 // indirect - golang.org/x/text v0.27.0 // indirect - golang.org/x/tools v0.34.0 // indirect + golang.org/x/sys v0.35.0 // indirect + golang.org/x/text v0.28.0 // indirect + golang.org/x/tools v0.35.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect google.golang.org/grpc v1.72.1 // indirect diff --git a/go.sum b/go.sum index 82da126d..875894d8 100644 --- a/go.sum +++ b/go.sum @@ -256,8 +256,8 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= -golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= -golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= +golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= +golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -265,8 +265,8 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= -golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg= +golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -277,8 +277,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs= -golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8= +golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= +golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -307,8 +307,8 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= -golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= +golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -319,8 +319,8 @@ golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= -golang.org/x/term v0.33.0 h1:NuFncQrRcaRvVmgRkvM3j/F00gWIAlcmlB8ACEKmGIg= -golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0= +golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4= +golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -332,16 +332,16 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= -golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= +golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= +golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo= -golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg= +golang.org/x/tools v0.35.0 h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0= +golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= diff --git a/proxmox_virtual_environment_sdn_zone_evpn/data-source.tf b/proxmox_virtual_environment_sdn_zone_evpn/data-source.tf deleted file mode 100644 index 2b70ab68..00000000 --- a/proxmox_virtual_environment_sdn_zone_evpn/data-source.tf +++ /dev/null @@ -1,23 +0,0 @@ -data "proxmox_virtual_environment_sdn_zone_evpn" "example" { - id = "evpn1" -} - -output "data_proxmox_virtual_environment_sdn_zone_evpn" { - value = { - id = data.proxmox_virtual_environment_sdn_zone_evpn.example.id - nodes = data.proxmox_virtual_environment_sdn_zone_evpn.example.nodes - controller = data.proxmox_virtual_environment_sdn_zone_evpn.example.controller - vrf_vxlan = data.proxmox_virtual_environment_sdn_zone_evpn.example.vrf_vxlan - advertise_subnets = data.proxmox_virtual_environment_sdn_zone_evpn.example.advertise_subnets - disable_arp_nd_suppression = data.proxmox_virtual_environment_sdn_zone_evpn.example.disable_arp_nd_suppression - exit_nodes = data.proxmox_virtual_environment_sdn_zone_evpn.example.exit_nodes - exit_nodes_local_routing = data.proxmox_virtual_environment_sdn_zone_evpn.example.exit_nodes_local_routing - primary_exit_node = data.proxmox_virtual_environment_sdn_zone_evpn.example.primary_exit_node - rt_import = data.proxmox_virtual_environment_sdn_zone_evpn.example.rt_import - mtu = data.proxmox_virtual_environment_sdn_zone_evpn.example.mtu - dns = data.proxmox_virtual_environment_sdn_zone_evpn.example.dns - dns_zone = data.proxmox_virtual_environment_sdn_zone_evpn.example.dns_zone - ipam = data.proxmox_virtual_environment_sdn_zone_evpn.example.ipam - reverse_dns = data.proxmox_virtual_environment_sdn_zone_evpn.example.reverse_dns - } -} diff --git a/proxmox_virtual_environment_sdn_zone_qinq/data-source.tf b/proxmox_virtual_environment_sdn_zone_qinq/data-source.tf deleted file mode 100644 index 26f448c1..00000000 --- a/proxmox_virtual_environment_sdn_zone_qinq/data-source.tf +++ /dev/null @@ -1,18 +0,0 @@ -data "proxmox_virtual_environment_sdn_zone_qinq" "example" { - id = "qinq1" -} - -output "data_proxmox_virtual_environment_sdn_zone_qinq" { - value = { - id = data.proxmox_virtual_environment_sdn_zone_qinq.example.id - nodes = data.proxmox_virtual_environment_sdn_zone_qinq.example.nodes - bridge = data.proxmox_virtual_environment_sdn_zone_qinq.example.bridge - service_vlan = data.proxmox_virtual_environment_sdn_zone_qinq.example.service_vlan - service_vlan_protocol = data.proxmox_virtual_environment_sdn_zone_qinq.example.service_vlan_protocol - mtu = data.proxmox_virtual_environment_sdn_zone_qinq.example.mtu - dns = data.proxmox_virtual_environment_sdn_zone_qinq.example.dns - dns_zone = data.proxmox_virtual_environment_sdn_zone_qinq.example.dns_zone - ipam = data.proxmox_virtual_environment_sdn_zone_qinq.example.ipam - reverse_dns = data.proxmox_virtual_environment_sdn_zone_qinq.example.reverse_dns - } -} diff --git a/proxmox_virtual_environment_sdn_zone_simple/data-source.tf b/proxmox_virtual_environment_sdn_zone_simple/data-source.tf deleted file mode 100644 index 452cb88f..00000000 --- a/proxmox_virtual_environment_sdn_zone_simple/data-source.tf +++ /dev/null @@ -1,15 +0,0 @@ -data "proxmox_virtual_environment_sdn_zone_simple" "example" { - id = "simple1" -} - -output "data_proxmox_virtual_environment_sdn_zone_simple" { - value = { - id = data.proxmox_virtual_environment_sdn_zone_simple.example.id - nodes = data.proxmox_virtual_environment_sdn_zone_simple.example.nodes - mtu = data.proxmox_virtual_environment_sdn_zone_simple.example.mtu - dns = data.proxmox_virtual_environment_sdn_zone_simple.example.dns - dns_zone = data.proxmox_virtual_environment_sdn_zone_simple.example.dns_zone - ipam = data.proxmox_virtual_environment_sdn_zone_simple.example.ipam - reverse_dns = data.proxmox_virtual_environment_sdn_zone_simple.example.reverse_dns - } -} diff --git a/proxmox_virtual_environment_sdn_zone_vlan/data-source.tf b/proxmox_virtual_environment_sdn_zone_vlan/data-source.tf deleted file mode 100644 index a1f0f9e4..00000000 --- a/proxmox_virtual_environment_sdn_zone_vlan/data-source.tf +++ /dev/null @@ -1,16 +0,0 @@ -data "proxmox_virtual_environment_sdn_zone_vlan" "example" { - id = "vlan1" -} - -output "data_proxmox_virtual_environment_sdn_zone_vlan" { - value = { - id = data.proxmox_virtual_environment_sdn_zone_vlan.example.id - nodes = data.proxmox_virtual_environment_sdn_zone_vlan.example.nodes - bridge = data.proxmox_virtual_environment_sdn_zone_vlan.example.bridge - mtu = data.proxmox_virtual_environment_sdn_zone_vlan.example.mtu - dns = data.proxmox_virtual_environment_sdn_zone_vlan.example.dns - dns_zone = data.proxmox_virtual_environment_sdn_zone_vlan.example.dns_zone - ipam = data.proxmox_virtual_environment_sdn_zone_vlan.example.ipam - reverse_dns = data.proxmox_virtual_environment_sdn_zone_vlan.example.reverse_dns - } -} diff --git a/proxmox_virtual_environment_sdn_zone_vxlan/data-source.tf b/proxmox_virtual_environment_sdn_zone_vxlan/data-source.tf deleted file mode 100644 index 2ca035e4..00000000 --- a/proxmox_virtual_environment_sdn_zone_vxlan/data-source.tf +++ /dev/null @@ -1,16 +0,0 @@ -data "proxmox_virtual_environment_sdn_zone_vxlan" "example" { - id = "vxlan1" -} - -output "data_proxmox_virtual_environment_sdn_zone_vxlan" { - value = { - id = data.proxmox_virtual_environment_sdn_zone_vxlan.example.id - nodes = data.proxmox_virtual_environment_sdn_zone_vxlan.example.nodes - peers = data.proxmox_virtual_environment_sdn_zone_vxlan.example.peers - mtu = data.proxmox_virtual_environment_sdn_zone_vxlan.example.mtu - dns = data.proxmox_virtual_environment_sdn_zone_vxlan.example.dns - dns_zone = data.proxmox_virtual_environment_sdn_zone_vxlan.example.dns_zone - ipam = data.proxmox_virtual_environment_sdn_zone_vxlan.example.ipam - reverse_dns = data.proxmox_virtual_environment_sdn_zone_vxlan.example.reverse_dns - } -} diff --git a/proxmox_virtual_environment_sdn_zones/data-source.tf b/proxmox_virtual_environment_sdn_zones/data-source.tf deleted file mode 100644 index a84abd4c..00000000 --- a/proxmox_virtual_environment_sdn_zones/data-source.tf +++ /dev/null @@ -1,25 +0,0 @@ -# List all SDN zones -data "proxmox_virtual_environment_sdn_zones" "all" {} - -# List only EVPN zones -data "proxmox_virtual_environment_sdn_zones" "evpn_only" { - type = "evpn" -} - -# List only Simple zones -data "proxmox_virtual_environment_sdn_zones" "simple_only" { - type = "simple" -} - -output "data_proxmox_virtual_environment_sdn_zones_all" { - value = { - zones = data.proxmox_virtual_environment_sdn_zones.all.zones - } -} - -output "data_proxmox_virtual_environment_sdn_zones_filtered" { - value = { - evpn_zones = data.proxmox_virtual_environment_sdn_zones.evpn_only.zones - simple_zones = data.proxmox_virtual_environment_sdn_zones.simple_only.zones - } -} diff --git a/proxmoxtf/resource/container/container.go b/proxmoxtf/resource/container/container.go index 58435cf7..bd424299 100644 --- a/proxmoxtf/resource/container/container.go +++ b/proxmoxtf/resource/container/container.go @@ -560,7 +560,7 @@ func Container() *schema.Resource { }, }, }, - MaxItems: 8, + MaxItems: maxNetworkInterfaces, MinItems: 0, }, mkInitializationUserAccount: { diff --git a/templates/guides/clone-vm.md.tmpl b/templates/guides/clone-vm.md.tmpl index 58047205..e739cf19 100644 --- a/templates/guides/clone-vm.md.tmpl +++ b/templates/guides/clone-vm.md.tmpl @@ -3,19 +3,21 @@ layout: page page_title: "Clone a VM" subcategory: Guides description: |- - This guide explains how to create a VM template and then clone it to another VM. + This guide explains how to create a VM template and clone it to a new VM. --- # Clone a VM ## Create a VM template -VM templates in Proxmox provide an efficient way to create multiple identical VMs. Templates act as a base image that can be cloned to create new VMs, ensuring consistency and reducing the time needed to provision new instances. When a VM is created as a template, it is read-only and can't be started, but can be cloned multiple times to create new VMs. +VM templates in Proxmox provide an efficient way to create multiple identical VMs. Templates act as a base image that can be cloned to create new VMs, ensuring consistency and reducing the time needed to provision new instances. When a VM is created as a template, it is read-only and cannot be started, but can be cloned multiple times to create new VMs. -You can create a template directly in Proxmox by setting the `template` attribute to `true` when creating the VM resource: +You can create a template with Terraform by setting the `template` attribute to `true` when creating the VM resource: {{ codefile "terraform" "examples/guides/clone-vm/template.tf" }} -Once you have a template, you can clone it to create new VMs. The cloned VMs will inherit all the configuration from the template but can be customized further as needed. +Once you have a template, you can clone it to create new VMs. The cloned VMs will inherit all configuration from the template but can be customized further as needed. {{ codefile "terraform" "examples/guides/clone-vm/clone.tf" }} + +Full example is available in the [examples/guides/clone-vm](https://github.com/bpg/terraform-provider-proxmox/tree/main/examples/guides/clone-vm) directory.