Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serial device cannot be removed from VM #1034

Closed
maksimsamt opened this issue Jun 7, 2024 · 2 comments · Fixed by #1079
Closed

Serial device cannot be removed from VM #1034

maksimsamt opened this issue Jun 7, 2024 · 2 comments · Fixed by #1079
Assignees
Labels

Comments

@maksimsamt
Copy link
Contributor

System details:

  • Proxmox VE 8.2.2
  • Terraform v1.8.4
  • terraform-provider-proxmox v3.0.1-rc2

Creating new resources works as expected, serial device is correctly created.
Initial config (serial block snippet):

...
resource "proxmox_vm_qemu" "cloud_vm_from_packer_template" {
...
  serial = {
    id   = 0
    type = "socket"
  }
...
}
...

Decide to remove serial device, by removing serial block from config.

In terraform apply output all looks fine, serial block should be removed and result shows as Apply complete! Resources: 0 added, 1 changed, 0 destroyed.:

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # proxmox_vm_qemu.cloud_vm_from_packer_template will be updated in-place
  ~ resource "proxmox_vm_qemu" "cloud_vm_from_packer_template" {
        id                     = "***/qemu/***"
        name                   = "***"
        tags                   = "***"
        # (65 unchanged attributes hidden)

      - serial {
          - id   = 0 -> null
          - type = "socket" -> null
        }

        # (6 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

proxmox_vm_qemu.cloud_vm_from_packer_template: Modifying... [id=***/qemu/***]
proxmox_vm_qemu.cloud_vm_from_packer_template: Modifications complete after 1s [id=***/qemu/***]
╷
│ Warning: VM needs to be rebooted and automatic_reboot is disabled
│ 
│   with proxmox_vm_qemu.cloud_vm_from_packer_template,
│   on main.tf line 42, in resource "proxmox_vm_qemu" "cloud_vm_from_packer_template":
│   42: resource "proxmox_vm_qemu" "cloud_vm_from_packer_template" {
│ 
│ One or more parameters are modified that only take effect after a reboot (shutdown & start).
╵

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

After VM shutdown & start serial device still exists:

image

When I try to run terraform apply again, it says that everything is fine and there are no changes:

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

This serial device can only be removed through the Proxmox GUI.

Similar situation is with network device removing #1027

@maksimsamt
Copy link
Contributor Author

maksimsamt commented Jun 13, 2024

@Tinyblargon ,
Maybe it makes sense to make the same scheme as for disks? For example:

...
resource "proxmox_vm_qemu" "cloud_vm_from_packer_template" {
...
  serials = {
    serial0 = {
        id   = 0
        type = "socket"
    }
    serial1 = {
        id   = 1
        type = "socket"
    }
  }
...
}
...

@maksimsamt
Copy link
Contributor Author

#1079

works as expected!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants