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

116 Commits

Author SHA1 Message Date
Oto Petřík
20131b0ffc
fix(vm): Regression: wait for 'net.IsGlobalUnicast' IP address (#100) (#345)
fix: Wait for 'net.IsGlobalUnicast' IP address, again (#100)

VM can get IPv6 link-local address faster than a DHCP server response,
that results in 'ipv4_addresses' output being an empty list.
It is then impossible to provision the VM using 'connection.host' field
derived from 'self.ipv4_addresses'.

Once again change waiting for IP address to wait for better address than
IPv4 link-local addresses and IPv6 link-local addresses.

Should not break #182, because it requires only one GlobalUnicast address per VM.
2023-05-22 22:12:06 -04:00
zoop
9fa92423b5
feat: SSH-Agent Support (#306)
* chore: add agent configuration bool

* feat: add ssh-agent authentication mechanism for linux

* chore: make sure ssh-agent auth is only executed on linux

* chore: add ssh user override

* chore: add ssh configuration block, check ssh config during VirtualEnvironmentClient creation

* fix: handle case of empty ssh config block

* chore: add ssh password auth fallback logic

* fix: remove not needed runtime

* fix linter errors & re-format

* allow ssh agent on all POSIX systems

* add `agent_socket` parameter

* update docs and examples

---------

Co-authored-by: zoop <zoop@zoop.li>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-05-22 13:34:24 -04:00
Pavel Boldyrev
79e5a8ebb0
fix(vm): Regression: cannot create disks larger than 99G (#335) 2023-05-13 22:13:57 -04:00
Jordan Keith
4be9914757
feat(vm,lxc): Improved support for different disk size units (#326) 2023-05-10 07:46:16 -04:00
Pavel Boldyrev
7c9505d11f
fix(file): SSH file upload on Windows (#308)
* fix(file): SSH file upload on Windows

* update bug report template
2023-04-20 02:14:48 +00:00
Pavel Boldyrev
8addb1d1d5
feat(vm): Wait for the VM creation task to complete (#305)
feat(vm): Add sync wait in VM create operation
2023-04-17 21:30:08 -04:00
Pavel Boldyrev
be3995e969
fix(core): Error when open SSH session on Windows (#293)
* fix(core): Error when open SSH session on Windows

* update PR template
2023-04-07 22:38:07 -04:00
Pavel Boldyrev
401b39782f
fix(file): "Permission denied" error when creating a file by a non-root user (#291)
* fix(file): "Permission denied" error when creating a file by a non-root user

* fix linter errors
2023-04-07 21:58:37 -04:00
Henri Williams
f9e263ad5e
feat(vm): add support for boot_order argument for VM (#219)
* feat(vm): add support for 'boot_order and boot_disk flags for VM

* refactoring (1)

* refactor to use only boot_order argument

---------

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-04-07 15:35:38 -04:00
Pavel Boldyrev
98e1cff7fe
feat: Add firewall resources (#246)
* refactoring existing cluster / firewall API for better composition

* add basic security groups API
fix linter errors

* add rules API

* fix after renaming resourceVirtualEnvironmentClusterIPSet

* fix linter errors

* make linter happy

* even more refactoring

* tidy up datasources

* in refactoring spree

* update examples

* fix firewall resource/datasource & client error handling

* add ipset(s) datasource

* update docs

* add security group resource with rules

* docs

* fix security group update, TODO: rule update

* fix after rebase

* add rule update, extract common rule schema, refactor group

* fix linter  errors

* bump linter for ci

* make alias and ipset reusable

* make security group reusable

* refactor datasources

* add security group datasources

* fix linter errors

* update docs

TODO: documentation for group datasources

* add sg docs, update doc index

* minor cleanup

* fix examples & tests

* stub for firewall-level options and rules

* extract firewall interface

* add firewall options and rules on the cluster level

TODO: issues with rule list management

* refactor all resources format AGAIN, now more flat, without complex subresources

* sort out hierarchy of APIs and remove duplication in API wrappers

* bring back security group

* finally, working rules

* restore cluster firewall option

* add containers support

* add options

* move rules back under security group, update docs

* fix vm_id / container_id attrs

* add examples

* cleanup

* more cleanup


Release-As: 0.17.0-rc1
2023-04-02 18:01:10 -04:00
Pavel Boldyrev
c2d3f46474
feat(vm): Add bare minimum VM datasource (#268)
* feat(vm): Add a bare minimum VM datasource

* fix linter errors

* fix doc

* add lookup across all nodes in the cluster, add filter by tags

* stable vm list

* fix linter errors

* pr feedback: switch to dynamic id for vms

* add datasource examples

* add unit tests

* Update virtual_environment_vms.md
2023-03-22 01:52:58 +00:00
Pavel Boldyrev
763527e535
fix: additional logging in API client (#267) 2023-03-19 01:15:19 +00:00
Pavel Boldyrev
d29fd97bab
fix(vm): Fix file_format setting for new empty disks (#259) 2023-03-13 23:45:08 -04: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
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
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
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
Pavel Boldyrev
13080b44dc
feat: Deletion of VM also purges all storages and configs (#196) 2022-12-28 23:13:29 -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
Szczepan Wiśniowski
722e01053b
fix: Check if any interface has global unicast address instead of all interfaces (#182)
* fix: Check if any interface has global unicast address instead of all interfaces

This allows us to have multiple interfaces and only one (instead of all) has to have assigned ip

* add multiple network devices to the example VM

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2022-12-11 16:29:25 -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
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
029dc1fb0a
Wait for 'net.IsGlobalUnicast' IP address (#115)
VM can get IPv6 link-local address faster than a DHCP server response,
that results in 'ipv4_addresses' output being an empty list.
It is then impossible to provision the VM using 'connection.host' field
derived from 'self.ipv4_addresses'.

Change the waiting for IP address to ignore IPv4 link-local addresses
and IPv6 link-local addresses.
2022-08-14 21:23:41 -04:00
Pavel Boldyrev
e9d2d607c1
Add support for "iothread" disk option for VM (#97) 2022-07-24 16:53:57 -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
Matt Burchett
065e859227
virtual_environment_datastores.go: Update remote command to get datasource path (#49)
This commit fixes the shell command that is being executed to get the datasource
path which appears to be no longer functional.

The previous command assumed that "path" is going to be the next line after the
datasource name, leaving NFS mounts and other types of mount points non-functional.
2022-03-21 20:26:39 -04:00
Pavel Boldyrev
81355e0e9e
Fix JSON unmarshal error when deploying LCX container
This closes #15
2021-09-09 14:29:56 -04:00
Pavel Boldyrev
f744b2391b
Merge pull request #3 from bpg/fix-vm-clone
Fix SIGSEGV if cloned VM is in a different storage.
2021-09-08 18:36:11 -04:00
Pavel Boldyrev
124cbc37c7
Update VirtualEnvironmentVMGetStatusResponseData.PID and VirtualEnvironmentVMGetStatusResponseData.VMID to int type 2021-09-08 18:34:13 -04:00
Pavel Boldyrev
0742ac5091
Fix SIGSEGV if cloned VM is in a different storage.
closes #1
2021-09-08 18:27:36 -04:00
Pavel Boldyrev
90cda091a9
fix make test error
`make test` was failing with
```
# github.com/danitso/terraform-provider-proxmox/proxmox
proxmox/virtual_environment_vm_types.go:1148:3: Sprintf format %s has arg r.Model of wrong type *string
make: *** [Makefile:82: test] Error 2
```
2021-09-07 18:46:02 -04:00
Chris W Jones
2cbaa057eb
Fixes bug with id type 2021-07-16 15:48:08 -04:00
Dan Petersen
8d711a7853 fix: watchdog deserialization issue 2021-02-18 22:36:08 +01:00
Dan Petersen
781d83535b fix: state diff issue 2021-02-13 07:18:29 +01:00
Lucas Hahn
8ae3b2c0e3 Parameterize all timeouts 2021-01-08 14:29:08 +01:00
Dan Petersen
3f08b56f79 Merge remote-tracking branch 'blz-ea/feature/cluster-alias' into release-0.4.0 2021-01-02 22:36:44 +01:00
Dan Petersen
9d2676e730 Merge remote-tracking branch 'blz-ea/feature/cluster-ipset' into release-0.4.0 2021-01-02 22:35:07 +01:00
Lucas Hahn
3956a31494 Add multidisk support 2021-01-02 14:21:55 +01:00
Lucas Hahn
8acafc0bb7 Fix Errors
- Fix required disk interface parameter
 - Fix datastore move to same datastore error
 - Fix compare sizes for resize disk
2021-01-02 14:21:20 +01:00
Lucas Hahn
328acd80df set retries to default 1 and add guard 2021-01-02 14:18:45 +01:00
Lucas Hahn
1798bade56 added support to reboot vm after creation or clone 2021-01-02 14:20:52 +01:00
Dan Petersen
7642a319ce Support for moving and resizing disks
- Utilize asynchronous Functions for proxmox
2021-01-02 14:18:45 +01:00