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

247 Commits

Author SHA1 Message Date
Pavel Boldyrev
2a56c23f52
fix(file): handle missing file on state refresh (#649)
* fix(file): handle missing file on state refresh

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-10-24 22:22:13 -04:00
Pavel Boldyrev
a30f96c348
feat(vm): add configurable timeout for VM create operation (#648)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-10-24 22:13:15 -04:00
Pavel Boldyrev
1056180ca5
chore: fix linter error (#645)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-10-23 22:41:26 +00:00
Oto Petřík
d1d7bd39c7
fix(vm): set FileVolume for disks with file_id (#635)
Disks imported using `file_id` argument do not have FileVolume set,
that makes PathInDatastore return an empty string, which makes
IsOwnedBy return fales for any vm id.

The end result is the inability to resize imported disks,
this fixes it.

Signed-off-by: Oto Petřík <oto.petrik@gmail.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-10-22 15:15:44 +00:00
Oto Petřík
aeb5e88bc9
feat(vm): add 'path_in_datastore' disk argument (#606)
* feat(vm): add 'path_in_datastore' disk argument

Provide access to actual in-datastore path to disk image,
and experimental support for attaching other VM's disks or host devices.

Signed-off-by: Oto Petřík <oto.petrik@gmail.com>

* chore: added to `/example` for acceptance testing

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

---------

Signed-off-by: Oto Petřík <oto.petrik@gmail.com>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-10-11 22:13:09 -04:00
Pavel Boldyrev
d5994a2bd5
fix(lxc): cloned container does not start by default (#615)
* fix(lxc): cloned container does not start by default

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-10-10 01:20:01 +00:00
Pavel Boldyrev
be5251dd5a
feat(vm): add option to enable multiqueue in network devices (#614)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-10-09 16:01:24 +00:00
Pavel Boldyrev
088ad09e35
fix(lxc): multi-line description always shows as changed (#611)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-10-08 21:14:04 -04:00
Pavel Boldyrev
32bdc94167
fix(lxc): create container when authenticated with API token (#610)
And also fix container startup behaviour: "error starting container ... - already running"

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-10-08 20:35:34 -04:00
Oto Petřík
06ad00463c
feat(provider): configure temp directory (#607)
* feat(provider): configure temp directory

Resource 'proxmox_virtual_environment_file' often requires lot of disk
space in /tmp, which can be space-limited.

Instead of requiring to set TMPDIR environment variable before running
terraform, make it a provider configuration option.

Signed-off-by: Oto Petřík <oto.petrik@gmail.com>

* fix: lint error, align names in the `client` struct

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

---------

Signed-off-by: Oto Petřík <oto.petrik@gmail.com>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-10-07 21:00:34 -04:00
Simon Caron
d36cf4eab8
feat(lxc): add support for the start_on_boot option (#605)
* feat(lxc): add support for the `start_on_boot` option

Signed-off-by: Simon Caron <simon.caron.8@gmail.com>

* Move code next to started blocks + update default value

Signed-off-by: Simon Caron <simon.caron.8@gmail.com>

---------

Signed-off-by: Simon Caron <simon.caron.8@gmail.com>
Co-authored-by: Simon Caron <simon.caron.8@gmail.com>
2023-10-07 20:08:09 -04:00
Pavel Boldyrev
0b8f2e2c6f
fet(vm): allow scsi and sata interfaces for CloudInit Drive (#598)
* fet(vm): allow `scsi` and `sata` interfaces for CloudInit Drive

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-10-01 22:23:11 -04:00
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