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

Confusing error message when cloning a VM with cloud-init to a non-default datastore #1462

Open
fuse opened this issue Aug 1, 2024 · 3 comments
Labels
🐛 bug Something isn't working

Comments

@fuse
Copy link

fuse commented Aug 1, 2024

Describe the bug

I’m not able to configure cloud-init while cloning VM. If I just clone the VM using terraform and configure cloud-init manually it works like a charm.

To Reproduce

I want to create a VM on a node, using a template on a different one. Without the initialization bloc it’s ok. With the block the VM is correctly created but terraform fails with :

│ Error: error updating VM: the requested resource does not exist
│ 
│   with proxmox_virtual_environment_vm.test_vm,
│   on main.tf line 1, in resource "proxmox_virtual_environment_vm" "test_vm":
│    1: resource "proxmox_virtual_environment_vm" "test_vm" {
resource "proxmox_virtual_environment_vm" "test_vm" {
  name      = "test-martin"
  node_name = "node19"

  clone {
    vm_id        = "179"
    datastore_id = "storage01"
    full         = true
    node_name    = "node09"
  }

  cpu {
    cores   = 1
    sockets = 1
  }

  memory {
    dedicated = 512
  }

  agent {
    enabled = true
  }

  network_device {
    bridge  = "vmbr0"
    vlan_id = 3305
  }

  initialization {
    ip_config {
      ipv4 {
        address = "172.16.2.57/32"
        gateway = "172.16.2.10"
      }
    }

    dns {
      servers = ["172.16.0.15", "172.16.0.16"]
      domain = "internal.xxx.fr"
    }

    user_account {
      username = "martin"
      password = "xxx"
      keys     = [
        "xxx"
      ]
    }
  }

  disk {
    datastore_id = "storage02"
    file_format  = "raw"
    interface    = "scsi0"
    size         = 5
  }
}

Any idea ?

@fuse fuse added the 🐛 bug Something isn't working label Aug 1, 2024
@a-mcf
Copy link

a-mcf commented Aug 5, 2024

I experienced this issue when I didn't specify a datastore_id under the initialization block. I don't have local-lvm, which seems to be the default. Specifying the datastore_id fixed it for me. The error message in this case is kind of hard to decipher.

@fuse
Copy link
Author

fuse commented Aug 7, 2024

Thanks a lot, that did the trick !

@fuse fuse closed this as completed Aug 7, 2024
@bpg
Copy link
Owner

bpg commented Aug 7, 2024

I'll keep the issue open. The error definitely needs to be handled better, and the message should provide actionable information.

@bpg bpg reopened this Aug 7, 2024
@bpg bpg changed the title Setting cloud-init while cloning VM Confusing error message when cloning a VM with cloud-init to a non-default datastore Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants