hashicorp / packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.
http://www.packer.io
Other
15.12k stars 3.33k forks source link

Proxmox VE - Guest OS unable to find hard disk #7845

Closed vikas027 closed 5 years ago

vikas027 commented 5 years ago

Environment

OS: Mac OS X 10.14.5 (18F132) Packer: v1.4.1 Proxmox VE: v5.4.3 Guest OS: CentOS Linux 7 1810 x86_64

Problem

Hard disk created by packer is not detected by the CentOS operating system. I have even tried to boot the same OS manually, even then CentOS could not detect the disk.

Error from Kickstart File

2019-07-05_20-10-56

Error when I rebooted the same VM

2019-07-05_20-13-05

Packer File and Log

Debug Log

$ PACKER_LOG=1 packer build templates/centos7_proxmox.json
2019/07/05 20:08:26 [INFO] Packer version: 1.4.1
2019/07/05 20:08:26 Packer Target OS/Arch: darwin amd64
2019/07/05 20:08:26 Built with Go Version: go1.12.5
2019/07/05 20:08:26 Detected home directory from env var: /Users/vikas
2019/07/05 20:08:26 Using internal plugin for amazon-ebssurrogate
2019/07/05 20:08:26 Using internal plugin for oneandone
2019/07/05 20:08:26 Using internal plugin for oracle-classic
2019/07/05 20:08:26 Using internal plugin for lxd
2019/07/05 20:08:26 Using internal plugin for oracle-oci
2019/07/05 20:08:26 Using internal plugin for yandex
2019/07/05 20:08:26 Using internal plugin for amazon-ebs
2019/07/05 20:08:26 Using internal plugin for azure-arm
2019/07/05 20:08:26 Using internal plugin for cloudstack
2019/07/05 20:08:26 Using internal plugin for vmware-vmx
2019/07/05 20:08:26 Using internal plugin for amazon-chroot
2019/07/05 20:08:26 Using internal plugin for docker
2019/07/05 20:08:26 Using internal plugin for profitbricks
2019/07/05 20:08:26 Using internal plugin for scaleway
2019/07/05 20:08:26 Using internal plugin for vagrant
2019/07/05 20:08:26 Using internal plugin for vmware-iso
2019/07/05 20:08:26 Using internal plugin for amazon-ebsvolume
2019/07/05 20:08:26 Using internal plugin for googlecompute
2019/07/05 20:08:26 Using internal plugin for lxc
2019/07/05 20:08:26 Using internal plugin for virtualbox-ovf
2019/07/05 20:08:26 Using internal plugin for ncloud
2019/07/05 20:08:26 Using internal plugin for null
2019/07/05 20:08:26 Using internal plugin for parallels-pvm
2019/07/05 20:08:26 Using internal plugin for tencentcloud-cvm
2019/07/05 20:08:26 Using internal plugin for virtualbox-iso
2019/07/05 20:08:26 Using internal plugin for amazon-instance
2019/07/05 20:08:26 Using internal plugin for digitalocean
2019/07/05 20:08:26 Using internal plugin for proxmox
2019/07/05 20:08:26 Using internal plugin for openstack
2019/07/05 20:08:26 Using internal plugin for qemu
2019/07/05 20:08:26 Using internal plugin for alicloud-ecs
2019/07/05 20:08:26 Using internal plugin for hyperone
2019/07/05 20:08:26 Using internal plugin for hyperv-iso
2019/07/05 20:08:26 Using internal plugin for linode
2019/07/05 20:08:26 Using internal plugin for parallels-iso
2019/07/05 20:08:26 Using internal plugin for triton
2019/07/05 20:08:26 Using internal plugin for file
2019/07/05 20:08:26 Using internal plugin for hcloud
2019/07/05 20:08:26 Using internal plugin for hyperv-vmcx
2019/07/05 20:08:26 Using internal plugin for powershell
2019/07/05 20:08:26 Using internal plugin for ansible-local
2019/07/05 20:08:26 Using internal plugin for chef-client
2019/07/05 20:08:26 Using internal plugin for file
2019/07/05 20:08:26 Using internal plugin for puppet-server
2019/07/05 20:08:26 Using internal plugin for salt-masterless
2019/07/05 20:08:26 Using internal plugin for sleep
2019/07/05 20:08:26 Using internal plugin for converge
2019/07/05 20:08:26 Using internal plugin for puppet-masterless
2019/07/05 20:08:26 Using internal plugin for shell-local
2019/07/05 20:08:26 Using internal plugin for inspec
2019/07/05 20:08:26 Using internal plugin for shell
2019/07/05 20:08:26 Using internal plugin for windows-restart
2019/07/05 20:08:26 Using internal plugin for windows-shell
2019/07/05 20:08:26 Using internal plugin for ansible
2019/07/05 20:08:26 Using internal plugin for breakpoint
2019/07/05 20:08:26 Using internal plugin for chef-solo
2019/07/05 20:08:26 Using internal plugin for alicloud-import
2019/07/05 20:08:26 Using internal plugin for manifest
2019/07/05 20:08:26 Using internal plugin for vsphere
2019/07/05 20:08:26 Using internal plugin for artifice
2019/07/05 20:08:26 Using internal plugin for checksum
2019/07/05 20:08:26 Using internal plugin for docker-import
2019/07/05 20:08:26 Using internal plugin for googlecompute-import
2019/07/05 20:08:26 Using internal plugin for shell-local
2019/07/05 20:08:26 Using internal plugin for docker-save
2019/07/05 20:08:26 Using internal plugin for googlecompute-export
2019/07/05 20:08:26 Using internal plugin for vagrant
2019/07/05 20:08:26 Using internal plugin for vagrant-cloud
2019/07/05 20:08:26 Using internal plugin for vsphere-template
2019/07/05 20:08:26 Using internal plugin for amazon-import
2019/07/05 20:08:26 Using internal plugin for compress
2019/07/05 20:08:26 Using internal plugin for digitalocean-import
2019/07/05 20:08:26 Using internal plugin for docker-push
2019/07/05 20:08:26 Using internal plugin for docker-tag
2019/07/05 20:08:26 Detected home directory from env var: /Users/vikas
2019/07/05 20:08:26 Attempting to open config file: /Users/vikas/.packerconfig
2019/07/05 20:08:26 [WARN] Config file doesn't exist: /Users/vikas/.packerconfig
2019/07/05 20:08:26 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[alicloud-ecs:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-alicloud-ecs amazon-chroot:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-chroot amazon-ebs:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebs amazon-ebssurrogate:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebssurrogate amazon-ebsvolume:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebsvolume amazon-instance:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-instance azure-arm:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-azure-arm cloudstack:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-cloudstack digitalocean:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-digitalocean docker:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-docker file:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-file googlecompute:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-googlecompute hcloud:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hcloud hyperone:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hyperone hyperv-iso:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hyperv-iso hyperv-vmcx:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hyperv-vmcx linode:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-linode lxc:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-lxc lxd:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-lxd ncloud:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-ncloud null:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-null oneandone:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oneandone openstack:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-openstack oracle-classic:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oracle-classic oracle-oci:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oracle-oci parallels-iso:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-iso parallels-pvm:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-pvm profitbricks:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-profitbricks proxmox:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-proxmox qemu:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-qemu scaleway:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-scaleway tencentcloud-cvm:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-tencentcloud-cvm triton:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-triton vagrant:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vagrant virtualbox-iso:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-iso virtualbox-ovf:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-ovf vmware-iso:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-iso vmware-vmx:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-vmx yandex:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-yandex] PostProcessors:map[alicloud-import:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-alicloud-import amazon-import:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-amazon-import artifice:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-artifice checksum:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-checksum compress:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-compress digitalocean-import:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-digitalocean-import docker-import:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-import docker-push:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-push docker-save:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-save docker-tag:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-tag googlecompute-export:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-googlecompute-export googlecompute-import:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-googlecompute-import manifest:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-manifest shell-local:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-shell-local vagrant:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant vagrant-cloud:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant-cloud vsphere:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vsphere vsphere-template:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vsphere-template] Provisioners:map[ansible:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible ansible-local:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible-local breakpoint:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-breakpoint chef-client:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-client chef-solo:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-solo converge:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-converge file:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-file inspec:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-inspec powershell:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-powershell puppet-masterless:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-masterless puppet-server:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-server salt-masterless:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-salt-masterless shell:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell shell-local:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell-local sleep:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-sleep windows-restart:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-restart windows-shell:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-shell]}
2019/07/05 20:08:26 Detected home directory from env var: /Users/vikas
2019/07/05 20:08:26 Setting cache directory: /MY_STUFF/packer_cache
2019/07/05 20:08:26 Detected home directory from env var: /Users/vikas
2019/07/05 20:08:26 [ERR] Checkpoint error: EOF
2019/07/05 20:08:26 Loading builder: proxmox
2019/07/05 20:08:26 Plugin could not be found. Checking same directory as executable.
2019/07/05 20:08:26 Current exe path: /usr/local/bin/packer
2019/07/05 20:08:26 Creating plugin client for path: /usr/local/bin/packer
2019/07/05 20:08:26 Starting plugin: /usr/local/bin/packer []string{"/usr/local/bin/packer", "plugin", "packer-builder-proxmox"}
2019/07/05 20:08:26 Waiting for RPC address for: /usr/local/bin/packer
2019/07/05 20:08:26 packer: 2019/07/05 20:08:26 [INFO] Packer version: 1.4.1
2019/07/05 20:08:26 packer: 2019/07/05 20:08:26 Packer Target OS/Arch: darwin amd64
2019/07/05 20:08:26 packer: 2019/07/05 20:08:26 Built with Go Version: go1.12.5
2019/07/05 20:08:26 packer: 2019/07/05 20:08:26 Detected home directory from env var: /Users/vikas
2019/07/05 20:08:26 packer: 2019/07/05 20:08:26 Attempting to open config file: /Users/vikas/.packerconfig
2019/07/05 20:08:26 packer: 2019/07/05 20:08:26 [WARN] Config file doesn't exist: /Users/vikas/.packerconfig
2019/07/05 20:08:26 packer: 2019/07/05 20:08:26 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[] PostProcessors:map[] Provisioners:map[]}
2019/07/05 20:08:26 packer: 2019/07/05 20:08:26 Detected home directory from env var: /Users/vikas
2019/07/05 20:08:26 packer: 2019/07/05 20:08:26 Detected home directory from env var: /Users/vikas
2019/07/05 20:08:26 packer: 2019/07/05 20:08:26 Setting cache directory: /MY_STUFF/packer_cache
2019/07/05 20:08:26 packer: 2019/07/05 20:08:26 [ERR] Checkpoint error: EOF
2019/07/05 20:08:26 packer: 2019/07/05 20:08:26 args: []string{"packer-builder-proxmox"}
2019/07/05 20:08:26 packer: 2019/07/05 20:08:26 Plugin minimum port: 10000
2019/07/05 20:08:26 packer: 2019/07/05 20:08:26 Plugin maximum port: 25000
2019/07/05 20:08:26 packer: 2019/07/05 20:08:26 Plugin address: unix /var/folders/r8/sppjg0tx2j9d0gnf9_9bplt00000gn/T/packer-plugin702292695
2019/07/05 20:08:26 packer: 2019/07/05 20:08:26 Waiting for connection...
2019/07/05 20:08:26 packer: 2019/07/05 20:08:26 Serving a plugin connection...
2019/07/05 20:08:26 Build debug mode: false
2019/07/05 20:08:26 Force build: false
2019/07/05 20:08:26 On error: 
proxmox output will be in this color.
2019/07/05 20:08:26 Preparing build: proxmox

