Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Azure/packer-azure] packer-azure build hangs while deleting the temp resource groups for centos #3633

Closed
deepak-shrivastava opened this issue Jun 17, 2016 · 1 comment
Labels

Comments

@deepak-shrivastava
Copy link

deepak-shrivastava commented Jun 17, 2016

I am opening this issue in continuation with my previous issue i.e https://github.com/Azure/packer-azure/issues/255
I have a couple of questions here:

  1. As per the solution provided, i saw the examples and tried to execute the centos.json from the azure-packer examples. I am getting the following error while building
Error initializing core: 1 error(s) occurred:
 required variable not set: ssh_pass

My template is as follows:-

{
  "variables": {
    "ssh_user": "centos",
    "ssh_pass": null
  },
  "builders": [{
        "type": "azure-arm",
        "client_id": "...",
        "client_secret": "...",
        "resource_group_name": "...",
        "storage_account": "...",
        "subscription_id": "...",
        "tenant_id": "...",
        "capture_container_name": "packercentoscontainer",
        "capture_name_prefix": "prefixcentos",
        "image_publisher": "OpenLogic",
        "os_type" : "Linux",
        "image_offer": "CentOS",
        "image_sku": "7.1",
        "image_version": "latest",
        "location": "East Asia",
        "ssh_pty" : "true",
        "ssh_username": "{{user `ssh_user`}}",
        "ssh_password": "{{user `ssh_pass`}}"
        }
      ],
  "provisioners": [{
    "execute_command": "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -S -E sh '{{ .Path }}'",
    "inline": [
      "yum update -y",
      "/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
    ],
    "inline_shebang": "/bin/sh -x",
    "type": "shell",
    "skip_clean": true
  }]
}

Can you please suggest what is required here?

Because of the above error, i omitted the Username and password from my template and was able to start the build. Below are the logs from packer

azure-arm output will be in this color.

==> azure-arm: Preparing builder ...
    azure-arm: Creating Azure Resource Manager (ARM) client ...
==> azure-arm: Creating resource group ...
==> azure-arm:  -> ResourceGroupName : 'packer-Resource-Group-rwd8qp4pn4'
==> azure-arm:  -> Location          : 'East Asia'
==> azure-arm: Validating deployment template ...
==> azure-arm:  -> ResourceGroupName : 'packer-Resource-Group-rwd8qp4pn4'
==> azure-arm:  -> DeploymentName    : 'pkrdprwd8qp4pn4'
==> azure-arm: Deploying deployment template ...
==> azure-arm:  -> ResourceGroupName : 'packer-Resource-Group-rwd8qp4pn4'
==> azure-arm:  -> DeploymentName    : 'pkrdprwd8qp4pn4'
==> azure-arm: Getting the public IP address ...
==> azure-arm:  -> ResourceGroupName   : 'packer-Resource-Group-rwd8qp4pn4'
==> azure-arm:  -> PublicIPAddressName : 'packerPublicIP'
==> azure-arm:  -> Public IP           : '13.75.123.156'
==> azure-arm: Waiting for SSH to become available...
==> azure-arm: Connected to SSH!
==> azure-arm: Provisioning with shell script: /tmp/packer-shell431138205
    azure-arm: + yum update -y
    azure-arm: Loaded plugins: fastestmirror, langpacks
    azure-arm: You need to be root to perform this command.
    azure-arm: + sudo /usr/sbin/waagent -force -deprovision+user
    azure-arm:
    azure-arm: We trust you have received the usual lecture from the local System
    azure-arm: Administrator. It usually boils down to these three things:
    azure-arm:
    azure-arm: #1) Respect the privacy of others.
    azure-arm: #2) Think before you type.
    azure-arm: #3) With great power comes great responsibility.
    azure-arm:
    azure-arm: [sudo] password for packer:
==> azure-arm: 
==> azure-arm: Cleanup requested, deleting resource group ...

Nothing happens post that.I had kept this build on for almost 2hours.Then I checked my azure account by logging into the same, and i can see the temp resource group still present in the account and is not deleted.

I am blocked coz of these issues. Can you please help?? What am i missing here?

@rickard-von-essen
Copy link
Collaborator

Please only use GitHub Issues for reporting bugs and feature requests. Do not ask for general help here. Use IRC #packer-tool on Freenode or the mailing list for that.

See https://www.packer.io/community/

If you are describing a bug or a feature request please reopen and try to add some more details to make it clearer.


  1. You must supply ssh_pass variable exactly as it says in the error message i.e:
    packer build -var ssh_pass=<secret password> centos.json

@ghost ghost locked and limited conversation to collaborators Apr 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants