0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 18:42:58 +00:00
Commit Graph

232 Commits

Author SHA1 Message Date
Konstantin Kornienko
65f8ba5bfe
feat(vm): implement filtering in vms data source. (#1423)
* feat(vm): implement filtering in vms data source.

* Additional attributes for vm data source (status, template)

* fix qodana CI job condition

---------

Signed-off-by: Konstantin Kornienko <konstantin.kornienko@gmail.com>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-07-05 15:52:39 -04:00
Pavel Boldyrev
4f70459c26
chore(code): fix code quality warnings (#1409)
* chore(code): fix code quality warnings

+ re-enable Qodana on PRs

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-25 00:47:50 -04:00
Pavel Boldyrev
cc7fc63ec1
chore(vm): refactor storage devices handling from/to API (#1394)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-17 01:23:48 +00:00
Pavel Boldyrev
de349523fe
feat(vm): add support for disk.serial attribute (#1385)
* feat(vm): add support for `disk.serial` attribute

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-11 01:40:03 +00:00
Pavel Boldyrev
8892118228
misc: restore 0.59.1 code
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-09 23:40:27 -04:00
Pavel Boldyrev
80cafa689f
feat(vm2): add initial support for cdrom (#1370)
feat(vm2): add initial support for `cdrom`

This is a breaking change comparing to v1 - switching the cdrom schema from a nested block to a nested attribute map.

Improvements comparing to v1:
- support for `ide`, `sata`, `scsi` interfaces
- support for multiple cdroms

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-10 01:28:18 +00:00
Pavel Boldyrev
580381f892
chore(api): refactor nodes/vms/vms_types.go: split into multiple files (#1368)
Split all `Custom*` structs and marshaling code into separate files from `vms_types.go`

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-09 04:11:16 +00:00
Pavel Boldyrev
5d4193b6be
fix(vm): ignore 599 task status response when waiting for VM start (#1365)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-07 01:50:18 +00:00
Karlie Meads
76d980683c
fix(vm): host parameter is optional if using mapping for usb (#1338)
Signed-off-by: Karlie Meads <68717336+karliemeads@users.noreply.github.com>
2024-05-29 21:03:03 -04:00
Pavel Boldyrev
d843e46b37
misc(vm2): add support for vga (#1328)
* misc(vm2): add support for `vga`
* fix: use random VM IDs in parallel acc tests

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-05-27 21:30:12 -04:00
Rudolf Tammekivi
b7afd02cc3
fix(vm): check task warning status against exit code (#1330)
Signed-off-by: Rudolf Tammekivi <rudolf.tammekivi@guardtime.com>
2024-05-27 21:34:41 +00:00
Pavel Boldyrev
32de050605
feat(vm): add support for vga.clipboard, virtio-gl type (#1326)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-05-26 21:08:04 +00:00
Pavel Boldyrev
fb1105d93b
fix(vm): allow clone to pass with warnings (#1317)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-05-22 00:41:49 +00:00
Pavel Boldyrev
a6c6b98d44
fix(file): upload timeout with 596 response code (#1315)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-05-21 23:31:02 +00:00
Pavel Boldyrev
aa309fd9ea
chore(vm2): add support for cpu (#1310)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-05-18 04:52:02 +00:00
Pavel Boldyrev
2b7dd08020
feat(vm): remove support for initialization.upgrade attribute (#1295)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-05-15 00:55:29 +00:00
Pavel Boldyrev
920a4cd415
misc(vm): fix CustomBool conversion bug introduced in acl implementation (#1286)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-05-12 12:49:24 +00:00
Brian
ccf4834c16
feat(provider): add support for ssh-agent on Windows (#1270)
* feat(provider): add support for `ssh-agent` on Windows

Signed-off-by: Brian Karshick <Sparta142@users.noreply.github.com>
2024-05-09 23:00:44 -04:00
hrmny
afcbb415a3
feat(access): add ACL resource (#1166)
* feat: add ACL resource

Signed-off-by: hrmny <8845940+ForsakenHarmony@users.noreply.github.com>

* chore: move code under /access, cleanup acc tests

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

---------

Signed-off-by: hrmny <8845940+ForsakenHarmony@users.noreply.github.com>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-05-08 20:22:15 -04:00
Serge
8220271eee
feat(access): add proxmox user token (#1159) 2024-05-08 15:26:33 -04:00
Sven Greb
2eb36f4134
feat(cluster): Extend the available attributes for the proxmox_virtual_environment_cluster_options resource (#1241)
This commit implements the `next-id` and `notify` PVE API cluster
options.

The `next-id` attribute allows to control the range for the next free
VM ID. It is implemented as object and can be used in the
`proxmox_virtual_environment_cluster_options` resource and can be used
like this:

```terraform
resource "proxmox_virtual_environment_cluster_options" "options" {
  next_id = {
    lower = 200
    upper = 299
  }
}
```

Note that the minimum and maximum values are unfortunately not
documented in the PVE API explorer but can be found in the web UI where
the form fields have validations!

The `notify` PVE API attribute is also an object that has all the PVE
API fields:

```terraform
resource "proxmox_virtual_environment_cluster_options" "options" {
  notify = {
    ha_fencing_mode            = "never"
    ha_fencing_target          = "default-matcher"
    package_updates            = "always"
    package_updates_target     = "default-matcher"
    package_replication        = "always"
    package_replication_target = "default-matcher"
  }
}
```terraform

Note that the "fencing" attribute names have been adjusted to better
reflect their meaning since they are scoped to the Proxmox VE HA fencing
feature [1]. All attributes with the `_target` suffix are names for the
Proxmox VE notifications matchers [2].

[1]: https://pve.proxmox.com/wiki/Fencing
[2]: https://pve.proxmox.com/pve-docs/chapter-notifications.html#notification_matchers

---------

Signed-off-by: Sven Greb <development@svengreb.de>
2024-04-29 20:08:44 -04:00
Pavel Boldyrev
efd0d7b466
chore: remove unused code (#1236)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-04-24 20:52:41 -04:00
Pavel Boldyrev
7209fe0321
chore(vm2): experimental support for clone and inherited attributes (#1235)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-04-24 02:00:11 +00:00
Pavel Boldyrev
d8202dd7a1
chore(vm2): initial experimental VM resource implementation using Plugin Framework (#1230)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-04-19 21:57:12 +00:00
renovate[bot]
938784531f
chore(deps): update module github.com/avast/retry-go/v4 (v4.5.1 → v4.6.0) (#1229)
* chore(deps): update module github.com/avast/retry-go/v4 (v4.5.1 → v4.6.0)

| datasource | package                      | from   | to     |
| ---------- | ---------------------------- | ------ | ------ |
| go         | github.com/avast/retry-go/v4 | v4.5.1 | v4.6.0 |

* switch to `retry.UntilSucceeded()`

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-04-19 16:48:38 +00:00
Pavel Boldyrev
0c9c2066fd
fix(vm,lxc,file): improve timeouts handling (#1222)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-04-19 12:38:16 -04:00
Sven Greb
76c1c2282b
feat(cluster): Implement initial support for "hardware mappings" (#1213)
* feat(cluster): Implement initial support for "hardware mappings"

Right now it is alredy possible to use a mapped resource [1], but there
is no dedicated `proxmox_virtual_environment_cluster_hardware_mapping`
resource but this step must still be done manually (or automated through
other ways that interact with the Proxmox API).

This commit implements support for "hardware mapping" resources and data
sources for the, currently, available bus types PCI and USB, based on
the Proxmox VE API documentations [2].

There are some "specialities" in these resources and data sources:

1. The Proxmox VE API attribute, but this implementations names it
   "comment" since this naming is generally across the Proxmox VE web UI
   and API documentations. This still follows the Terraform
   "best practices" [3] as it improves the user experience by matching
   the field name to the naming used in the human-facing interfaces.

2. Like in point 1, the name of the attribute of "node checks
   diagnostics" for USB hardware mappings is "errors" in the Proxmox VE
   API while it is "checks" for hardware mappings of type PCI.
   The second naming pattern is also generally used across the
   Proxmox VE web UI and API documentations, including the "check_node"
   attribute that is also implemented in the
   "proxmox_virtual_environment_hardware_mappings" data source.
   Therefore, this implementation named both attributes "checks" which
   still follows the Terraform "best practices" [3] as it improves the
   user experience by matching the field name to the naming used in the
   human-facing interfaces.
3. This implmenetation comes with the "unique" feature of allowing
   comments (named "descriptions" by the Proxmox VE API) for an entry in
   a device map which is not possible through the web UI at all but only
   adding a comment for the whole mapping entry instead.

Note that this implementation also adds another point in the
"Known Issues" documentation since it is only possible to map a
PCI/USB device using the `root` PAM account, but this is still better
than having to manually configure it through the web UI or by
interacting with the Proxmox VE API on other ways.

[1]: https://github.com/bpg/terraform-provider-proxmox/pull/500
[2]: https://pve.proxmox.com/pve-docs/api-viewer/#/cluster/mapping/pci
[3]: https://developer.hashicorp.com/terraform/plugin/best-practices/hashicorp-provider-design-principles#resource-and-attribute-schema-should-closely-match-the-underlying-api

Signed-off-by: Sven Greb <development@svengreb.de>

* fix linter

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

---------

Signed-off-by: Sven Greb <development@svengreb.de>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-04-18 16:00:51 -04:00
Pavel Boldyrev
ad036a67e8
fix(vm): state drift due to disk re-ordering (#1215)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-04-15 16:45:38 -04:00
Pavel Boldyrev
59972dc1b5
feat(vm): add support for initialization.upgrade attribute (#1203)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-04-10 23:43:39 +00:00
Pavel Boldyrev
268c861649
chore: improve acceptance tests on CI (#1173)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-04-07 04:41:57 +00:00
Serge
dbbd966736
feat(vm): add support for numa architecture attribute (#1156) (#1175)
* feat(vm): add support for numa architecture attribute (#1156)

Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>

* fix: numa blocks reordering issue

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

---------

Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-04-06 16:30:13 -04:00
Leah
e87bc4b941
fix: prevent authenticating multiple times in parallel (#1168)
Signed-off-by: hrmny <8845940+ForsakenHarmony@users.noreply.github.com>
2024-03-27 18:27:07 -04:00
Serge
a2f055a916
feat(vm): add support for memory hugepages and keep_hugepages attributes (#1158)
Allow use hugepages on the VM.

Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
2024-03-27 18:13:03 -04:00
renovate[bot]
48756b69ba
chore(deps): update module github.com/golangci/golangci-lint (v1.56.2 → v1.57.1) in /tools (#1149)
* chore(deps): update module github.com/golangci/golangci-lint (v1.56.2 → v1.57.1) in /tools

| datasource | package                           | from    | to      |
| ---------- | --------------------------------- | ------- | ------- |
| go         | github.com/golangci/golangci-lint | v1.56.2 | v1.57.1 |

* fix linter errors

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-03-25 21:06:06 -04:00
Serge
83a5971cf6
feat(vm): add support for cpu affinity attribute (#1148) (#1153)
* feat(vm): add support for cpu `affinity` attribute (#1148)

It helps to pin VMs to the special cpu.

Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>

* add clarification about the format and permission requirements for `affinity`
* do not add `affinity` property to the API call if is not set

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

---------

Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-03-23 21:34:59 -04:00
Serge
9fee8c1e2e
feat(vm): add proxmox_virtual_environment_node datasource (#1151)
* feat(vm): add proxmox_virtual_environment_node datasource

It helps to get CPU model, number of cores and sockets.

Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>

* fix node_name ref
* add acceptance test

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

---------

Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-03-23 20:17:09 -04:00
Pavel Boldyrev
11ca880f28
feat(vm): add support for disconnected attribute in network interface (#1129)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-03-16 01:41:53 +00:00
Pavel Boldyrev
cea65a8a12
feat(vm): add support for protection attribute (#1126)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-03-14 22:23:02 -04:00
Pavel Boldyrev
014b59e04f
feat(vm): add support for disk aio, backup, iops* attributes (#1124)
* feat(vm): add support for disk `aio`, `backup`, `iops*` attributes

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-03-14 00:24:17 -04:00
Pavel Boldyrev
b63f1b7889
fix(provider): EOF error when closing SSH session (#1113)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-03-11 20:05:11 -04:00
Koloss5421
449f9fc31c
fix(vm): timeout when resizing a disk during clone (#1103)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Koloss5421 <koloss@Magni>
2024-03-11 19:40:25 -04:00
Pavel Boldyrev
27dbcad5cd
chore: minor cleanups and doc updates (#1108)
* Fix some obvious errors, remove dead code
* Add instructions for manually adding public key to authorized_keys file
* Add GitHub context dump step and update testacc workflow condition
---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-03-09 23:20:44 -05:00
renovate[bot]
fbd04ed950
chore(deps): update tools (#1017)
* chore(deps): update tools

| datasource | package                                                       | from    | to      |
| ---------- | ------------------------------------------------------------- | ------- | ------- |
| go         | github.com/golangci/golangci-lint                             | v1.55.2 | v1.56.2 |
| go         | go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp | v0.48.0 | v0.49.0 |

* fix linter errors

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-03-04 21:41:53 -05:00
Pavel Boldyrev
3195b3cdf4
feat(file)!: snippets upload using SSH input stream (#1085)
* feat(file)!: safer snippets upload using SSH input stream
* fixes for acceptance tests on windows
* enable other OS-es for acceptance tests
* update example templates to use api token auth

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-03-02 19:06:59 -05:00
Pavel Boldyrev
2c6d3ad01d
feat(provider): add support for private key authentication for SSH (#1076)
* feat(provider): add support for private key authentication for SSH

Also fix bunch of issues with acceptance tests

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-03-02 11:10:42 -05:00
Pavel Boldyrev
3c5276093a
fix(user): expiration_date attribute handling (#1066)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-02-27 03:06:58 +00:00
Fabian Franz
f7f67dbd3d
fix(provider): race condition in~/.ssh path existence check (#1052)
fix: ignore error if path exists

Signed-off-by: Fabian Franz <fabian.franz@sva.de>
Co-authored-by: Fabian Franz <fabian.franz@sva.de>
2024-02-22 22:24:29 -05:00
Pavel Boldyrev
b648e5bcb0
chore(vm): refactoring, add acceptance tests (#1040)
cleaning up and refactoring the VM code, add some acceptance tests around disks, few minor bugfixes

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-02-19 16:56:13 -05:00
Pavel Boldyrev
797873b257
fix(vm): multi-line description field is always marked as changed (#1030)
Also, fix acceptance tests

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-02-15 19:33:23 -05:00
Pavel Boldyrev
1f333ea097
fix(vm): error when creating custom disks on PVE with non-default shell (#983)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-01-28 17:13:43 +00:00