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

Error: resizing disk: error waiting for VM disk resize: All attempts fail: #1404

Closed
oussexist opened this issue Jun 21, 2024 · 5 comments
Closed

Comments

@oussexist
Copy link

oussexist commented Jun 21, 2024

Hello There,
Im facing a little issue with provisionning a vm with cloud-init , so i uploaded a ubuntu image on my proxmox and as i followed the documentation here is my terraform main.tf config :

terraform {
  required_providers {
    proxmox = {
      source  = "bpg/proxmox"
      version = "0.60.0"

    }
  }
}
resource "proxmox_virtual_environment_vm" "master" {
    name        = var.VMasterName
  description = "Managed by Terraform"
  tags        = ["terraform"]
  node_name   = var.MasterNodeName
  vm_id       = 4322

  agent {
    enabled = true
  }
on_boot = false

  memory {
    dedicated = var.Mastermemory
  }
    
    
  disk {
    datastore_id = "local-lvm"
    file_id      = "local:iso/jammy-server-cloudimg-amd64.img"
    interface    = "scsi0"


  }

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

    user_data_file_id = proxmox_virtual_environment_file.cloud_config.id
  }

  network_device {
    bridge = var.net
  }

}


i know the error is about the disk block ( althought i dont have local-zfs so ial using local-lvm) , but i really dont know what to put exactly in size argument so any number u'll put it leads to the same error , even putting it without size argument leads to same error cuz by default the size will be 8 ! here's the error :

│ Error: resizing disk: error waiting for VM disk resize: All attempts fail:
│ #1: the server did not include a data object in the response
│
│   with proxmox_virtual_environment_vm.master,
│   on main.tf line 11, in resource "proxmox_virtual_environment_vm" "master":
│   11: resource "proxmox_virtual_environment_vm" "master" {
│

PS : I tried to create manually a vm to check what it puts by default in disk size , so it shows 32 , so i tried to put 32 on size arg and leads to same error

@bpg
Copy link
Owner

bpg commented Jun 21, 2024

Hi @oussexist! 👋🏼

This looks suspiciously similar to #1403, which I haven't investigated yet.

Could you provide some more details about your setup? What is the PVE version?

@oussexist
Copy link
Author

oussexist commented Jun 21, 2024

Hello @bpg
so am using VirtualBox 7.0 and PVE 7.4-1
Idk what other details should i provide more , am running virtual box on a dell machine.

Although the Vm launched by terraform apply appears asu u can see
image

so by manually starting it here are some pics that may help...
image
and then it starts fine :
image

and here are some more code for the file used that maybe u need :

file.tf:
data "local_file" "ssh_public_key" {
  filename = "./id_rsa.pub"
}

resource "proxmox_virtual_environment_file" "cloud_config_master" {
  content_type = "snippets"
  datastore_id = "local"
  node_name    = "pve"

  source_raw {
    data = <<-EOF
    #cloud-config
    users:
      - default
      - name: ubuntu
        groups:
          - sudo
        shell: /bin/bash
        ssh_authorized_keys:
          - ${trimspace(data.local_file.ssh_public_key.content)}
        sudo: ALL=(ALL) NOPASSWD:ALL
    runcmd:
        - apt update
        - apt install -y qemu-guest-agent net-tools
        - timedatectl set-timezone America/Toronto
        - systemctl enable qemu-guest-agent
        - systemctl start qemu-guest-agent
        - echo "done" > /tmp/cloud-config.done
    EOF

    file_name = "cloud-config-master.yaml"
  }
}

@flombois
Copy link

Hi @oussexist I did run in the same issue in #1403 , however when upgrading to Proxmox 8.2.4 and using file_format = 'raw' in the disk block the vm creation succeeded. I suggest to try with 8.x version of Proxmox to see if the error is still reproducible. Nonetheless I still have some trouble with qcow2 format

@oussexist
Copy link
Author

So Yes , I used PVE 8 and it worked fine !
Thanks @flombois

@bpg
Copy link
Owner

bpg commented Jun 22, 2024

Nice! I'm closing the ticket then.
If you interested in some more details about qcow2 usage I replied in #1403 (reply in thread)

@bpg bpg closed this as completed Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants