* 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>
* (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>
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>
* 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>
* 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
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.
* 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>
* 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.
* 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>
* 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: 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>
* 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
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.
* 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
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.
`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
```