cleaning up and refactoring the VM code, add some acceptance tests around disks, few minor bugfixes
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* fix(vm): update validation and docs for `machine` attribute.
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* chore: remove certificate resource from acceptance tests
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
---------
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* feat: support usb devices for vm; fixes#665
Signed-off-by: Daniel Muehlbachler-Pietrzykowski <daniel@muehlbachler.io>
* chore: fix linter errors
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
---------
Signed-off-by: Daniel Muehlbachler-Pietrzykowski <daniel@muehlbachler.io>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* feat(vm): add 'path_in_datastore' disk argument
Provide access to actual in-datastore path to disk image,
and experimental support for attaching other VM's disks or host devices.
Signed-off-by: Oto Petřík <oto.petrik@gmail.com>
* chore: added to `/example` for acceptance testing
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
---------
Signed-off-by: Oto Petřík <oto.petrik@gmail.com>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
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>
* fix(user): make password attribute optional
The password is already optional in the terraform schema, but still serialized and sent as an empty string via the client. This addresses the request body serialization.
Addresses #462
* add example template
---------
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>
* 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>
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
* 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>
* 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>
* 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