* 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>
* 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
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`).
* 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>
* 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>
* 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>
* 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
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'.
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>
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.
* 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