Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

vsphere-iso: error when uploading floppy image "A specified parameter is not correct: spec.url" #269

Open
invartam opened this issue Sep 4, 2019 · 4 comments

Comments

@invartam
Copy link

invartam commented Sep 4, 2019

Hello,

I am trying to build a vsphere template from an iso using the builder "vsphere-iso".
When I build my template, I have the following issue :

2019/09/04 16:19:07 Detected home directory from env var: /Users/benjy
2019/09/04 16:19:07 Setting cache directory: /Users/benjy/local/src/perso/infra-kube/packer_cache
2019/09/04 16:19:07 Detected home directory from env var: /Users/benjy
2019/09/04 16:19:07 Loading builder: vsphere-iso
2019/09/04 16:19:07 Creating plugin client for path: /Users/benjy/.packer.d/plugins/packer-builder-vsphere-iso
2019/09/04 16:19:07 Starting plugin: /Users/benjy/.packer.d/plugins/packer-builder-vsphere-iso []string{"/Users/benjy/.packer.d/plugins/packer-builder-vsphere-iso"}
2019/09/04 16:19:07 Waiting for RPC address for: /Users/benjy/.packer.d/plugins/packer-builder-vsphere-iso
2019/09/04 16:19:07 packer-builder-vsphere-iso: 2019/09/04 16:19:07 Plugin minimum port: 10000
2019/09/04 16:19:07 packer-builder-vsphere-iso: 2019/09/04 16:19:07 Plugin maximum port: 25000
2019/09/04 16:19:07 packer-builder-vsphere-iso: 2019/09/04 16:19:07 Plugin address: unix /var/folders/lm/zt_9zrtn2l7dx6wl4m6kpwwm0000gn/T/packer-plugin412181951
2019/09/04 16:19:07 packer-builder-vsphere-iso: 2019/09/04 16:19:07 Waiting for connection...
2019/09/04 16:19:07 packer-builder-vsphere-iso: 2019/09/04 16:19:07 Serving a plugin connection...
2019/09/04 16:19:07 Build debug mode: false
2019/09/04 16:19:07 Force build: false
vsphere-iso output will be in this color.
2019/09/04 16:19:07 On error:
 
2019/09/04 16:19:07 Preparing build: vsphere-iso
2019/09/04 16:19:07 Waiting on builds to complete...
2019/09/04 16:19:07 Starting build run: vsphere-iso
2019/09/04 16:19:07 Running builder: vsphere-iso
2019/09/04 16:19:07 [INFO] (telemetry) Starting builder vsphere-iso
==> vsphere-iso: Creating VM...
==> vsphere-iso: Customizing hardware...
==> vsphere-iso: Mount ISO images...
==> vsphere-iso: Creating floppy disk...
2019/09/04 16:19:10 packer-builder-vsphere-iso: 2019/09/04 16:19:10 Floppy path: /var/folders/lm/zt_9zrtn2l7dx6wl4m6kpwwm0000gn/T/packer718629394
2019/09/04 16:19:10 packer-builder-vsphere-iso: 2019/09/04 16:19:10 Initializing block device backed by temporary file
2019/09/04 16:19:10 packer-builder-vsphere-iso: 2019/09/04 16:19:10 Formatting the block device with a FAT filesystem...
2019/09/04 16:19:10 packer-builder-vsphere-iso: 2019/09/04 16:19:10 Initializing FAT filesystem on block device
2019/09/04 16:19:10 packer-builder-vsphere-iso: 2019/09/04 16:19:10 Reading the root directory from the filesystem
    vsphere-iso: Copying files flatly from floppy_files
    vsphere-iso: Done copying files from floppy_files
    vsphere-iso: Collecting paths from floppy_dirs
    vsphere-iso: Resulting paths from floppy_dirs : [/Users/benjy/local/src/perso/infra-kube/packer-floppy]
    vsphere-iso: Recursively copying : /Users/benjy/local/src/perso/infra-kube/packer-floppy
    vsphere-iso: Done copying paths from floppy_dirs
