I am new to packer and Azure and I am trying to build Azure managed image. I am trying use the custom docker image to run the packer script .
I am getting “Timeout waiting for SSH”? Not sure issue in packer or docker image. :-(
Details below :
Log:
[Azure-Image-Pipeline] Running shell script
+ cd packer
+ packer build cfy.json
[1;32mazure-arm output will be in this color.[0m
[1;32m==> azure-arm: Running builder ...[0m
[0;32m azure-arm: Creating Azure Resource Manager (ARM) client ...[0m
[1;32m==> azure-arm: Using existing resource group ...[0m
[1;32m==> azure-arm: -> ResourceGroupName : 'az-propel'[0m
[1;32m==> azure-arm: -> Location : 'westus2'[0m
[1;32m==> azure-arm: Validating deployment template ...[0m
[1;32m==> azure-arm: -> ResourceGroupName : 'az-propel'[0m
[1;32m==> azure-arm: -> DeploymentName : 'pkrdp199yt37zpt'[0m
[1;32m==> azure-arm: Deploying deployment template ...[0m
[1;32m==> azure-arm: -> ResourceGroupName : 'az-propel'[0m
[1;32m==> azure-arm: -> DeploymentName : 'pkrdp199yt37zpt'[0m
[1;32m==> azure-arm: Getting the VM's IP address ...[0m
[1;32m==> azure-arm: -> ResourceGroupName : 'az-propel'[0m
[1;32m==> azure-arm: -> PublicIPAddressName : 'pkrip199yt37zpt'[0m
[1;32m==> azure-arm: -> NicName : 'pkrni199yt37zpt'[0m
[1;32m==> azure-arm: -> Network Connection : 'PublicEndpoint'[0m
[1;32m==> azure-arm: -> IP Address : '52.183.18.224'[0m
[1;32m==> azure-arm: Waiting for SSH to become available...[0m
[1;31m==> azure-arm: Timeout waiting for SSH.[0m
[1;32m==> azure-arm:
==> azure-arm: The resource group was not created by Packer, deleting individual resources ...[0m
[1;32m==> azure-arm: -> Deployment: pkrdp199yt37zpt[0m
[1;32m==> azure-arm: -> Microsoft.Compute/virtualMachines : 'pkrvm199yt37zpt'[0m
[1;32m==> azure-arm: -> Microsoft.Network/networkInterfaces : 'pkrni199yt37zpt'[0m
[1;32m==> azure-arm: -> Microsoft.Network/publicIPAddresses : 'pkrip199yt37zpt'[0m
[1;32m==> azure-arm: -> Microsoft.Network/virtualNetworks : 'pkrvn199yt37zpt'[0m
[1;32m==> azure-arm: -> Microsoft.Compute/disks : '/subscriptions/XXXXXXXXXXXXXXXXXXX/resourceGroups/az-propel/providers/Microsoft.Compute/disks/pkros199yt37zpt'[0m
[1;32m==> azure-arm:
==> azure-arm: The resource group was not created by Packer, not deleting ...[0m
[1;31mBuild 'azure-arm' errored: Timeout waiting for SSH.[0m
==> Some builds didn't complete successfully and had errors:
--> azure-arm: Timeout waiting for SSH.
==> Builds finished but no artifacts were created.
My JSON file:
{
"variables": {
"resource_group": "az-propel",
"client_id": “XXXXXXXXXXXXXXXXXXXXX”,
"client_secret": “XXXXXXXXXXXXXXXXXXXXXXXXX”,
"subscription_id": “XXXXXXXXXXXXXXXX”
},
"builders": [{
"type": "azure-arm",
"client_id": “XXXXXXXXXXXXXXXXXXXXX”,
"client_secret": “XXXXXXXXXXXXXXXXXXXXXXXXX”,
"subscription_id": “XXXXXXXXXXXXXXXX”
"os_type": "Linux",
"image_publisher": "OpenLogic",
"image_offer": "CentOS",
"image_sku": "7-CI",
"ssh_pty": "true",
"azure_tags": {
"dept": "engineering",
"task": "image deployment"
},
"build_resource_group_name" : "az-propel",
"managed_image_resource_group_name": "az-propel",
"managed_image_name" : “mgr_propel",
"vm_size": "Standard_F4s_v2"
}],
"provisioners": [
{
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"yum update"
],
"inline_shebang": "/bin/sh -x",
"type": "shell"
}]
}
Docker File:
FROM alpine
RUN apk update
RUN apk upgrade
RUN apk add wget
RUN apk add sudo
#RUN apk add telnet
RUN apk add bash
RUN apk add unzip
RUN apk add openssh
RUN apk add ca-certificates && rm -rf /var/cache/apk/*
#RUN mkdir -p ~/.ssh
#COPY ./cert/authorized_keys ~/.ssh/authorized_keys
RUN update-ca-certificates
EXPOSE 22
WORKDIR /usr/bin
RUN wget https://releases.hashicorp.com/packer/1.3.1/packer_1.3.1_linux_amd64.zip
#RUN /VMware-ovftool-4.1.0-2459827-lin.x86_64.bundle --eulas-agreed --required && \
RUN unzip packer_1.3.1_linux_amd64.zip
RUN rm -rf packer_1.3.1_linux_amd64.zip
Thanks and Regards
Krishna
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/8ec62396-7050-43d9-9fb6-8bc3f95df75e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.