2019/07/05 20:08:26 packer: 2019/07/05 20:08:26 Number of sockets 0 is too small, using default: 1
2019/07/05 20:08:26 packer: 2019/07/05 20:08:26 NIC 0 model not set, using default 'e1000'
2019/07/05 20:08:26 packer: 2019/07/05 20:08:26 Disk 0 cache mode not set, using default 'none'
2019/07/05 20:08:26 Waiting on builds to complete...
2019/07/05 20:08:26 Starting build run: proxmox
2019/07/05 20:08:26 Running builder: proxmox
2019/07/05 20:08:26 [INFO] (telemetry) Starting builder proxmox
==> proxmox: Creating VM
==> proxmox: Starting VM
2019/07/05 20:08:29 packer: 2019/07/05 20:08:29 Found available port: 8689 on IP: 0.0.0.0
==> proxmox: Starting HTTP server on port 8689
==> proxmox: Waiting 10s for boot
==> proxmox: Typing the boot command
2019/07/05 20:08:48 packer: 2019/07/05 20:08:48 [INFO] Waiting 1s
2019/07/05 20:08:54 packer: 2019/07/05 20:08:54 [DEBUG] Unable to get address during connection step: 500 QEMU guest agent is not running
2019/07/05 20:08:54 packer: 2019/07/05 20:08:54 [INFO] Waiting for SSH, up to timeout: 1h0m0s
==> proxmox: Waiting for SSH to become available...
2019/07/05 20:08:57 packer: 2019/07/05 20:08:57 [DEBUG] Error getting SSH address: 500 QEMU guest agent is not running
2019/07/05 20:09:05 packer: 2019/07/05 20:09:05 [DEBUG] Error getting SSH address: 500 QEMU guest agent is not running
2019/07/05 20:09:13 packer: 2019/07/05 20:09:13 [DEBUG] Error getting SSH address: 500 QEMU guest agent is not running
2019/07/05 20:09:21 packer: 2019/07/05 20:09:21 [DEBUG] Error getting SSH address: 500 QEMU guest agent is not running

