Skip to content

xenserver-iso: Error downloading: open : no such file or directory #98

Description

@Antonynixson

Hello all,

I'm trying to build a "vdi_vhd" image using packer on xenserver, but i have got the below error, i really don't know which is wrong, could you please anyone help me on this,
Thanks in advance.

Error

[root@localhost bin]# packer build /usr/local/test-scripts/main.json
   xenserver-iso output will be in this color.
   
   ==> xenserver-iso: XAPI client session established
   ==> xenserver-iso: Downloading or copying ISO
       xenserver-iso: Downloading or copying: http://www.mirrorservice.org/sites/mirror.centos.org/7.6.1810/isos/x86_64/CentOS-7-x86_64-Minimal-1810.iso
       xenserver-iso: Error downloading: open : no such file or directory
   ==> xenserver-iso: ISO download failed. Build 'xenserver-iso' errored: ISO download failed.
   
   ==> Some builds didn't complete successfully and had errors:
   --> xenserver-iso: ISO download failed.
   
   ==> Builds finished but no artifacts were created.

error

These are the steps i used to install packer

    mkdir -p /usr/local/packer/
    cd /usr/local/packer/
    wget https://releases.hashicorp.com/packer/1.4.1/packer_1.4.1_linux_amd64.zip
    unzip packer_1.4.1_linux_amd64.zip
    vim ~/.bashrc
    ##added the below
    export PATH=/usr/local/packer/:$PATH
    ##save and exit
    sudo ln -s /usr/local/packer/packer /usr/bin/packer
    source ~/.bashrc

These are the steps i used to install xenserver-iso plugin


    RELEASE="go1.12.6.linux-amd64.tar.gz";
    cd /tmp && curl -L -O "https://dl.google.com/go/${RELEASE}";
    tar -zxvf "${RELEASE}";
    mv -v go $HOME/go-1.12.6;
    rm -f "/tmp/${RELEASE}";
    vim ~/.bashrc
    ##added the below
    export GOROOT=$HOME/go-1.12.6;
    export GOPATH=$HOME/go-workspace;
    export PATH=$PATH:$GOROOT/bin:$GOPATH/bin;
    ##save and exit
    
    source ~/.bashrc
    mkdir -p $GOPATH/src/github.com/hashicorp/packer;
    cd $GOPATH/src/github.com/hashicorp/packer;
    go get github.com/mitchellh/gox;
    go get github.com/mitchellh/go-vnc;
    cd $GOPATH;
    PROV="src/github.com/xenserver";
    mkdir -p $PROV && cd $PROV;
    git clone https://github.com/xenserver/packer-builder-xenserver.git;
    cd packer-builder-xenserver;
    ./build.sh;

Verify plugin

[root@localhost bin]# ll
    total 34732
    -rwxr-xr-x. 1 root root 17813736 Jul  2 12:04 packer-builder-xenserver-iso
    -rwxr-xr-x. 1 root root 17747856 Jul  2 12:04 packer-builder-xenserver-xva
    [root@localhost bin]# pwd
    /root/go-workspace/src/github.com/xenserver/packer-builder-xenserver/bin
    [root@localhost bin]#

NOTE: I've installed packer and xenserver plugin on my Virtual-box local server


{
      "builders": [
        {
          "iso_checksum": "38d5d51d9d100fd73df031ffd6bd8b1297ce24660dc8c13a3b8b4534a4bd291c",
          "iso_checksum_type": "sha256",
          "iso_url": "{{user `mirror`}}/7.6.1810/isos/x86_64/CentOS-7-x86_64-Minimal-1810.iso",
          "output_directory": "CentOS-7-x86_64-xenserver-minimal",
          "format": "vdi_vhd",
          "remote_host": "192.1XX.XX.XX",
          "remote_password": "XXXXX",
          "remote_username": "root",
          "shutdown_command": "/sbin/halt",
          "ssh_password": "XXXXX",
          "ssh_username": "root",
          "ssh_wait_timeout": "10000s",
          "type": "xenserver-iso",
          "vm_name": "packer-centos-7.6-x86_64"
        }
      ],
      "variables": {
        "mirror": "http://www.mirrorservice.org/sites/mirror.centos.org"
      }
    }

Above is the packer code which i used.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions