Skip to content

Commit

Permalink
fix(lxc): add missing onboot param on container clone create (#838)
Browse files Browse the repository at this point in the history
* fix(lxc): add missing start params on container clone create

Signed-off-by: Rafał Safin <rafal.safin@rafsaf.pl>

* fix(lxc): remove set started attr on container clone

Signed-off-by: Rafał Safin <rafal.safin@rafsaf.pl>

* chore(lxc): add `start_on_boot` to example templates

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

---------

Signed-off-by: Rafał Safin <rafal.safin@rafsaf.pl>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Rafał Safin <rafal.safin@rafsaf.pl>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 28, 2023
1 parent d8f82d4 commit 40102a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions example/resource_virtual_environment_container.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
resource "proxmox_virtual_environment_container" "example_template" {
description = "Managed by Terraform"

start_on_boot = "true"

disk {
datastore_id = element(data.proxmox_virtual_environment_datastores.example.datastore_ids, index(data.proxmox_virtual_environment_datastores.example.datastore_ids, "local-lvm"))
size = 10
Expand Down
3 changes: 3 additions & 0 deletions proxmoxtf/resource/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,9 @@ func containerCreateClone(ctx context.Context, d *schema.ResourceData, m interfa
// Now that the virtual machine has been cloned, we need to perform some modifications.
updateBody := &containers.UpdateRequestBody{}

startOnBoot := types.CustomBool(d.Get(mkResourceVirtualEnvironmentContainerStartOnBoot).(bool))
updateBody.StartOnBoot = &startOnBoot

console := d.Get(mkResourceVirtualEnvironmentContainerConsole).([]interface{})

if len(console) > 0 {
Expand Down

0 comments on commit 40102a6

Please sign in to comment.