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

VM provisioned with a blank drive #391

Open
rsauber-ot opened this issue Dec 10, 2024 · 0 comments
Open

VM provisioned with a blank drive #391

rsauber-ot opened this issue Dec 10, 2024 · 0 comments

Comments

@rsauber-ot
Copy link

Describe the bug
Creating a VM from template results in a blank drive.

The template was made with the following steps:

packer to customize a cloud image, saving as a qcow2 image
curl using the API to upload the image:

curl -k -X POST "https://$PROXMOX_HOST:8006/api2/json/nodes/$NODE_NAME/storage/$STORAGE/upload" \
  -H "Cookie: PVEAuthCookie=$ticket" \
  -H "CSRFPreventionToken: $csrf_token" \
  -F "content=iso" \
  -F "filename=@$FILE_PATH" \

curl using API to create new VM:

curl -k -X POST "https://$PROXMOX_HOST:8006/api2/json/nodes/$NODE_NAME/qemu" \
  -H "Cookie: PVEAuthCookie=$ticket" \
  -H "CSRFPreventionToken: $csrf_token" \
  --data-urlencode net0="virtio,bridge=vmbr0" \
  --data vmid=9001 \
  --data cores=2 \
  --data-urlencode name=packer-ubuntu20 \
  --data-urlencode virtio0=packer-images:0,import-from=/data-zfs/packer-images/template/iso/packer-ubuntu-20.04.img \
  --data memory=4096 \
  --data agent=1

curl using API to convert to template:

curl -v -k -X POST "https://$PROXMOX_HOST:8006/api2/json/nodes/$NODE_NAME/qemu/9001/template" \
-H "Cookie: PVEAuthCookie=$ticket" \
-H "CSRFPreventionToken: $csrf_token" \

Software:

Foreman 3.9.3
Foreman_fog_proxmox 0.16.3

To Reproduce
Steps to reproduce the behavior:

  1. click on hosts->create hosts
  2. Host: Set Organization, Location, and Deploy On proxmox host.
  3. Virtual machine: Leave everything default.
  4. Operating system: Set Arch to x86_64, OS to appropriate OS, Provisioning method => Image Based
  5. Interfaces: Set domain, subnet, and receive an IP
  6. Click Submit and be excited it worked
  7. Check console of VM only to be confused as to why it can't find a boot device

Expected behavior
Server spins up in Proxmox and the disk is based on/cloned from selected image.

Screenshots
foreman triggered clone:

()
create full clone of drive ide2 (packer-images:9001/vm-9001-cloudinit.qcow2)
Formatting '/data-zfs/packer-images/images/108/vm-108-cloudinit.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off preallocation=metadata compression_type=zlib size=4194304 lazy_refcounts=off refcount_bits=16
create linked clone of drive virtio0 (packer-images:9001/base-9001-disk-0.raw)
clone 9001/base-9001-disk-0.raw: images, vm-108-disk-0.qcow2, 108 to vm-108-disk-0.qcow2 (base=../9001/base-9001-disk-0.raw)
Formatting '/data-zfs/packer-images/images/108/vm-108-disk-0.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=5242880000 backing_file=../9001/base-9001-disk-0.raw backing_fmt=raw lazy_refcounts=off refcount_bits=16
TASK OK

foreman triggered configure:

update VM 108: -agent 1 -bios seabios -cores 2 -cpu cputype=kvm64 -kvm 1 -memory 10240 -name myra-fadden.totallyrealdomainname.com -net0 model=e1000,bridge=vmbr0,firewall=0,link_down=0 -ostype l26 -scsihw virtio-scsi-pci -sockets 1 -vga std -virtio0 packer-images:8,cache=none
Formatting '/data-zfs/packer-images/images/108/vm-108-disk-1.raw', fmt=raw size=8589934592 preallocation=off
virtio0: successfully created disk 'packer-images:108/vm-108-disk-1.raw,cache=none,size=8G'
TASK OK

Desktop (please complete the following information):

  • OS: macOS Sonoma 14.7.1
  • Browser Chrome
  • Version 131.0.6778.86

Additional context
If I clone the template inside of Proxmox it behaves as expected. I attached a recovery cd to the VM and found the drive was blank, no partitions, no data.

I feel like I am missing something and this should work.

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

1 participant