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

157 Commits

Author SHA1 Message Date
Pavel Boldyrev
d29fd97bab
fix(vm): Fix file_format setting for new empty disks (#259) 2023-03-13 23:45:08 -04:00
Kai Kahllund
82016fc8ff
frat(vm): Add custom CPU models support (#254)
* chore: add regex for custom cpu model validation

* update logic to use TF validators & add tests

---------

Co-authored-by: Kai Kahllund <kai.kahllund@akra.de>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-03-12 20:34:02 -04:00
Tuomas Salmi
4d447390e6
feat(lxc): Add option for nested container feature (#251)
feat: Add option for nested container feature
2023-03-08 20:26:04 -05:00
Pavel Boldyrev
fcf9810252
feat(vm): update VM disc import logic (#241)
* feat(vm): updated VM disc import logic

fixes: #187, #203

* ignore linter error
2023-02-17 16:53:06 -05:00
Pavel Boldyrev
197c9e5152
fix(vm): proxmox_virtual_environment_file.changed stored as true at file creation (#240)
This trigger "changed outside of Terraform" detection on the resource when Terraform re-applies the same plan second time.
2023-02-15 21:55:31 +00:00
Abdelfadeel Farag
1de9294766
fix(vm): ignore ssd disk flag with virtio interface (#231) 2023-02-06 19:19:44 -05:00
Pavel Boldyrev
e2802d0654
fix(vm): Fix handling of empty kvm arguments (#228)
* fix(vm): Fix false detection of a changed VM state when KVM arguments is empty

PVE returns a single space string (`" "`) when KVM arguments are not set.

* fix(vm): set KVM arguments only if non-empty
2023-02-06 04:18:47 +00:00
Cameron
19185611b3
feat(lxc): Add unprivileged option (#225)
* feat: Add unprivileged parameter for containers

* feat: make modifying the unprivileged option recreate the resource

* feat: add unprivileged to tests

* docs: Add unprivileged argument

---------

Co-authored-by: cditchfield <cditchfield@thoughtmachine.net>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-02-05 17:30:05 -05:00
Boik
346c92b273
fix(vm): Don't add an extra hostpci entry (#223)
Don't add extra hostpci entry

When I try to clone from a template with no `hostpci` in the config, the post body would contain an extra `hostpci` because of these lines (from `DefaultFunc`).
2023-02-05 13:18:53 -05:00
Pavel Boldyrev
598c62864d
feat(core): Add known hosts callback check for ssh connections (#217)
* feat(core): Add known hosts callback check for ssh connections

* fix code & add tests
2023-01-24 01:05:31 -05:00
Moyiz
5c8ae3c3f8
feat(lxc): Add support for container tags (#212) 2023-01-21 21:39:12 -05:00
kaje783
b539aab228
fix(vm): Add parser for CustomEFIDisk (#208)
* feat: add support for "args" flag for VM

* switch from args to kvmarguments, update type

* cosmetics: `kvmarguments` -> `kvm_arguments`

also update doc to match description from the official PVE documentation.

* fix(vm): Add parser for CustomEFIDisk

* use parseDiskSize(&string) from utils.go for CustomEFIDisk

* readd the remove space by github space

* address linter errors, remove duplicated code, add unit test

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-01-17 22:57:28 -05:00
Pavel Boldyrev
bf9e31ecfc
chore: lint and reformat the code (#204)
* chore: reformat code

* chore: add commitlint config

* reformat README.md

* add linter config

* lint & reformat docs

* go linter: only new issues

* fix some linting errors

* more reformatting

* disable linter warning for some duplicated code
2023-01-16 18:07:30 -05:00
Pavel Boldyrev
dd9ffe190c
feat(lxc): Add option to customize RootFS size at LXC creation (#207)
* feat(lxc): Add option to customize RootFS size at LXC creation

* force container re-create if size changes
2023-01-15 23:17:45 -05:00
kaje783
8bd3fd7b1d
feat(vm): add support for "args" flag for VM (#205)
* feat: add support for "args" flag for VM

* switch from args to kvmarguments, update type

* cosmetics: `kvmarguments` -> `kvm_arguments`

also update doc to match description from the official PVE documentation.

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-01-14 21:42:10 -05:00
Fabian Heib
496ab322be
fix(vm): Make so that on_boot can be changed with update (#199)
Make so that on_boot can be changed with update
2023-01-02 15:40:52 -05:00
Gertjan Roggemans
79a2101933
feat(vm): Add cloud-init network-config support (#197)
* feat: Add cloud-init network-config support

* add documentation entry

* fix re-apply use case

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-01-01 18:17:08 -05:00
Frank Villaro-Dixon
60a68184cf
feat(vm): OnBoot: change default to true (#191)
vm: OnBoot: change default to `true`

The `on_boot` parameter is used to start a VM when the
node reboots. As the VM infrastructure should not really care whether
an hypervisor has rebooted, we change the default value from `false` to
`true` in order to make it explicit not to start the VM on reboot.

Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>

Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
2022-12-29 14:30:32 -05:00
Pavel Boldyrev
01d20504a1
feat: Add hostpci support (#194)
* feat: Add `hostpci` support

* document `machine` argument

* fix `rombar` argument name
2022-12-28 22:14:48 -05:00
Abdelfadeel Farag
3c02cb1389
feat: add support for network_device MTU (#176)
* add support for network_device MTU

* add mtu to the example templates

* change default mtu 1500 -> 0, update docs

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2022-12-12 23:07:02 -05:00
Abdelfadeel Farag
290734655c
feat: add support for "ssd" disk flag for VM (#181)
* feat: add support for ssd flag

* update docs, add `ssd` to examples

* restore original .md formatting

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2022-12-12 22:31:33 -05:00
Pascal Wiedenbeck
0df14f9d6a
feat: add the ability to clone to non-shared storage on different nodes (#178)
* feat: add workaround for cloning to non-shared storage

* fix: fix wrong API params used

* test: add new var to tests

* fix: lint issues

* docs: add new argument to docs

* docs: fix function documentation

* fix: better work with heterogeneous datastores

* docs: clarify clone behavior

* fix: go lint issues

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2022-12-12 16:28:53 -05:00
Pavel Boldyrev
63dc5cb8f6
fix: handling datastore_id in LXC template (#180) 2022-12-10 11:51:29 -05:00
michalg91
27665554de
fix: Remove cloned ide2 before creating new one (#174) (#175)
* fix: Remove cloned ide2 before creating new one (#174)

* add test case to `/examples`

Co-authored-by: Michał Gawryś <mgawrys@netbyte.pl>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2022-12-09 22:32:43 -05:00
Pavel Boldyrev
ade1d49117
feat: add support for VM tags (#169) 2022-11-25 23:23:50 -05:00
Pavel Boldyrev
9e34dfb362
feat: Add support for custom cloud-init vendor data file (#162)
* feat: Add support for custom cloud-init vendor data file

Add new argument `initialization`.`vendor_data_file_id` to specify a file ID form snippets.

* add vendor cloud-init to examples

* add missing `vendor` to unmarshal

* remove debug lines
2022-11-17 20:33:41 -05:00
Pavel Boldyrev
0fad160ed6
fix: linter issues (#158)
* fix: remove io/ioutil

* fix: lost diagnostic context

* fix: various linter errors

* fix: json manifests
2022-10-24 19:40:57 -04:00
Pavel Boldyrev
7145061bb3
chore: use automatic versioning in Makefile
Closes: #132
2022-10-16 21:40:19 -04:00
Pavel Boldyrev
b09389f0a9
fix: Non-default VM disk format is not preserved in TF state (#134)
Fix disk format parsing from the volume string.
Add basic unit tests for disk volume string parsing.
2022-10-14 18:27:30 -04:00
Pavel Boldyrev
42e0e725a5
Add support for "discard" disk option for VM (#128) 2022-09-28 19:13:41 -04:00
Oto Petřík
3392d8e5c0
Provide correct outputs from stopped VM (#106)
Outputs 'ipv4_addresses', 'ipv6_addresses', 'network_interface_names' of
stopped VM are empty and break plans - e.g. search for "eth0" in empty list.
On update, mark them 'Computed' if there is planned change in 'started'
or 'network_device' of the VM.

This makes it possible to depend on e.g. 'network_interface_names' of VM
which is not running at the time of 'terraform plan', but which will be
started during 'terraform apply'.
2022-07-29 22:15:13 -04:00
Pavel Boldyrev
442b60c8f9
Fix storing of "disk.iothread" in TF state
Add missing doc entry

Relates to #87
2022-07-29 21:54:58 -04:00
Oto Petřík
752f2ea565
Avoid reboot when resizing disks. (#104)
There is no need to shutdown VM before resizing disks.
In addition to boot time, system in VM can be configured to resize
partitions and filesystems in response to udev events.

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2022-07-29 20:22:40 -04:00
Prajwal Borkar
e14c417f0f
Fixed Typo (#107)
Fixed Typo
2022-07-29 18:25:12 -04:00
Pavel Boldyrev
e9d2d607c1
Add support for "iothread" disk option for VM (#97) 2022-07-24 16:53:57 -04:00
Pavel Boldyrev
37fe0e03ff
Fix disk import when VM template has multiple disks (#96)
The disk import operation is not exposed via Proxmox APIs, so implemented as a sequence of commands run as an inline script via ssh.
`qm importdisk` is used to import a disk into VM from an external file, however, it auto-generates the disk ID.
The following command `qm set` is used to assign the imported disk to a VM, and it requires the disk ID as a parameter.

Update the import logic to read the disk ID from the output of `qm importdisk` command rather than trying to assume it from a number of disks defined in the VM.
2022-07-22 19:03:39 -04:00
Pavel Boldyrev
192cbd5e3d
Upgrade the provider codebase to use Terraform SDK v2 (#91)
* Update TF SDK using `tf-sdk-migrator v2upgrade`
Address some linter issues
Clean up `resource_virtual_environment_file.go` (still, error handling is not ideal)

* few minor cleanups

* Clean up, add context and diagnostics to `resource_virtual_environment_vm.go`

* Clean up, add context and diagnostics to `resource_virtual_environment_container.go`

* Clean up, add context and diagnostics to `resource_virtual_environment_container.go`

* Update remaining resources and data sources

* fix `make example`... now it actually uses the built provider 🤦

* propagate Context everywhere
use tflog.* for logging

* add support for debug flag

* fix old issues with:
- setting `resource_virtual_environment_file.changed` attribute
- setting `resource_virtual_environment_cluster_ipset.cidr` attributes
- setting `data_source_virtual_environment_user.groups` and `.keys` attributes

* bump dependencies

* minor cleanups

* Bump Go to v1.18
Dropped support for TF v0.x

* more cleanups

* update README.md

* update PR template

* update release.yml
2022-07-14 12:20:30 -04:00
Pavel Boldyrev
0fa4a54903
Bump provider version to 0.5.1 (#52)
* Bump provider version to 0.5.1

Also fixes #44

* Bump TF version for tests
2022-03-21 20:46:25 -04:00
Pavel Boldyrev
6ff9e3a48a
set TF version 0.4.6 2021-09-09 20:42:30 -04:00
Pavel Boldyrev
380f07c3e2
Update project to use bpg/terraform-provider-proxmox 2021-09-09 12:20:19 -04:00
Pavel Boldyrev
45fcc4d316
bump version to 0.4.5 2021-09-08 18:34:47 -04:00
Dan Petersen
d4f59f184d feat: bump versioN 2021-02-18 22:26:43 +01:00
Dan Petersen
846b298dec feat: bump version 2021-02-17 04:36:41 +01:00
Dan Petersen
0102fb1fe3 fix: ip initialization issue for cloned containers 2021-02-14 03:43:12 +01:00
Dan Petersen
5871fff200 fix: disk resizing issue 2021-02-13 08:21:37 +01:00
Dan Petersen
781d83535b fix: state diff issue 2021-02-13 07:18:29 +01:00
Dan Petersen
fec2a7c9e1 fix: bump version 2021-02-13 03:22:29 +01:00
Dan Petersen
612ad45a30 Update docs 2021-02-10 05:05:26 +01:00
mleone87
0b68e058cf Fix a typo and make disk import coherent with disk interface
Fix a small typo in resourceVirtualEnvironmentVMCreateCustom function and make the provider capable to import disk with the correct interface
2021-01-20 17:24:31 +01:00
Lucas Hahn
8ae3b2c0e3 Parameterize all timeouts 2021-01-08 14:29:08 +01:00