0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-07-01 19:12:59 +00:00
Commit Graph

235 Commits

Author SHA1 Message Date
Pavel Boldyrev
fa590ed9e9
misc: fix tls min version typo (#597)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-10-01 18:27:45 +00:00
Pavel Boldyrev
16ebf30a79
fix(api): set min TLS version 1.3, secure HTTP-only cookie (#596)
* fix(api): set min TLS version 1.3, secure HTTP-only cookie
* remove `all-tests-passed` job

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-10-01 14:19:51 -04:00
Pavel Boldyrev
5e24a75d09
feat(file): add optional overwrite flag to the file resource (#593)
* chore: add file test

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

* add file updated test, file_name / ID is getting changed :/

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

* more tests, refactor file's read, more consistency in the attributes
TODO: need to check backward compatibility

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

* fix error message, enable import test

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

* more tests

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

* more tests for owerwrite, update docs

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

* fix tests on CI

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

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-09-28 22:07:04 -04:00
Pavel Boldyrev
7d064a8b27
chore(code): re-organize and cleanup "fwk provider"'s code (#568)
* chore(code): code cleanup / renaming

* chore(code): flatten and rename fw provider package

* chore(code): refactor & update network tests
2023-09-17 22:50:24 +00:00
Pavel Boldyrev
2dee65bd0b
chore(code): remove redundant types2 import aliases (#564) 2023-09-13 03:03:43 +00:00
Pavel Boldyrev
7ace07dfa4
feat(file): FORMAT CHANGE: update import id, so it matches the resource's format: <node_name>/<datastore_id>:<content_type>/<file> (#543)
* feat(file): FORMAT CHANGE: update **import id**, so it matches the resource's format: `<node_name>/<datastore_id>:<content_type>/<file>`

* better example
2023-09-04 20:29:58 +00:00
Emmanuel Benoît
0233053dd8
fix(vm): explicitly allow "" as a value for CloudInit interfaces (#546)
The CloudInit interface can be left empty in order to allow
autodetection of the drive being used. However, it would seem that this
value was causing problems (see #539).

This commit adds an additional validator for CloudInit interfaces which
allows the `""` value.
2023-09-04 16:11:14 -04:00
Rafał Safin
13326bbd33
fix(provider): panic crash in provider, interface conversion error (#545)
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-09-04 19:02:23 +00:00
Simon Caron
8ce9006eed
feat(lxc): add support for keyctl and fuse features (#537) 2023-09-04 10:44:49 -04:00
Pavel Boldyrev
5ecf135398
chore(code): fix proxmox package dependencies (#536)
move `types` back from `internal` to `proxmox` and adjust a few other types, to make sure `proxmox` package is not dependent on anything else, and therefore can be extracted to a separate repo (#423)
2023-09-03 00:40:47 +00:00
Rafał Safin
124cac247c
feat(provider): add optional SSH port param to node in provider ssh block (#520)
* feat: Add optional SSH port param to node in provider ssh block

* fix: minor cleanups

---------

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-09-02 19:43:08 -04:00
Pavel Boldyrev
11d82614e6
fix(file): forced replacement of file resources that missing timeout_upload attribute (#528) 2023-08-31 00:26:01 +00:00
Risto Oikarinen
b1ac87df1d
fix(vm): fix PCI device resource mapping changed (#517) 2023-08-22 08:16:28 -04:00
Emmanuel Benoît
148a9e0c9c
fix(vm): fixed startup / shutdown behaviour on HA clusters (#508)
* fix(vm): wait for VMs to actually stop when sending a shutdown command

Due to how a Proxmox cluster reacts to a VM shutdown command when
running in HA mode, the VM might still be running when the shutdown API
calls returns. This commit adds a loop that actively waits for the VM's
status to change to "stopped" (while also accounting for the shutdown
timeout) after the call's return.

* chore(refactoring): extracted VM state change wait loop into a separate function

* fix(vm): wait for VMs to actually start after requesting it from the cluster

This commit forces the plugin to wait for a VM to actually run after
requesting it to be started. This avoids problems with Proxmox's High
Availability mode, where a start request may not be immediately honoured
by the cluster.

* fix: linter errors

* fix: use `vmAPI.WaitForVMState`

---------

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-08-20 20:07:37 -04:00
Emmanuel Benoît
73c1294979
fix(vm): fix CloudInit datastore change support (#509)
The datastore update support introduced in #486 only worked if the
CloudInit interface was also changed at the same time. This commit
fixes the problem.

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-08-20 19:53:10 -04:00
Michael Iseli
a038fd3142
feat(vm): fix adding/removing hostpci devices forcing vm recreation (#504)
* feat(vm): fix adding/removing hostpci devices forcing vm recreation

* fix: hostpci device removal

* fix: hostpci jason unmarshalling but introduced in #500

---------

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-08-20 19:01:19 -04:00
Risto Oikarinen
26970541c4
feat(vm): support PCI device resource mapping (#500)
* feat(vm): support PCI device resource mapping

* fix: linter error

* fix: minor cleanup

---------

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-08-20 18:00:11 -04:00
Emmanuel Benoît
a2853606ad
feat(vm): support for migration when the node name is modified (#501)
* feat(vm): support for migration when the node name is modified

  * Added a `migrate` VM flag which changes the provider's behaviour
    when the VM's `node_name` is updated. If `true`, the VM will be
    migrated to the specified node instead of being re-created.

  * Added a `timeout_migrate` setting to control the timeout for VM
    migration.

  * Fixed a bug in the API's migration data structure that prevented
    the online migration flag to be set.

* fix: update description

---------

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-08-18 22:02:50 -04:00
Emmanuel Benoît
e6c15eccc6
feat(vm): pool update support (#505)
* feat(vm): pool update support

This commit removed the ForceNew flag from the VM resource's `pool_id`
argument and implements pool update:

  * if the VM was part of a pool, it is removed from it,
  * if the new `pool_id` value is non-empty, the VM is added to that new
    pool.

* fix: use `types.CustomCommaSeparatedList` in `PoolUpdateRequestBody` datatype, minor error fix

---------

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-08-18 21:48:37 -04:00
Emmanuel Benoît
1896ea08f0
chore(vm): fix linter errors (#506)
fix: linter error in ambush

  * This commit fixes a linter error that somehow doesn't manifest
    unless some other, unrelated changes trigger it (see #501 and
    #505).

  * In addition it fixes a similar issue that had so far gone undetected
    by the linter.

  * Refactored the code in question into a function, since it was mostly
    duplicated.

  * Simplified a pair of conditionals that had the same code in both
    branches.
2023-08-18 21:07:09 -04:00
Emmanuel Benoît
547593661f
feat(vm): support for non-default CloudInit interface and CloudInit storage change (#486) 2023-08-13 09:55:38 -04:00
Pavel Boldyrev
2cf64b88c3
fix(vm): ensure startup / shutdown delay is applied when order is not configured (#479) 2023-08-10 16:21:41 -04:00
Pavel Boldyrev
8d0b3ed25f
fix(vm): default disk cache is not set to none if not specified for an existing disk (#478)
Also fixes missing `ForceNew` for `file` resources.
2023-08-10 19:27:22 +00:00
dandaolrian
f901e711dd
feat(file): ensure upload of ISO/VSTMPL is completed upon resource creation (#471)
* feat(provider): ensure upload of ISO/VSTMPL completes before starting VM and add timeout to config for this

* remove `ForceNew: true` for the timeout attribute

* minor docs update

---------

Co-authored-by: dandaolrian <dandaolrian@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-08-10 11:01:14 -04:00
Pavel Boldyrev
85ff60d4bd
feat(vm): add support for SMBIOS settings (#454)
* feat(vm): add support for SMBIOS settings

* fix linter errors

* fix smbios error at clone
2023-08-06 00:31:17 +00:00
Pavel Boldyrev
5a3b1ccaf7
fix(user): make password attribute optional (#463) 2023-08-05 22:57:08 +00:00
Boik
0d3227a890
fix(vm): give cache the correct default value (#450) 2023-08-02 08:18:55 -04:00
Pavel Boldyrev
c1e7cea21e
fix(vm): cloned VM with efi_disk got re-created at re-apply (#447)
Also fixes for startup order (not released yet).
2023-07-30 18:41:41 +00:00
Pavel Boldyrev
b045746a94
feat(vm): add support for start/shutdown order configuration (#445) 2023-07-29 22:55:12 -04:00
Pavel Boldyrev
cfe3d96576
feat(vm): add support for disk cache option (#443) 2023-07-29 13:29:14 -04:00
Pavel Boldyrev
a9a7329d9f
feat(core): migrate version datasource to TF plugin framework (#440)
* feat: migrate `version` datasource to tf framework

* set up documentation generator

* add generated docs for network resources

* fix test mux server, add import examples to network resources

* fix network tests

* fix shell examples
2023-07-29 02:10:02 +00:00
Pavel Boldyrev
b2a27f3ccf
chore: cleanup resource validators & utility code (#438)
* chore: cleanup resource validators & utility code

* fix linter errors
2023-07-20 19:58:19 -04:00
Boik
6781c03ca1
fix(vm): Don't add an extra efi_disk entry (#435)
* fix(vm): Don't add an extra efi_disk entry

* fix(vm): Don't add an extra efi_disk entry

---------

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-07-20 23:00:10 +00:00
Boik
aea9846c6f
fix(vm): fix for the api call upon empty disks (#436) 2023-07-18 22:03:53 -04:00
Leah
beef9b1219
feat(lxc): add support for lxc mount points (#394)
* feat(lxc): add support for lxc mount points

* update docs and examples

* improve error handling for container creation / start operations, fix size propagation for storage mounts

---------

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-07-16 20:41:07 -04:00
Pavel Boldyrev
0281bc83e2
fix(vm): do not reboot VM on config change if it is not running (#430) 2023-07-16 18:12:17 +00:00
Pavel Boldyrev
b86fa239dd
fix(vm): add interface argument to cdrom block (#429)
* fix(vm): add `interface` argument to `cdrom` block

* doc formatting
2023-07-16 16:55:49 +00:00
Pavel Boldyrev
6a3bc03470
fix(firewall): add VM / container ID validation to firewall rules (#424) 2023-07-12 22:21:42 +01:00
Pavel Boldyrev
fc3bbc3d92
fix(firewall): ignore non-existent rules at read/delete (#415) 2023-07-08 22:07:07 -04:00
Leah
e9a9fd76da
feat: add more valid cpu types (#411)
* add more valid cpu types

(cherry picked from commit c62e76707b897912628adc7dda0871b3146c7aa8)

* add docs

---------

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-07-05 01:41:10 +00:00
Leah
4147ff6a29
feat: add import support for a lot of resources (#390)
* add import support for a lot of resources

* fix lints

* set user_id after importing

(cherry picked from commit c3d09ed00f6e1d7b0bb3ab01a1fc5c81510aa2e1)

* add tests, fix empty ID

* add import docs

* fix lint
2023-07-04 21:37:14 -04:00
Pavel Boldyrev
feac6b0128
chore(refactoring): remove accidentally added types2 import alias (#409) 2023-07-03 22:10:20 +00:00
Pavel Boldyrev
253a59ece6
fix(vm): do not error on read at state refresh if VM is missing (#398) 2023-07-03 00:48:38 +00:00
Pavel Boldyrev
d748a7de7b
fix(provider): fix config environment variables handling caused "rpc error" (#397)
fix(provider): fix config environment variables handling causing "rpc error"
2023-07-03 00:45:06 +00:00
michalg91
99fda9cbcd
fix: search for vm in cluster resources before calling node api (#393)
* (fix) search for vm in cluster resources before calling node api

* (lint) search for vm in cluster resources before calling node api

* cleanup redundant error checks

---------

Co-authored-by: michalg91 <michal.gawrys@g2a.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-07-01 10:45:40 -04:00
Oto Petřík
03eaf72767
fix(provider): Better handling of root@pam token (#386)
Token logins using root@pam!sometoken=uuid are not considered
by PVE as 'root' logins, and fail to change VM's arch.
Make sure the provider does not try to set/change VM's arch.

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-07-01 13:31:02 +00:00
Pavel Boldyrev
4da2b682de
fix(file): spurious unsupported content type warning (#395) 2023-07-01 12:52:42 +00:00
Leah
e9a74e9037
feat(vm): efi disk, cpu numa (#384)
* efi disks support

* make size a string

* add cpu numa support

* add docs

* fix description

* string size fixes

(cherry picked from commit 254724d1d10c5191d294f0377adac49ad41dc880)

* fix lints

* fix(vm): replace `size` with `type` for efi disk

also
- add support for `pre-enrolled-keys`
- add example
- fix handling of `numa` flag when it's not in the template
- cleanup linter errors

---------

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-07-01 08:50:21 -04:00
Oto Petřík
23a519475d
fix(lxc): add support for 'nixos' (#387) 2023-06-27 21:46:35 -04:00
Pavel Boldyrev
4e1ce30619
fix(file): add check for supported content types when uploading file to a storage (#379) 2023-06-24 01:38:24 -04:00