Packer Template

{
  "variables": {
    "proxmox_user": "root@pam",
    "proxmox_pass": "password",
    "ssh_name": "vagrant",
    "ssh_pass": "password",
    "hostname": "centos7",
    "iso_file": "local:iso/CentOS-7-x86_64-DVD-1810.iso"
  },
  "builders": [
    {
      "type": "proxmox",
      "proxmox_url": "https://192.168.0.28:8006/api2/json",
      "insecure_skip_tls_verify": true,
      "username": "{{user `proxmox_user`}}",
      "password": "{{user `proxmox_pass`}}",
      "node": "proxmox",
      "os": "l26",
      "network_adapters": [
        {
          "bridge": "vmbr0"
        }
      ],
      "disks": [
        {
          "type": "scsi",
          "disk_size": "20G",
          "storage_pool": "local-lvm",
          "storage_pool_type": "lvm"
        }
      ],
      "memory": 2500,
      "vm_name": "packer-centos-7-base",
      "vm_id": 101,
      "cores": 1,
      "iso_file": "{{user `iso_file`}}",
      "http_directory": "http",
      "boot_wait": "10s",
      "boot_command": [
        "<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks_centos_7_proxmox.cfg<enter><wait>",
        "hostname={{user `hostname`}} "
      ],
      "ssh_username": "{{user `ssh_name`}}",
      "ssh_password": "{{user `ssh_pass`}}",
      "ssh_port": 22,
      "ssh_timeout": "60m",
      "unmount_iso": true,
      "template_name": "centos-64",
      "template_description": "CentOS 7.6, generated on {{ isotime \"2006-01-02T15:04:05Z\" }}"
    }
  ]
}

