SSH timeout for azure build using `custom_managed_image_name`

104 views
Skip to first unread message

eddie.m...@xplenty.com

unread,
Jan 13, 2018, 2:40:18 AM1/13/18
to Packer
  • Packer v1.1.3
  • Azure

When building with Azure images it works:

 {
    "type": "azure-arm",

    "client_id": "{{user `azure_client_id`}}",
    "client_secret": "{{user `azure_client_secret`}}",
    "subscription_id": "{{user `azure_subscription_id`}}",

    "managed_image_resource_group_name": "production-eastus",
    "managed_image_name": "{{user `stack`}}-{{user `image_tag`}}",

    "os_type": "Linux",
    "image_publisher": "OpenLogic",
    "image_offer": "CentOS",
    "image_sku": "6.9",

    "azure_tags": {
        "OS_Version": "Centos",
        "Release": "Latest",
        "Version": "{{user `version`}}",
        "Created": "{{isotime}}",
        "Vendor": "{{user `vendor`}}",
        "Vendor_Url": "{{user `vendor_url`}}",
        "Product": "{{user `product`}}",
        "Stack": "{{user `stack`}}",
        "Commit_ID": "{{user `commit_id`}}"
    },

    "location": "East US",
    "vm_size": "Standard_A2"
}

I'm using the created artifact(managed_image_name) from above build and running it to build new image:

base-2018-01-09-1515504716- is the artifact created with first build:

{
    "type": "azure-arm",

    "client_id": "{{user `azure_client_id`}}",
    "client_secret": "{{user `azure_client_secret`}}",
    "subscription_id": "{{user `azure_subscription_id`}}",

    "managed_image_resource_group_name": "production-eastus",
    "managed_image_name": "{{user `stack`}}-{{user `image_tag`}}",
    "os_type": "Linux",
    "custom_managed_image_name": "base-2018-01-09-1515504716",
    "custom_managed_image_resource_group_name": "production-eastus",

    "azure_tags": {
        "OS_Version": "Centos",
        "Release": "Latest",
        "Version": "{{user `version`}}",
        "Created": "{{isotime}}",
        "Vendor": "{{user `vendor`}}",
        "Vendor_Url": "{{user `vendor_url`}}",
        "Product": "{{user `product`}}",
        "Stack": "{{user `stack`}}",
        "Commit_ID": "{{user `commit_id`}}"
    },

    "location": "East US",
    "vm_size": "Standard_A2"
}

I get this error:

==> azure-arm: Error waiting for SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain

Running in debug mode:

packer: [INFO] Attempting SSH connection...
packer: reconnecting to TCP connection for SSH
packer: handshaking with SSH
packer: handshake error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
packer: [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
packer: [DEBUG] Detected authentication error. Increasing handshake attempts.
packer: [INFO] Attempting SSH connection...

Please assist.

Alvaro Miranda Aguilera

unread,
Jan 13, 2018, 7:46:14 AM1/13/18
to packe...@googlegroups.com
hello

some versions of rh/centos will add a persistency on the network.

i think that may be the case

can you add something like this to the end of the first (any rh/centos 5/6 vm that will be cloned and consumed later)


if [ -f /etc/udev/rules.d/70-persistent-net.rules ]; then
  rm /etc/udev/rules.d/70-persistent-net.rules
fi


alvaro



--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/6d8e4b0a-cb62-4738-9a61-611bc7e66d2a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Message has been deleted

eddie.m...@xplenty.com

unread,
Jan 13, 2018, 10:24:34 AM1/13/18
to Packer
Hey,

I've checked it and it is not the issue. I've added ls check as well:

ls: cannot access /etc/udev/rules.d/70-persistent-net.rules: No such file or directory


To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.



--
Alvaro

eddie.m...@xplenty.com

unread,
Jan 14, 2018, 9:45:37 AM1/14/18
to Packer
I could isolate it. 
This issue happens only in CentOS 6/7, when using Ubuntu for instance it works.

What can cause this issue? 
Reply all
Reply to author
Forward
0 new messages