ddelnano / packer-plugin-xenserver

A builder plugin for Packer.IO to support building XenServer images.
Mozilla Public License 2.0
76 stars 37 forks source link

xenserver-iso.ubuntu-2004: Error detecting local IP: ssh: handshake failed #30

Open GreenUkr opened 2 years ago

GreenUkr commented 2 years ago

Hello. Any time I tried to build vm (ubuntu and centos) I got the same error: xenserver-iso.ubuntu-2004: Error detecting local IP: ssh: handshake failed

2021/11/21 05:47:34 packer-plugin-xenserver_v0.3.2_x5.0_linux_amd64 plugin: 2021/11/21 05:47:34 Attached VDI 'e738461b-5d42-4471-9b5d-dcbe28095b34'
2021/11/21 05:47:37 ui: ==> xenserver-iso.ubuntu-2004: Step: Set SSH address to VM host IP
2021/11/21 05:47:37 ui: ==> xenserver-iso.ubuntu-2004: Set host SSH address to '<sensitive>'.
2021/11/21 05:47:37 ui: ==> xenserver-iso.ubuntu-2004: Unpausing VM 41dc3e4f-f9be-9dd6-0baa-d2fa79ec9ba4
2021/11/21 05:47:37 ui: ==> xenserver-iso.ubuntu-2004: Waiting 10s for boot...
2021/11/21 05:47:47 ui: ==> xenserver-iso.ubuntu-2004: Connecting to the VM console VNC over xapi via <sensitive>
2021/11/21 05:47:47 ui: ==> xenserver-iso.ubuntu-2004: Making HTTP request to initiate VNC connection: CONNECT /console?uuid=0de15564-b473-d884-efc9-7de9b9ab2f37 HTTP/1.0
==> xenserver-iso.ubuntu-2004: Host: <sensitive>
==> xenserver-iso.ubuntu-2004: Cookie: session_id=OpaqueRef:c44a7a32-5d2d-497a-baec-b278154c5aa2
==> xenserver-iso.ubuntu-2004: 
==> xenserver-iso.ubuntu-2004:
2021/11/21 05:47:47 ui: ==> xenserver-iso.ubuntu-2004: Received response: HTTP/1.1 200 OK
==> xenserver-iso.ubuntu-2004: Connection: keep-alive
==> xenserver-iso.ubuntu-2004: Cache-Control: no-cache, no-store
2021/11/21 05:47:47 packer-plugin-xenserver_v0.3.2_x5.0_linux_amd64 plugin: 2021/11/21 05:47:47 Connected to the VNC console: QEMU
2021/11/21 05:47:47 ui error: ==> xenserver-iso.ubuntu-2004: Error detecting local IP: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain
2021/11/21 05:47:47 ui: ==> xenserver-iso.ubuntu-2004: Deleting output directory...
2021/11/21 05:47:47 [INFO] (telemetry) ending xenserver-iso.ubuntu-2004
2021/11/21 05:47:47 ui error: Build 'xenserver-iso.ubuntu-2004' errored after 30 seconds 855 milliseconds: Build was halted.
2021/11/21 05:47:47 Waiting on builds to complete...
2021/11/21 05:47:47 ui: 
==> Wait completed after 30 seconds 856 milliseconds
2021/11/21 05:47:47 machine readable: error-count []string{"1"}
2021/11/21 05:47:47 ui error: 
==> Some builds didn't complete successfully and had errors:
2021/11/21 05:47:47 machine readable: xenserver-iso.ubuntu-2004,error []string{"Build was halted."}
2021/11/21 05:47:47 ui error: --> xenserver-iso.ubuntu-2004: Build was halted.
2021/11/21 05:47:47 ui: 
==> Builds finished but no artifacts were created.

May be this error forced by using bond network on my xenserver

ddelnano commented 2 years ago

@GreenUkr can you explain your Xenserver networking setup in more detail? Are you able to ssh to a VM running on your Xenserver deployment using password auth? That is the only supported auth at the moment.

This might be easier to discuss if you join the Discord mentioned in the project's README

GreenUkr commented 2 years ago

Thank you for fast answer. Here is output 'ip a' and 'xe network-list'

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master ovs-system state UP group default qlen 1000
    link/ether 0c:c4:7a:9a:90:ac brd ff:ff:ff:ff:ff:ff
3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq master ovs-system state DOWN group default qlen 1000
    link/ether 0c:c4:7a:9a:90:ad brd ff:ff:ff:ff:ff:ff
4: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 5a:1c:f2:39:26:4a brd ff:ff:ff:ff:ff:ff
5: xapi1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether 0c:c4:7a:9a:90:ac brd ff:ff:ff:ff:ff:ff
    inet 10.67.1.231/24 brd 10.67.1.255 scope global xapi1
       valid_lft forever preferred_lft forever

uuid ( RO)                : 3fcf8da9-3b91-0127-dc51-d60742d267ab
          name-label ( RW): Pool-wide network associated with eth0
              bridge ( RO): xenbr0

uuid ( RO)                : 2f49b618-6930-63ec-ba8b-14e1dbc9e767
          name-label ( RW): Pool-wide network associated with eth1
              bridge ( RO): xenbr1

uuid ( RO)                : 28ec3584-8d99-8519-497f-2d8281ce4ee2
          name-label ( RW): Host internal management network
    name-description ( RW): Network on which guests will be assigned a private link-local IP address which can be used to talk XenAPI
              bridge ( RO): xenapi

uuid ( RO)                : a4f87d60-d79d-b09a-25e9-e04b1b65a96b
          name-label ( RW): MGMT
    name-description ( RW): Default bond
              bridge ( RO): xapi1

But. I solved my problem without packer (built ISO anyway is much bige than ubuntu vloud image). I used .ova import xe cli command and after that create from template with cloud-init file.