packer-plugin-xenserver icon indicating copy to clipboard operation
packer-plugin-xenserver copied to clipboard

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

Open Antonynixson opened this issue 6 years ago • 3 comments

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.

Antonynixson avatar Jul 03 '19 05:07 Antonynixson

I think this is due to changes in Packer. I found a similar issue reported by someone using the vsphere builder: https://github.com/hashicorp/packer/issues/7622. I was able to get past this issue by building and using Packer 1.3.5.

Once past that issue, I found that in newer versions XenServer the xs-tools.iso was renamed to guest-tools.iso. I changed that in the packer-builder-xenserver code.

After that I found that packer-builder-xenserver also tries to use xenstore-read to determine the VNC port. Newer versions of XenServer don't support xenstore-read. I used this hack to get past that issue: https://github.com/ctlam/packer-builder-xenserver/commit/1eb6ef0bba4f56858ab41aeb89371b1b5d0d4730.

The issue I have now a VNC version mismatch. I don't think is insurmountable, just that I haven't tried to work around it yet.

2019/11/14 23:57:54 ui error: ==> xenserver-iso: Error establishing VNC session: unsupported minor version, less than 8: 3 ==> xenserver-iso: Error establishing VNC session: unsupported minor version, less than 8: 3

I'm new to XenServer. I've been playing around with XCP-ng and Xen Orchestra for about 2 weeks. I really like what I've seen so far, but I'm not sure if Xen is falling out of favor? Maybe there isn't much interest in maintaining this plugin or there are better alternatives than using Packer.

zymurgy avatar Nov 15 '19 06:11 zymurgy

If you check the ISO link what your config file contains, the file not found. Try to use another mirrorlink for the ISO.

PoOwAa avatar Dec 10 '19 11:12 PoOwAa

Hello @zymurgy I am planning to give this a try and see if i can fix it(provided the issue is still occuring)

kirannhegde avatar Dec 18 '19 05:12 kirannhegde