* fix(api): set min TLS version 1.3, secure HTTP-only cookie
* remove `all-tests-passed` job
---------
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* chore: add file test
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* add file updated test, file_name / ID is getting changed :/
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* more tests, refactor file's read, more consistency in the attributes
TODO: need to check backward compatibility
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* fix error message, enable import test
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* more tests
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* more tests for owerwrite, update docs
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* fix tests on CI
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
---------
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* feat(file): FORMAT CHANGE: update **import id**, so it matches the resource's format: `<node_name>/<datastore_id>:<content_type>/<file>`
* better example
The CloudInit interface can be left empty in order to allow
autodetection of the drive being used. However, it would seem that this
value was causing problems (see #539).
This commit adds an additional validator for CloudInit interfaces which
allows the `""` value.
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)
* 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(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>
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>
* 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(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>
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.
* 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>
* 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>
* 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
* (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>