From 40102a6a501a5ead3219492f34255a25c4f21371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Safin?= <51059348+rafsaf@users.noreply.github.com> Date: Thu, 28 Dec 2023 16:48:53 +0100 Subject: [PATCH] fix(lxc): add missing `onboot` param on container clone create (#838) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(lxc): add missing start params on container clone create Signed-off-by: Rafał Safin * fix(lxc): remove set started attr on container clone Signed-off-by: Rafał Safin * 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 Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com> Co-authored-by: Rafał Safin Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com> --- example/resource_virtual_environment_container.tf | 2 ++ proxmoxtf/resource/container.go | 3 +++ 2 files changed, 5 insertions(+) diff --git a/example/resource_virtual_environment_container.tf b/example/resource_virtual_environment_container.tf index b321693e..cc181813 100644 --- a/example/resource_virtual_environment_container.tf +++ b/example/resource_virtual_environment_container.tf @@ -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 diff --git a/proxmoxtf/resource/container.go b/proxmoxtf/resource/container.go index 69ba8992..f3819a56 100644 --- a/proxmoxtf/resource/container.go +++ b/proxmoxtf/resource/container.go @@ -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 {