Proxmox VE Screenshots

If I create a VM manually on the Proxmox VE and create a disk, it works fine. Looks like the disk created by packer is missing something.

2019-07-05_20-13-43 2019-07-05_20-15-25 2019-07-05_20-14-59

SwampDragons commented 5 years ago

@carlpett any chance you can take a look at this?

(also, I notice that no one is in the CODEOWNERS file for the Proxmox builder; if you can't handle this can someone else at Proxmox take a look?)

carlpett commented 5 years ago

Sure, I'll have a look! I didn't know CODEOWNERS was used, but I'm fine with being there if you want :)

SwampDragons commented 5 years ago

It makes it easier for me to delegate, so I appreciate it :D . I'll add you today.

carlpett commented 5 years ago

Hi @vikas027, I've tried a few variations, but haven't been able to reproduce I'm afraid. Just to verify, I understand correctly that you are seeing the problem during the kickstart installation, not in the finished template? Could you share your kickstart file?

vikas027 commented 5 years ago

Hey @carlpett ,

Thanks for looking at it. The problem is not due to the kickstart file as even when I try to manually install the OS (after packer creates the VM template), it could find the disk. See this pic https://user-images.githubusercontent.com/6998650/60716246-35d0d280-9f62-11e9-9e5c-21998f626f8a.png

It sounds like something is not right in the disk block or the way packer is provisioning disk. Can you pls share your packer template, I will compare it against mine.

      "disks": [
        {
          "type": "scsi",
          "disk_size": "20G",
          "storage_pool": "local-lvm",
          "storage_pool_type": "lvm"
        }
      ],
carlpett commented 5 years ago

I used this template (also included the kickstart file I used for testing, link to the ISO is here), which is very similar to yours, basically just using Fedora instead of Centos. I'm using the exact same version of Proxmox and Packer. If you run the installer in cmdline mode, you should be getting an indication on what prevents it from detecting the disk, and the ability to drop to the console. From there we should be able to see what is going wrong!

vikas027 commented 5 years ago

Thanks @carlpett , This sounds a bit weird. Let me try to use your exact packer template and the ISO and see how it goes. Thanks again for your quick response. Btw are you using OS X too?

vikas027 commented 5 years ago

Hey @carlpett ,

I have checked the Fedora ISO and template shared by you, it is indeed working fine.

But somehow CentOS ISO is not working and throwing the same error. CentOS just cannot find the hard disk in the VM template.

Now, I have changed my packer template and the kickstart the same as yours. The only differences are these. Can you please try with the CentOS ISO?

🍺  ~/test$ diff kickstart/ks_fedora.cfg kickstart/ks_centos.cfg
23,26c23,24
< -@hardware-support
< -@networkmanager-submodules
<
< qemu-guest-agent
   ---
> @Base
> @Core
🍺  ~/test$

🍺  ~/test$ diff fedora.json centos.json
30c30
<       "iso_file": "local:iso/Fedora-Server-dvd-x86_64-29-1.2.iso",
---
>       "iso_file": "local:iso/CentOS-7-x86_64-DVD-1810.iso",
34c34
<         "<up><tab> ip=dhcp inst.cmdline inst.ks=http://{{.HTTPIP}}:{{.HTTPPort}}/ks_fedora.cfg<enter>"
---
>         "<up><tab> ip=dhcp inst.cmdline inst.ks=http://{{.HTTPIP}}:{{.HTTPPort}}/ks_centos.cfg<enter>"
40,41c40,41
<       "template_name": "fedora-29",
<       "template_description": "Fedora 29-1.2, generated on {{ isotime \"2006-01-02T15:04:05Z\" }}"
---
>       "template_name": "centos-64",
>       "template_description": "CentOS 7.6, generated on {{ isotime \"2006-01-02T15:04:05Z\" }}"
🍺  ~/test$
carlpett commented 5 years ago

Hm, that is indeed strange... Are you able to drop into console mode during the installation so you can check dmesg or ls /dev/? Would be really interesting to see something more detailed about what is not working. I'll try to give it a try on my setup tonight.

carlpett commented 5 years ago

@vikas027 The of that ISO with your changes to the packer and kickstart files worked for me, and cloning the template also works. What is the exact error you are seeing? If you get the screenshot you posted in the initial post, that would indicate that the VM couldn't reach the kickstart file - we're telling the installer to work in non-interactive text mode, so you shouldn't be seeing an UI at all.

vikas027 commented 5 years ago

@carlpett Ah, that is super weird. Maybe I am jinxed :(

This error is indeed after reading my kickstart file as it has the Timezone and language I have selected. Are you using Mac OS X too? That could be the only difference between our environments.

carlpett commented 5 years ago

Huh, not enough space on disk? Very strange. That seems like it should really be identical since we use the same template... I'm on Linux, so it is a difference I guess, but seems like a very strange thing to affect this.

Are you low on disk space on the Proxmox setup? I would expect it to fail immediately in that case though, rather than giving an error on partitioning.

vikas027 commented 5 years ago

Nope, nothing to do with disk space. It is a brand new Proxmox setup :)

Let me try to run packer from a Linux machine and see if that makes a difference.

vikas027 commented 5 years ago

I have tried on a Linux machine as well, still the same issue. Here are my files. Again, if I manually edit the VM, remove the disk created by packer VM template and add again, everything works.

I know what I am talking may not make much sense, but I am completely clueless why this is happening only at my end.

carlpett commented 5 years ago

Ok, running with your files as-is (or, almost, some minor network changes needed), I get the same error as you. And switching scsi to virtio disk model makes it work. I suspect there may be a driver issue/missing driver for the virtual scsi hardware in the CentOS image? I can reproduce this without packer too - if I create the VM manually in the proxmox UI and select SCSI disks, then the CentOS installer UI also cannot find the disk.

vikas027 commented 5 years ago

Ah, finally :) I will try it with virtio tomorrow. However, I could not reproduce the issue without packer.

vikas027 commented 5 years ago

Hello @carlpett ,

Switching to virtio from scsi worked like a charm. Indeed it looks like something to do with the CentOS ISO. Anyways, I am glad that I am able to get things working now.

Thanks again for your help and patience.

Cheers, Vikas

ghost commented 4 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.