* feat(file): FORMAT CHANGE: update **import id**, so it matches the resource's format: `<node_name>/<datastore_id>:<content_type>/<file>`
* better example
* 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>
* fix(provider): User-settable VLAN ID and name
By default resource `proxmox_virtual_environment_network_linux_vlan`
uses `name` to determine both the actual raw device for VLAN and
VLAN ID.
Since ifupdown2 (manually installed on PVE6, installed by default
since PVE7), it is possible to have VLAN name not tied to VLAN ID.
Make `interface` and `vlan` configurable by user.
* fix: update schema to ensure the correct docs generation.
---------
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* chore: fix a pair of typos in comments
* feat(api): list High Availability groups
* New clients created for HA and HA groups (via
`Cluster().HA().Groups()`)
* `List(ctx)` method that lists the cluster's High Availability groups
* feat(ha): added the `proxmox_virtual_environment_hagroups` data source
* This data source returns the list of HA groups in its value's
`group_ids` field
* fix(api): changed incorrect copy-pasted error message
* feat(api): get a HA group's full information
* Added a `Get()` method to the HA group client, which fetches a
single group's information based on its identifier.
* feat(ha): added the `proxmox_virtual_environment_hagroup` data source
* This data source can read information about a single Proxmox High
Availabillity group from the cluster.
* chore(ha): fixed linter error
* test(ha): added schema tests for the HA groups data sources
* fix(ha): use -1 as a node's priority when no priority is defined
* It used to default to 0, which is a valid value for priorities.
* chore(ha): converted the `hagroups` datasource to the Terraform plugin SDK
* chore(refactoring): common definition for `id` attributes
* chore(ha): ported the HA group datasource to the Terraform plugin framework
* feat(ha): return HA group identifiers as a set rather than a list
* docs(ha): added examples for the hagroups/hagroup datasources
* docs(ha): added documentation for the hagroup{,s} datasources
* chore(ha): fixed linter errors
* chore(ha): workaround for the linter's split personality disorder
* fix(ha): fixed reading the restricted flag
* chore(refactoring): use `ExpandPath` for paths to the HA groups API
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* feat: CustomBool to Terraform attribute value conversion method
* chore(refactoring): use `CustomBool` for boolean fields in the API data
* chore(refactoring): renamed "members" to "nodes" in the HA group datasource
* fix: typo in comment
* chore(refactoring): split HA group API data and added the update request body
* fix(api): fixed copy-pasted error message
* feat(api): method to create/update a HA group
* feat(api): HA group deletion method
* fix(api): made the digest optional for HA groups
* feat(ha): added unimplemented hagroup resource
* fix(ha): fixed copy-pasted comment
* feat(ha): schema definition for the HA group resource
* feat: helper function that converts string attr values to string pointers
* fix(ha): ensure node priorities are <= 1000 in HA groups
* fix(ha): add the digest attribute to the schema
* feat(ha): model definition for the HA group resource
* fix(api): fixed incorrect error message
* fix(api): fixed HA group creation / update
* I had somehow misunderstood the Proxmox API doc and thought creation
and update went through the same endpoint. This has been fixed by
adding separate data structures and separate methods for both
actions.
* feat: Terraform/Proxmox API conversion utilities
* chore(refactoring): HA group model and reading code moved to separate file
* feat(ha): HA group creation
* fix(api): renamed method (missed during previous refactor)
* feat(ha): `Read()` method implemented for the `hagroup` resource
* chore(refactoring): more consistent variable naming
* fix(ha): fixed the behaviour of `Read()` when the resource is deleted externally
* feat(ha): implement HA group deletion
* feat(ha): HA group update implemented
* fix(ha): prevent empty or untrimmed HA group comments
* feat(ha): HA group import
* docs(ha): HA group resource examples
* docs(ha): generated documentation for the `hagroup` resource
* chore(ha): fixed linter errors
* chore(refactoring): updated the code based on changes to the datasource PR
* fix(api): fixed boolean fields in the HA group create/update structures
* fix(ha): removed digest from the HA group resource and datasource
* The digest is generated by Proxmox from the *whole* HA groups
configuration, so any update to one group causes changes in all
other groups.
* Because of that, using it causes failures when updating two or more
HA groups.
* It is also a pretty useless value to have in the datasource, as it
is global and not actually related to the individual data items
* chore(refactoring): removed obsolete type conversion code
* chore(refactoring): use `ExpandPath` in the HA groups API client
* feat(ha): custom type for HA resource states
* feat(ha): custom type for HA resource types
* fix(api): fixed JSON decoding for HA resource states and types
* Values were being decoded directly from the raw bytes.
* Added tests for JSON marshaling/unmarshaling
* feat(api): custom type for HA resource identifiers
* Structure with a type and name
* Conversion to/from strings
* Marshaling to/Unmarshaling from JSON
* URL encoding
* feat(api): list and get HA resources
* feat(ha): HA resources list datasource
* feat(ha): added method that converts HA resource data to Terraform values
* fix(api): HA resource max relocation/restarts are optional
* feat(ha): Terraform validator for HA resource IDs
* feat(ha): HA resource datasource
* chore(refactoring): moved HA resource model to separate file
* feat(api): data structures for HA resource creation and update
* feat(api): HA resource creation, update and deletion
* fix(api): incorrect mapping in common HA resource data
* feat: utility function to create attribute validators based on parse functions
* feat: validators for HA resource identifiers, states and types
* fix(api): incorrect comment for the update request body
* feat(ha): Terraform resource for Proxmox HA resources
* chore(reafactoring): removed old HA resource ID validator
* docs: examples related to HA resources added
* docs: added documentation related to HA resources management
* fix: update doc generation, fix minor typos
* fix: rename & split utils package, replace `iota`
---------
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* 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>
* 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>
* 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>
* add more valid cpu types
(cherry picked from commit c62e76707b897912628adc7dda0871b3146c7aa8)
* add docs
---------
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* 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
* 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>
* 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>
* 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>
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
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
* 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
* 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
* 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>
* 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>
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>
* 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>
* 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>
* 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>
* 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
* 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