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

Unused raw disk #145

Closed
modem7 opened this issue Jan 23, 2023 · 3 comments · Fixed by #147
Closed

Unused raw disk #145

modem7 opened this issue Jan 23, 2023 · 3 comments · Fixed by #147
Labels

Comments

@modem7
Copy link

modem7 commented Jan 23, 2023

Overview of the Issue

When creating Packer build with latest version, a new disk is created which is unused.

Reproduction Steps

  disks {
    disk_size = "${var.vm_disk_size}"
    format = "${var.vm_format}"
    storage_pool = "${var.vm_storage_pool}"
    storage_pool_type = "${var.vm_storage_pool_type}"
    type = "${var.vm_type}"
    cache_mode = "${var.vm_cache_mode}"
    io_thread = "${var.vm_io_thread}"
  }

image

Plugin and Packer version

Packer v1.8.5
Plugin v1.1.1

Simplified Packer Buildfile

Packer build:
https://paste.modem7.com/62MoM-pWJrI

Packer variables:
https://paste.modem7.com/xLNnK-mbfw7

Logs

PACKER_LOG=1 does not give any additional information beyond:

❯ packer build .
ubuntu-server-jammy.proxmox-iso.ubuntu-server-jammy: output will be in this color.

==> ubuntu-server-jammy.proxmox-iso.ubuntu-server-jammy: Creating VM
==> ubuntu-server-jammy.proxmox-iso.ubuntu-server-jammy: No VM ID given, getting next free from Proxmox
==> ubuntu-server-jammy.proxmox-iso.ubuntu-server-jammy: Starting VM
==> ubuntu-server-jammy.proxmox-iso.ubuntu-server-jammy: Starting HTTP server on port 8811
==> ubuntu-server-jammy.proxmox-iso.ubuntu-server-jammy: Waiting 10s for boot

Operating system and Environment details

Ubuntu 22.04.1 x64

@modem7 modem7 added the bug label Jan 23, 2023
@modem7 modem7 changed the title Unused Disk Unused raw disk Jan 23, 2023
@modem7
Copy link
Author

modem7 commented Jan 23, 2023

This occurs as soon as the VM starts up, and the disks are added by the builder:

image

@sebastian-de
Copy link
Contributor

Hmm, I'm pretty sure it's because of this block:

// The EFI disk doesn't get created reliably during initial VM creation,

Proxmox seems to behave very inconsistently when it comes to creating EFI-disks. I'll see if I can fine-tune this.

@sebastian-de
Copy link
Contributor

I tested several cases:

  1. proxmox-iso with EFI disk in config -> unused disk
  2. proxmox-iso without EFI disk in config -> OK
  3. proxmox-clone without EFI disk in config nd no EFI disk in cloned VM -> OK
  4. proxmox-clone with EFI disk in config and no EFI disk in cloned VM -> OK
  5. proxmox-clone with EFI disk in config and existing EFI disk in cloned VM -> unused disk

Commenting out the SetVmConfig() block mentionoed above yields:

  1. proxmox-iso with EFI disk in config -> OK
  2. proxmox-iso without EFI disk in config -> OK
  3. proxmox-clone without EFI disk in config nd no EFI disk in cloned VM -> OK
  4. proxmox-clone with EFI disk in config and no EFI disk in cloned VM -> no EFI disk
  5. proxmox-clone with EFI disk in config and existing EFI disk in cloned VM -> OK

I'll have to piece this together and work on a solution to get EFI disks created reliably.

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