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

Cannot create disks larger than 99G #334

Closed
m0pge opened this issue May 13, 2023 · 2 comments · Fixed by #335
Closed

Cannot create disks larger than 99G #334

m0pge opened this issue May 13, 2023 · 2 comments · Fixed by #335

Comments

@m0pge
Copy link

m0pge commented May 13, 2023

When using the latest build of the provider on a gitlab instance (self hosted) it appears impossible to create disks in a vm larger than 99G... the system fails with a "invalid format - value does not look like a valid disk size: 1e+02G)" error

Smaller size disks are created without problems - output below demonstrates the output from a test clone operation that adds a 32G, 64G, 99G, and 100G disk. The 100G disk fails to create

As well as a clone operation this same behaviour has been seen when creating a VM from scratch. In both cases, the VM appears in Proxmox and the first three disks are created.

Terraform snippet....

resource "proxmox_virtual_environment_vm" "db_vm" {
  name        = "db"
  node_name = "prox1"

  clone {
    vm_id = 100
    datastore_id = "Database"
  }

  started = true

  cpu {
    cores = 4
  }

  memory {
    dedicated = 32768
  }

  disk {
    datastore_id = "Database"
    interface = "virtio1"
    iothread = true
    size = 32
    file_format = "raw"

  }

    disk {
    datastore_id = "Database"
    interface = "virtio2"
    size = 64
    file_format = "raw"
  }

    disk {
    datastore_id = "Database"
    interface = "virtio3"
    size = 99
    file_format = "raw"
  }

    disk {
    datastore_id = "Database"
    interface = "virtio4"
    size = 100
    file_format = "raw"
  }

  keyboard_layout = "en-gb"

}

Output from the gitlab shell runner...

Initializing provider plugins...
- Finding bpg/proxmox versions matching ">= 0.19.0"...
- Installing bpg/proxmox v0.19.0...
- Installed bpg/proxmox v0.19.0 (self-signed, key ID DAA1958557A27403)
Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/cli/plugins/signing.html
Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
$ terraform apply -auto-approve
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
Terraform will perform the following actions:
  # proxmox_virtual_environment_vm.db_vm will be created
  + resource "proxmox_virtual_environment_vm" "db_vm" {
      + acpi                    = true
      + bios                    = "seabios"
      + id                      = (known after apply)
      + ipv4_addresses          = (known after apply)
      + ipv6_addresses          = (known after apply)
      + keyboard_layout         = "en-gb"
      + mac_addresses           = (known after apply)
      + name                    = "db"
      + network_interface_names = (known after apply)
      + node_name               = "prox1"
      + on_boot                 = true
      + reboot                  = false
      + scsi_hardware           = "virtio-scsi-pci"
      + started                 = true
      + tablet_device           = true
      + template                = false
      + timeout_clone           = 1800
      + timeout_move_disk       = 1800
      + timeout_reboot          = 1800
      + timeout_shutdown_vm     = 1800
      + timeout_start_vm        = 1800
      + timeout_stop_vm         = 300
      + vm_id                   = -1
      + clone {
          + datastore_id = "Database"
          + full         = true
          + retries      = 1
          + vm_id        = 100
        }
      + cpu {
          + architecture = "x86_64"
          + cores        = 4
          + hotplugged   = 0
          + sockets      = 1
          + type         = "qemu64"
          + units        = 1024
        }
      + disk {
          + datastore_id = "Database"
          + file_format  = "raw"
          + interface    = "virtio1"
          + iothread     = true
          + size         = 32
          + ssd          = false
        }
      + disk {
          + datastore_id = "Database"
          + file_format  = "raw"
          + interface    = "virtio2"
          + iothread     = false
          + size         = 64
          + ssd          = false
        }
      + disk {
          + datastore_id = "Database"
          + file_format  = "raw"
          + interface    = "virtio3"
          + iothread     = false
          + size         = 99
          + ssd          = false
        }
      + disk {
          + datastore_id = "Database"
          + file_format  = "raw"
          + interface    = "virtio4"
          + iothread     = false
          + size         = 100
          + ssd          = false
        }
      + memory {
          + dedicated = 32768
          + floating  = 0
          + shared    = 0
        }
    }
Plan: 1 to add, 0 to change, 0 to destroy.
proxmox_virtual_environment_vm.db_vm: Creating...
proxmox_virtual_environment_vm.db_vm: Still creating... [10s elapsed]
proxmox_virtual_environment_vm.db_vm: Still creating... [20s elapsed]
proxmox_virtual_environment_vm.db_vm: Still creating... [30s elapsed]
proxmox_virtual_environment_vm.db_vm: Still creating... [40s elapsed]
proxmox_virtual_environment_vm.db_vm: Still creating... [50s elapsed]
proxmox_virtual_environment_vm.db_vm: Still creating... [1m0s elapsed]
proxmox_virtual_environment_vm.db_vm: Still creating... [1m10s elapsed]
proxmox_virtual_environment_vm.db_vm: Still creating... [1m20s elapsed]
proxmox_virtual_environment_vm.db_vm: Still creating... [1m30s elapsed]
proxmox_virtual_environment_vm.db_vm: Still creating... [1m40s elapsed]
proxmox_virtual_environment_vm.db_vm: Still creating... [1m50s elapsed]
proxmox_virtual_environment_vm.db_vm: Still creating... [2m0s elapsed]
proxmox_virtual_environment_vm.db_vm: Still creating... [2m10s elapsed]
proxmox_virtual_environment_vm.db_vm: Still creating... [2m20s elapsed]
proxmox_virtual_environment_vm.db_vm: Still creating... [2m30s elapsed]
proxmox_virtual_environment_vm.db_vm: Still creating... [2m40s elapsed]
proxmox_virtual_environment_vm.db_vm: Still creating... [2m50s elapsed]
╷
│ Error: received an HTTP 400 response - Reason: Parameter verification failed. (virtio4: invalid format - format error
│ virtio4.size: invalid format - value does not look like a valid disk size: 1e+02G)
│ 
│   with proxmox_virtual_environment_vm.db_vm,
│   on clone.tf line 9, in resource "proxmox_virtual_environment_vm" "db_vm":
│    9: resource "proxmox_virtual_environment_vm" "db_vm" {
│ 
╵
ERROR: Job failed: exit status 1
@bpg
Copy link
Owner

bpg commented May 14, 2023

Hey @m0pge! 👋🏼
Thanks for the report! I'll push a fix soon, will be in v.0.19.1

@bpg bpg closed this as completed in #335 May 14, 2023
@m0pge
Copy link
Author

m0pge commented May 15, 2023

@bpg

Just built the latest release... and....

proxmox_virtual_environment_vm.db_vm: Still creating... [3m20s elapsed] proxmox_virtual_environment_vm.db_vm: Creation complete after 3m24s [id=102] Apply complete! Resources: 1 added, 0 changed, 0 destroyed. Job succeeded

I would say that works just fine! Thanks for all your work on this and the provider and everyone else, it really is a useful thing to have for Proxmox :)

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

Successfully merging a pull request may close this issue.

2 participants