hashicorp / packer-plugin-proxmox

Packer plugin for Proxmox Builder
https://www.packer.io/docs/builders/proxmox
Mozilla Public License 2.0
154 stars 67 forks source link

packer creating a template in proxmox environment is giving errors. #21

Open ghost opened 3 years ago

ghost commented 3 years ago

This issue was originally opened by @AkhilaGarlapally as hashicorp/packer#11071. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


When filing a bug, please include the following headings if possible. Any example text in this template can be deleted.

Overview of the Issue

facing error as proxmox: Error creating VM: Error creating VM: 400 Parameter verification failed., error status: {"errors":{"net0":"invalid format - unable to parse network options\n","scsi0":"invalid format - unable to parse drive options\n"},"data":null} (params: map[agent:0 boot: cores:2 cpu:kvm64 description:Packer ephemeral build VM hotplug: ide2:local:iso/CentOS-8.3.2011-x86_64-dvd1.iso,media=cdrom kvm:false memory:2048 name:packer-60be4925-9e43-cbc6-b9d2-3266279a731c net0:e1000=D2:08:62:1A:5F:E2,bridge=vmbr0,tag=10,firewall=false numa:false onboot:false ostype:l26 scsi0:vmpool:8,iothread=false scsihw:lsi sockets:1 tags: vmid:106])

Reproduction Steps

Steps to reproduce this issue

Packer version

I'm using packer 1.7.2

Simplified Packer Buildfile

I have taken the sample template from a github and have modified the variable according to our environment. Below is the input json file "builders": [ { "type": "proxmox", "username": "{{user proxmox_username}}", "password": "{{user proxmox_password}}", "proxmox_url": "{{ user proxmox_url}}", "insecure_skip_tls_verify": true, "node": "{{user proxmox_node}}", "os": "l26", "boot_command": [ " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg" ], "network_adapters": [ { "bridge": "vmbr0", "model": "e1000", "vlan_tag": 10 } ], "disks": [ { "type": "scsi", "disk_size": "8G", "storage_pool": "{{user proxmox_storage_pool}}", "storage_pool_type": "{{user proxmox_storage_pool_type}}", "format": "{{user proxmox_storage_format}}", "cache_mode": "none" } ], "scsi_controller": "lsi", "iso_file": "{{user proxmox_iso_pool}}/{{user centos_image}}", "boot_wait": "10s", "cores": "2", "memory": "2048", "http_directory": "centos7", "ssh_username": "root", "ssh_password": "Packer", "ssh_port": 22, "ssh_timeout": "15m", "unmount_iso": true, "template_name": "{{user template_name}}", "template_description": "{{user template_description}}", "qemu_agent": false, "disable_kvm": true

}

], "provisioners": [ { "type": "shell", "inline": [ "yum install -y cloud-init qemu-guest-agent cloud-utils-growpart gdisk", "shred -u /etc/ssh/_key /etc/ssh/_key.pub", "rm -f /var/run/utmp", ">/var/log/lastlog", ">/var/log/wtmp", ">/var/log/btmp", "rm -rf /tmp/ /var/tmp/", "unset HISTFILE; rm -rf /home//.history /root/.history", "rm -f /root/ks", "passwd -d root", "passwd -l root" ], "only": ["proxmox"] } ] }

Operating system and Environment details

we are using proxmox 4.1 version and i'm trying to build centos

sylviamoss commented 3 years ago

@AkhilaGarlapally moving the conversation to the right place, you can get more logs setting PACKER_LOG=1. Then you can share the output logs with us here.

karliemeads commented 3 years ago

Hi @AkhilaGarlapally,

It looks like you have vlan_tag as an integer. It should be a string as seen in the documentation https://www.packer.io/docs/builders/proxmox/iso#vlan_tag

Your second error (drive formatting) is difficult to diagnose without knowing the value of the user variables. In particular, you should look at proxmox_storage_format and verify it meets the possible values from the documentation https://www.packer.io/docs/builders/proxmox/iso#format.

chris-aeviator commented 2 years ago

the VM will not boot without the ks.cfg file provided via the http_directory file. Unfort. the ks.cfg appears in the docs, but is not part of this repository.