* feat(vm): add support for cpu `affinity` attribute (#1148)
It helps to pin VMs to the special cpu.
Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
* add clarification about the format and permission requirements for `affinity`
* do not add `affinity` property to the API call if is not set
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
---------
Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
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 proxmox_virtual_environment_node datasource
It helps to get CPU model, number of cores and sockets.
Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
* fix node_name ref
* add acceptance test
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
---------
Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
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>
* Use GetDatastoreFile instead of ListDatastoreFiles
Signed-off-by: CppBunny <noah@vantiggel.be>
* make linter happy
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
---------
Signed-off-by: CppBunny <noah@vantiggel.be>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* Added NetworkDevices and IPs
Removed previous limitation to 8 network interfaces/ips and moved to
new proxmox limit (up to 32)
Modifiche di cui verrà eseguito il commit:
modificato: proxmox/nodes/vms/vms_types.go
Signed-off-by: bitchecker <ciro.deluca@autistici.org>
* Code alignment for vm resource
After updates to vm_types structure definition, updated the resource
code in order to reflect changes
Modifiche di cui verrà eseguito il commit:
modificato: proxmoxtf/resource/vm.go
Signed-off-by: bitchecker <ciro.deluca@autistici.org>
* fix few typos, fix struct to state mapping
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
---------
Signed-off-by: bitchecker <ciro.deluca@autistici.org>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* bug(vm): fix hostpci devices not showing up in refresh plan
Signed-off-by: Michael Iseli <michael.iseli@bsi-software.com>
* fix pci & usb devices set on read, fix test
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
---------
Signed-off-by: Michael Iseli <michael.iseli@bsi-software.com>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* fix(vm): panic at read when cloud-init drive is on directory storage
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* fix linter, add tests
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
---------
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* fix(vm): type error when unmarshalling `GetResponseData.data.memory`
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* linter
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
---------
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* fix(provider): use int64 for vm and disk storage
Signed-off-by: DanielHabenicht <daniel-habenicht@outlook.de>
* revert changes for memory
Signed-off-by: DanielHabenicht <daniel-habenicht@outlook.de>
* revert changes for memory
Signed-off-by: DanielHabenicht <daniel-habenicht@outlook.de>
* fix test
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* fix int -> int64 conversion for disk size
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
---------
Signed-off-by: DanielHabenicht <daniel-habenicht@outlook.de>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-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>
* fix(vm): resolves issue where ctrl+c was not being responded when qemu agent lookups would fail
Signed-off-by: TheNotary <799247+TheNotary@users.noreply.github.com>
* add os.Interrupt signal handling
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
---------
Signed-off-by: TheNotary <799247+TheNotary@users.noreply.github.com>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Storage using .raw or .qcow2 files uses additional element in path,
which is not present in ZFS storage.
Support both patterns when determining disk ownership.
This fixes#632
Signed-off-by: Oto Petřík <oto.petrik@gmail.com>
fix(lxc): unmarshal string/int vmid as int
Signed-off-by: zamrih <ramzi.hb@gmail.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(provider): configure temp directory
Resource 'proxmox_virtual_environment_file' often requires lot of disk
space in /tmp, which can be space-limited.
Instead of requiring to set TMPDIR environment variable before running
terraform, make it a provider configuration option.
Signed-off-by: Oto Petřík <oto.petrik@gmail.com>
* fix: lint error, align names in the `client` struct
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>
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)
* 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>
* 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(vm): fix index out of range when unmarshalling custompcidevice
* fix: linter errors
---------
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
When the VM contains at least one bridge, the main interface (e.g.
`eth0`) is left without an IP address because that's how networks
usually work.
The code that queries the VM's IP addresses (through the guest agent),
loops all available interfaces to find one. The existing code though
would prematurely exit the loop if the interface it was checking had no IP
address assigned. Like the aforementioned `eth0`, when it is controlled
by a bridge.
This patch fixes this problem by not exiting the loop, instead just continuing
to the next interface.
* 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>