==> vsphere-iso: Uploading created floppy image
2019/09/04 16:19:10 packer-builder-vsphere-iso: 2019/09/04 16:19:10 Deleting floppy disk: /var/folders/lm/zt_9zrtn2l7dx6wl4m6kpwwm0000gn/T/packer718629394
==> vsphere-iso: Destroying VM...
2019/09/04 16:19:11 [INFO] (telemetry) ending vsphere-iso
2019/09/04 16:19:11 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2019/09/04 16:19:11 machine readable: vsphere-iso,error []string{"ServerFaultCode: A specified parameter was not correct: spec.url"}
Build 'vsphere-iso' errored: ServerFaultCode: A specified parameter was not correct: spec.url
 
==> Builds finished but no artifacts were created.
==> Some builds didn't complete successfully and had errors:
2019/09/04 16:19:11 [INFO] (telemetry) Finalizing.
--> vsphere-iso: ServerFaultCode: A specified parameter was not correct: spec.url
 
==> Builds finished but no artifacts were created.
2019/09/04 16:19:12 waiting for all plugin processes to complete...
2019/09/04 16:19:12 /Users/benjy/.packer.d/plugins/packer-builder-vsphere-iso: plugin process exited

I saw on vmware kb (https://kb.vmware.com/s/article/2078709) that it might be a problem with TLS certificate of my esxi host. I tried to regenerate it but it doesn't work.

Can you help me to solve this issue ?

Here is the json file I am trying to build:

    {
        "variables": {
            "vsphere_user": "",
            "vsphere_pass": "",
            "vsphere_fqdn": "",
            "vsphere_datacenter": "",
            "vsphere_host": ""
        },
        "builders": [{
            "type": "vsphere-iso",

            "vcenter_server": "{{user `vsphere_fqdn`}}",
            "username": "{{user `vsphere_user`}}",
            "password": "{{user `vsphere_pass`}}",
            "insecure_connection": true,
            "datacenter": "{{user `vsphere_datacenter`}}",
            "host": "{{user `vsphere_host`}}",

            "vm_name": "ubuntu-1804-base",
            "guest_os_type": "ubuntu64Guest",
            "firmware": "efi",
            "convert_to_template": true,
            "CPUs": 1,
            "RAM": 2048,
            "disk_controller_type":  "pvscsi",
            "disk_size": 32768,
            "disk_thin_provisioned": true,
            "network": "admin",
            "network_card": "e1000e",

            "iso_paths": [
                "[datastore1] iso/ubuntu-18.04.2-live-server-amd64.iso"
            ],

            "floppy_dirs": [
                "{{template_dir}}/packer-floppy"
            ],

            "boot_command": [
                "<enter><wait><f6><wait><esc><wait>",
                "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
                "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
                "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
                "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
                "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
                "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
                "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
                "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
                "<bs><bs><bs>",
                "/install/vmlinuz",
                " initrd=/install/initrd.gz",
                " priority=critical",
                " locale=fr_FR",
                " file=/media/preseed.cfg",
                "<enter>"
            ],

            "communicator": "ssh",
            "ssh_username": "user",
            "ssh_password": "user"
        }]
    }

Thank you,
Benjy

@aaceimmrttu
Copy link

aaceimmrttu commented Oct 1, 2019

@invartam I found that changing "host": "{{user vsphere_host}}", to "resource_pool": "", works for me

*edit "resource_pool": "" is for the default unnamed resource pool if haven't created one

@aaceimmrttu
Copy link

Duplicate of #239

@nelg
Copy link

nelg commented Oct 17, 2019

@invartam I found that changing "host": "{{user vsphere_host}}", to "resource_pool": "", works for me

*edit "resource_pool": "" is for the default unnamed resource pool if haven't created one

Works for me too.. Obscure error. We should aim to improve error message.

Removed:
"host': "vmwarehost1.mydomain",

and added:
"resource_pool": "",

@nelg
Copy link

nelg commented Oct 17, 2019

Duplicate of #239

The solution in this case is different than #239

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants