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

cloud-init ip config is lost when changing CPU or memory in a cloned VM #1701

Open
b4stien opened this issue Jan 8, 2025 · 0 comments
Open
Labels
🐛 bug Something isn't working topic:clone

Comments

@b4stien
Copy link

b4stien commented Jan 8, 2025

Describe the bug

When changing the CPU's core count or memory amount the IP config is lost in cloud-init thus resulting in a loss of network for the VM after the change.

EDIT: If it's relevant, changing the core count or the memory amount in the interface do not impact cloud-init (thus not producing the bug).

EDIT2: Other info, if I put user account info in cloud-init, it is preserved after the CPU/memory changes.

To Reproduce

  1. Create a VM with 4 cores, and an IP config.
  2. Observe that the IP config is available in Proxmox UI and the QEMU guest agent export the IP to the Proxmox UI (and the TF provider).
  3. Modify the core count.
  4. Observe that the IP config is gone in Proxmox UI and that the VM no longer has network access.

VM creation

resource "proxmox_virtual_environment_vm" "proxmox_vm" {
  name = "simple-vm-via-opentofu"
  node_name = "proxmox"

  agent {
    enabled = true
  }

  started = true

  cpu {
    cores = 8
  }

  clone {
    full = true
    vm_id = 667
    node_name = "proxmox"
  }

  initialization {
    ip_config {
      ipv4 {
        address = "dhcp"
      }
    }
  }

  stop_on_destroy = true
}

IP config is correct

Screenshot 2025-01-08 at 15 08 30

VM modification

resource "proxmox_virtual_environment_vm" "proxmox_vm" {
  name = "simple-vm-via-opentofu"
  node_name = "proxmox"

  agent {
    enabled = true
  }

  started = true

  cpu {
    cores = 4
  }

  clone {
    full = true
    vm_id = 667
    node_name = "proxmox"
  }

  initialization {
    ip_config {
      ipv4 {
        address = "dhcp"
      }
    }
  }

  stop_on_destroy = true
}

IP config is gone

Screenshot 2025-01-08 at 15 08 55

Additional context

  • Single or clustered Proxmox: Single
  • Proxmox version: 9.3
  • Provider version (ideally it should be the latest version): 0.69.1
  • Terraform/OpenTofu version: OpenTofu v1.8.8
  • OS (where you run Terraform/OpenTofu from): macOS 15.2
@b4stien b4stien added the 🐛 bug Something isn't working label Jan 8, 2025
@bpg bpg changed the title cloud-init ip config is lost when changing CPU or memory cloud-init ip config is lost when changing CPU or memory in a cloned VM Jan 10, 2025
@bpg bpg moved this from 📥 Inbox to ☑️ Todo in terraform-provider-proxmox Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working topic:clone
Projects
Status: ☑️ Todo
Development

No branches or pull requests

2 participants