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

326 Commits

Author SHA1 Message Date
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
Pavel Boldyrev
7aa25b8d05
feat(vm): add support for meta-data in cloud-init (#378) 2023-06-24 00:06:05 -04:00
Pavel Boldyrev
343e8045c1
feat(vm): add network device resources (#376)
* wip

* experimenting with terraform plugin framework

* cleaning up poc and adding tests

* adding read / update / delete

* update bridge_vlan_aware and MTU

* add ipv6 and simplify IP support

* fix provider's schema

* add docs

* run linter from cmdline

* disable TF acceptance tests

* add VLAN

* update docs

* add examole

* cleanup
2023-06-23 22:47:25 +00:00
Oto Petřík
2a5abb10fc
fix(vm): Make vm_id computed (#367)
* fix(vm): Make vm_id computed, fix #364

Defaulting vm_id to -1 prevents resources depending on vm_id value.
Make vm_id computed, also update existing vm_id = -1 with correct vm_id.

* update examples to use auto-generated `vm_id`s

---------

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-06-07 19:40:39 -04:00
Oto Petřík
926382c155
fix(core): Do not limit cluster size to 1 in provider's ssh config (#369)
fix(code): Do not limit cluster size to 1

Allow using repeated 'node' blocks in ssh configuration.

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-06-07 23:06:10 +00:00
Pavel Boldyrev
de3935d462
fix(vm): fix incorrect disk interface ref when reading VM info from PVE (#365)
Fix a minor bug in `vmGetDiskDeviceObjects(...)` that was discovered during investigation of #360.
2023-06-06 11:45:03 +00:00
Pavel Boldyrev
8c1f246b5a
fix(firewall): Improve firewall resources argument validation (#359)
Make sure VM / Container rules, SGs, IPSets are always include `node_name` along with `vm_id`, `container_id`.
2023-06-02 06:38:27 -04:00
Pavel Boldyrev
80c94a5126
feat(v): Add ability to override node IP used for SSH connection (#355)
* feat(v): Add ability to override node IP used for SSH connection

* add documentation
2023-05-31 21:15:48 -04:00
Oto Petřík
e15c4a6784
fix(vm): Make mac_address computed, fix #339 (#354)
Fields `network_interface_names`, `ipv4_addresses` and `ipv6_addresses`
are sometimes be marked `computed` again, using `CustomizeDiff`.
Changes in `VMStarted` or `VMNetworkDevice` attributes invalidate
those values. Marking fields `computed` again avoids stale values.

`network_device` configuration block without `mac_address` results
in MAC address set to its default value (an empty string).
Terraform state expects `mac_address` to be an empty string, server
provides the actual (random) MAC address of the network device.
Terraform detects there are changes to be made, but because of
`DiffSuppressFunc` on `mac_address` they are hidden from the user,
but not from d.HasChange(mkResourceVirtualEnvironmentVMNetworkDevice)

By making `mac_address` also `computed`, the server-generated MAC
address is stored locally, avoiding spurious changes that trigger
re-computation of `network_interface_names`, `ipv4_addresses` and
`ipv6_addresses`.
2023-05-31 21:12:27 -04:00
Pavel Boldyrev
ab54aa1092
feat(core): Add API Token authentication (#350)
* feat(core): Add API Token authentication

* fix linter errrors

* update docs
2023-05-29 21:56:21 -04:00
Pavel Boldyrev
1f006aa82b
feat: API client cleanup and refactoring (#323)
* cleanup 1

* continue refactoring

* more refactoring

* move VMs under nodes

* move container and other apis under nodes

* cleanups

* enabled revive.exported linter & add comments to exported stuff

* enable godot linter

* enable wsl linter

* enable thelper linter

* enable govet linter

* cleanup after rebase

* cleanup after rebase

* extract SSH ops into a separate interface

* fix linter error

* move ssh code to its own package

* cleaning up VirtualEnvironmentClient receivers

* on the finish line

* not sure what else I forgot... 🤔

* fix ssh connection and upload

* renaming client interfaces

* final cleanups
2023-05-26 01:32:51 +00: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
8359c03aa8
fix(vm,lxc): Add validation for non-empty tags (#330) 2023-05-11 02:06:15 +00: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
f0b88e336c
fix(vm,lxc): Tags reordering on plan re-apply (#322) 2023-05-05 00:19:20 +00:00
Remko Molier
97ca22abbb
fix(vm): Fix IPv6 handling (#319)
* fix: Fix IPv6 handling in resource "virtual_environment_vm"

* also use "*IPv6Address" keys

---------

Co-authored-by: Remko Molier <remko.molier@kuehne-nagel.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-05-03 20:36:10 -04:00
Fabian Heib
496bda4edc
fix(firewall): use correct default value for firewall (#312) 2023-04-23 15:26:25 -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
f4783f8cda
fix(firewall): Add support for firewall flag for LXC/VM net adapters (#295) 2023-04-09 23:59:40 +00: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
2fa922930f
chore: cleanup and fix linter errors (#290) 2023-04-05 00:04:12 +00:00
Szczepan Wiśniowski
ed3dfeae99
fix(provider): Deprecate virtual_environment block (#288)
refactor(provider): Allow specifying attributes outside of virtual_environment block

Also deprecate virtual_environment block, update docs and examples.

Fixes #117
Apparently CDKTF skips schemas without attributes, it has been fixed but it is available only in prerelease currently (https://github.com/hashicorp/terraform-cdk/pull/2736)

Release-As: 0.17.0
2023-04-04 19:55:48 -04:00
Pavel Boldyrev
1bfc29e2cc
fix(firewall): fw controls bugfixes (#287)
fix(firewall): fw controls bugfixes

- fix alias examples in docs
- docs & examples improvements
- add support for security group insertion

Release-As: 0.17.0-rc2
2023-04-04 00:42:35 +00: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
Szczepan Wiśniowski
f0f31eee47
feat(vm): Add scsi_hardware field (#282) 2023-04-02 15:10:29 -04:00
Pavel Boldyrev
17dca987eb
fix(vm): Prevent file_format override with default qcow2 in TF state (#275)
* fix(vm): Fix for `raw` file format for new empty disks

* make file_format computed

* apply default file_format for disc cloning as well
2023-03-25 10:18:42 -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
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
Lucas Hahn
b978955641 Use correct ide devices for cloud init 2021-01-04 14:36:03 +01:00
Dan Petersen
0fd8d3dae7 fix: missing reference to standalone terraform plugin and duplicate output names in example 2021-01-02 22:48:42 +01:00
Dan Petersen
550ab62a7a Merge remote-tracking branch 'patsissons/fix-cdrom-index-out-of-range-error' into release-0.4.0 2021-01-02 22:42:08 +01:00
Dan Petersen
4911843287 Merge remote-tracking branch 'patsissons/add-citype-support' into release-0.4.0 2021-01-02 22:41:03 +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
Dan Petersen
b02238a001 Merge remote-tracking branch 'ryan4yin/migrate-terraform-sdk' into release-0.4.0 2021-01-02 22:31:39 +01:00
Dan Petersen
f64f51b72c Merge remote-tracking branch 'patsissons/fix-started-state-diff' into release-0.4.0 2021-01-02 22:26:51 +01:00
Dan Petersen
f09e008683 Merge remote-tracking branch 'patsissons/fix-initialization-state-diff' into release-0.4.0 2021-01-02 22:25:39 +01:00
Dan Petersen
6a031e1672 Merge remote-tracking branch 'blz-ea/fix-vm-pool-id-name' into release-0.4.0 2021-01-02 22:23:54 +01:00
Lucas Hahn
3956a31494 Add multidisk support 2021-01-02 14:21:55 +01:00
Lucas Hahn
7883dfdb7e introduce onBoot parameter 2021-01-02 14:18:45 +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
6a08bb7329 Make disk interface a required attribute 2021-01-02 14:18:45 +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
Lucas Hahn
51a71b44e3 added check for update disks 2021-01-02 14:18:45 +01:00
Dan Petersen
7642a319ce Support for moving and resizing disks
- Utilize asynchronous Functions for proxmox
2021-01-02 14:18:45 +01:00
Alex Kulikovskikh
51e8f9b621 Fix vm resource 2020-12-17 09:50:42 -05:00
Alex Kulikovskikh
30560ac133 fix: rename ipset block to cidr 2020-12-14 21:07:07 -05:00
Pat Sissons
fd85eb85cb adding citype support 2020-12-12 23:32:28 -08:00
Pat Sissons
b5ff37af74 fix initialization diff 2020-12-12 23:31:28 -08:00
Pat Sissons
7eac54086a fixing started diff 2020-12-12 23:24:49 -08:00
ryan
4597175e5c provider: Migrate to standalone terraform plugin SDK 1.9.1 2020-12-13 12:25:02 +08:00
Alex Kulikovskikh
3d14018ff7 add ipset cluster resource 2020-12-10 09:52:38 -05:00
Alex Kulikovskikh
0a71fe6b1f add alias cluster resource 2020-12-10 09:45:27 -05:00
Pat Sissons
920bf24200 fix index out of range error 2020-12-06 18:31:29 -08:00
Dan R. Petersen
eb06704896
Merge pull request #12 from Wombelix/vm-create-linked-clone
Parameter added to define if a Full or Linked Clone should be created
2020-10-25 23:15:11 +01:00
Dan R. Petersen
2b260aaf04
Merge pull request #28 from danitso/bugfix-dir-based-disk-import
Treat NFS as directory based datastore
2020-10-25 23:10:27 +01:00
Dan R. Petersen
c068512d0d
Merge pull request #46 from blz-ea/feature-cloud-init-and-cdrom
Resolves conflict of cloud-init with cd-dvd drive
2020-10-25 23:08:03 +01:00
Dan R. Petersen
74d895f305
Merge pull request #35 from danitso/fix/agent-ip-addresses
Fix lack of IP addresses from QEMU agent
2020-10-25 23:01:37 +01:00