Packer getting terminated during vm creation

32 views
Skip to first unread message

queenk...@gmail.com

unread,
Sep 27, 2016, 2:37:50 PM9/27/16
to Packer
packer version
Packer v0.10.1


{
  "provisioners": [
    {
      "type": "shell",
      "execute_command": "echo 'vagrant'|sudo -S sh '{{.Path}}'",
      "override": {
"BaseVM": {
                    "scripts": [
                        "scripts/base.sh"
                    ]
                }
    }}
  ],
  "builders": [{
     "name" : "BaseVM",
     "type": "vmware-vmx",
     "source_path": "t/packer-vmware-iso.vmx",
     "output_directory" : "output",
     "headless" : false,
     "ssh_username" : "vagrant",
     "ssh_password" : "vagrant",
     "ssh_wait_timeout" : "30m",
     "ssh_pty"          : true,
 "vmx_data": {
        "memsize": "4096",
        "numvcpus": "2"
        },
     "shutdown_command" : "echo '/sbin/halt -h -p' > /tmp/shutdown.sh; echo 'vagrant'|sudo -S sh '/tmp/shutdown.sh'"
  }],
"post-processors": [
    {
      "type": "vagrant",
      "override": {
        "vmware": {
          "output": "centos-7-0-x64-vmware-basevm.box"
        }
      }
    }
  ]
}


packer build packerVM.json
BaseVM output will be in this color.

==> BaseVM: Cloning source VM...
==> BaseVM: Starting virtual machine...
==> BaseVM: Waiting 10s for boot...
==> BaseVM: Connecting to VM via VNC
==> BaseVM: Typing the boot command over VNC...
==> BaseVM: Waiting for SSH to become available...
==> BaseVM: Connected to SSH!
==> BaseVM: Provisioning with shell script: scripts/base.sh
    BaseVM: [sudo] password for vagrant: Loaded plugins: fastestmirror
    BaseVM: base             | 3.6 kB     00:00
    BaseVM: extras           | 3.4 kB     00:00
    BaseVM: updates          | 3.4 kB     00:00
    BaseVM: (1/4): base/7/x86_ | 155 kB   00:01
    BaseVM: (2/4): extras/7/x8 | 165 kB   00:01
    BaseVM: (3/4): base/7/x86_ | 5.3 MB   00:08
    BaseVM: (4/4): updates/7/x | 7.8 MB   00:14
    BaseVM: Determining fastest mirrors
    BaseVM: * base: mirrors.cmich.edu
    BaseVM: * extras: mirrors.greenmountainaccess.net
    BaseVM: * updates: mirror.math.princeton.edu
    BaseVM: Resolving Dependencies
    BaseVM: --> Running transaction check
    BaseVM: ---> Package NetworkManager.x86_64 1:1.0.6-27.el7 will be updated
    BaseVM: ---> Package NetworkManager.x86_64 1:1.0.6-31.el7_2 will be an update

After this step packer terminates. When I try to run packer in debug mode I was not able to see any output and hangs near "==> BaseVM: Waiting for SSH to become available..." 

balubhai555

unread,
Sep 27, 2016, 2:49:31 PM9/27/16
to Packer
I got the same issue. But In packer, there is no solution for this. If there is a solution, I think they will suggest us. They said one thing

Add   

      "keep_input_artifact": true
to the Post Processors.  I did the same but no use. So please try that. If it is working fine. Then good for your code.

Rickard von Essen

unread,
Sep 27, 2016, 2:56:59 PM9/27/16
to packe...@googlegroups.com
Please run packer with:
PACKER_LOG=1 packer build template.json

and attach the full log output.

--
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/35cf3224-71da-4b8c-a4f1-6b428bda73b0%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages