Re: [packer] AWS new VM (Private IP)

2020-07-27 Thread Rickard von Essen
I would handle it like this.

1) run shell (not local) curl the metadata service and save it to a file,
say /tmp/ipaddress

2) use file provisioner download to fet it to your machine.

3) in a shell-local script read the IP into a variable.

On Mon, Jul 27, 2020, 15:05 Renato Marcandier 
wrote:

>
> Hello guys,
>
> I am trying to run this conf.sh script against my new AWS VM from my mac
> laptop.
> When the VM is up and running I am using this AWS command to grab the IP,
> however, from inside packer, I am not able to grab it, only from my shell
> terminal.
> Can you see the problem?
>
> If is there any better way to achieve it just let me know.
>
>
>
> Packer.json
> https://gist.github.com/rmarcandier/4962e295b61c3cdf3338acedc8d898a0
>
>
> Conf.sh:
> https://gist.github.com/rmarcandier/653b268a155e14454a1db3dffb071f5c
>
>
>
> Error:
>
> ==> amazon-ebs: Pausing at breakpoint provisioner with note "this is a
> breakpoint 1".
> ==> amazon-ebs: Press enter to continue.
> ==> amazon-ebs: Running local shell script:
> /var/folders/9q/pzl_rvls7svbpv86bfcydrscgn/T/packer-shell332274264
> amazon-ebs: i-086b22975ad9648ed
> ==> amazon-ebs: Pausing at breakpoint provisioner with note "this is a
> breakpoint 2".
> ==> amazon-ebs: Press enter to continue.
> ==> amazon-ebs: Running local shell script:
> /var/folders/9q/pzl_rvls7svbpv86bfcydrscgn/T/packer-shell839414416
> amazon-ebs:
> ==> amazon-ebs: Pausing at breakpoint provisioner with note "this is a
> breakpoint 3".
> ==> amazon-ebs: Press enter to continue.
> ==> amazon-ebs: Running local shell script: ./conf.sh
> ==> amazon-ebs:   % Total% Received % Xferd  Average Speed   Time
> Time Time  Current
> ==> amazon-ebs:  Dload  Upload   Total
>  SpentLeft  Speed
> ==> amazon-ebs:   0 00 00 0  0  0 --:--:--
> --:--:-- --:--:-- 0curl: (6) Could not resolve host: $AWS_INSTANCE_IP
> ==> amazon-ebs:   % Total% Received % Xferd  Average Speed   Time
> Time Time  Current
> ==> amazon-ebs:  Dload  Upload   Total
>  SpentLeft  Speed
> ==> amazon-ebs:   0 00 00 0  0  0 --:--:--
> --:--:-- --:--:-- 0curl: (6) Could not resolve host: $AWS_INSTANCE_IP
> ==> amazon-ebs: Provisioning step had errors: Running the cleanup
> provisioner, if present...
> ==> amazon-ebs: Terminating the source AWS instance...
> ==> amazon-ebs: Cleaning up any extra volumes...
> ==> amazon-ebs: No volumes to clean up, skipping
> Build 'amazon-ebs' errored: Script exited with non-zero exit status:
> 6.Allowed exit codes are: [0]
>
> ==> Some builds didn't complete successfully and had errors:
> --> amazon-ebs: Script exited with non-zero exit status: 6.Allowed exit
> codes are: [0]
>
> ==> Builds finished but no artifacts were created.
> ❯ AWS (master) ✘
>
> Regards
> RG
>
> --
> 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/hashicorp/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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/7f4e253d-2928-43f9-a2ef-a3a39420273co%40googlegroups.com
> 
> .
>

-- 
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/hashicorp/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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9fwfSfBi6J5%3D2Z%2B5wzmoUVNp5GjaYGXNfaVb7RSWyNcg%40mail.gmail.com.


Re: [packer] Re: Running Packer from Jenkins - nothing appearing in console

2020-06-14 Thread Rickard von Essen
See
https://learn.hashicorp.com/packer/getting-started/install#troubleshooting

On Sat, Jun 13, 2020, 06:39 'Tarun Mittal' via Packer <
packer-tool@googlegroups.com> wrote:

>
> I don't about why this issue is coming, but what I did in Jenkins job
> shell execution:-
> 1 . which packer -- in this, it is running from /usr/sbin/packer which is
> pointing to ---> cracklib-packer.
> 2.  but I installed the packer and copy that to /usr/bin/ directory, so in
> Jenkins job I did */usr/bin/packer* to run any packer command in my
> Jenkins job. In my case, it is working.
>
>
> Thanks, @Yannas
>
>
> On Thursday, July 2, 2015 at 2:52:47 PM UTC+5:30, Yannis Lionis wrote:
>>
>> I'm running packer in a Jenkins build by executing "packer build
>> template.file" in a Shell build step.
>>
>> My problem is that the output of the command that appears when I execute
>> this in my dev environment is nowhere to be found. Instead, the Jenkins
>> build console contains this:
>>
>> + packer build template.file
>> 0 0
>> Finished: SUCCESS
>>
>>
>> On top of it, the packer build actually fails, but the Jenkins build
>> shows successful.
>>
>> I subsequently discovered the Packer Jenkins plugin and installed it.
>> Same issue, the output in the Jenkins console does not contain the
>> information displayed when I execute manually, it looks lie this:
>>
>> $ /var/lib/jenkins/packer/packer build 
>> /var/lib/jenkins/workspace/template.file
>> FATAL: Execution failed: /var/lib/jenkins/packer/packer build 
>> /var/lib/jenkins/workspace/template.fileFinished 
>> : FAILURE
>> Build step 'Packer' marked build as failure
>> Finished: FAILURE
>>
>>
>> Any ideas?
>>
>> Yannis
>>
>>
>>
> *Note:* This message is the property of HashedIn and its subsidiaries. It
> may be legally privileged and/or confidential and is intended only for the
> use of the addressee(s). No addressee should forward, print, copy, or
> otherwise reproduce this message in any manner that would allow it to be
> viewed by any individual not originally listed as a recipient. If the
> reader of this message is not the intended recipient, you are hereby
> notified that any unauthorized disclosure, dissemination, distribution,
> copying or the taking of any action in reliance on the information herein
> is strictly prohibited. If you have received this communication in error,
> please immediately notify the sender and delete this message.
>
> --
> 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/hashicorp/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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/53589c1a-f851-45f5-b03a-8afe44a3d9cdo%40googlegroups.com
> 
> .
>

-- 
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/hashicorp/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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt83u32vkzUbmGLgQiDjqA05K6vPNafa9CGXx0R3oQi0RQ%40mail.gmail.com.


Re: [packer] seems like you cannot install ubuntu 20 with packer

2020-06-12 Thread Rickard von Essen
I expect this to work
https://www.github.com/chef/bento/tree/master/packer_templates%2Fubuntu%2Fubuntu-20.04-amd64.json

On Fri, Jun 12, 2020, 12:23 Elhanan Maayan  wrote:

> ubuntu 20 decided to ditch the D-I installer, and go with subiquity
> something that some folks think unstable,
>
> there's only one example of how to do (for vmware), and when i tried it ,
> it didn't work (i was stuck in language selection)
>
> i know they still provide a distor with legacy d-i, but they say it's not
> supported.
>
>
> https://discourse.ubuntu.com/t/server-installer-plans-for-20-04-lts/13631/58
>
> --
> 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/hashicorp/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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/c7612ded-0594-4ec7-9b1e-cb86ffd2110co%40googlegroups.com
> 
> .
>

-- 
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/hashicorp/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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt-p4QrvN4YmynEs6A_dW8ieAF2%2B3n-UuX3Fg0KuKkTXtQ%40mail.gmail.com.


Re: [packer] inline reboots with packer and linux redhat based

2020-05-20 Thread Rickard von Essen
Looks like the word reboot got uppercased?

On Wed, May 20, 2020, 03:33 trey perrone  wrote:

> Attempting to add an inline reboot command based on this
> https://discuss.hashicorp.com/t/best-practice-for-applying-updates-and-kernel-patches/3300/2
>  but
> playing around today to build new AWS AMIs, I seem to get errors. This is
> also sort of documented on packer.io
> https://www.packer.io/docs/provisioners/shell/#handling-reboots. I was
> trying to do inline to keep it simply
>
> I am mainly trying to add the reboot as trying to get kernel and
> associated packages up to date prior to installing this awful Symantec
> Endpoint agent that was thrust upon me from above. It compiles some
> autoprotect feature based on the kernel, so want to update my kernel and
> associated pacakges first, inline reboot, then proceed with ansible
> playbooks that include the Symantec agent and thus at least i can ensure
> the base AMI kernel is functioning ok at build/install.
>
>
>- packer 1.5.5 is what I am currently using
>- I was testing redhat7 and centos7 today
>
>
>
> {
>  "type": "shell",
>  "inline": "sudo reboot",
>  "expect_disconnect": true,
>  "pause_before": "30s",
>  "timeout": "5m"
>},
>
>
>
> Ive tried variations of commands
>
>- putting my inline in [ ] for array
>- sudo shutdown -now
>- sudo /usr/sbin/reboot (or shutdown)
>- sudo systemctl reboot
>
> but packer always throws an error similar to
>
> amazon-ebs: /tmp/script_5489.sh: line 16: REBOOT: command not found
> amazon-ebs: /tmp/script_5489.sh: line 16: REBOOT: command not found
>
>
> What am I overlooking in the docs here?
>
>
>
> --
> 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/hashicorp/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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/41d9f7b5-d18c-4e76-9ae4-10beefe5001a%40googlegroups.com
> 
> .
>

-- 
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/hashicorp/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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9JrWnxBmD-%3D%2BYOBKtF2GJ7XLUxHbSJwdP2vd17t3nGLQ%40mail.gmail.com.


Re: [packer] Does Packer supports escape characters in JSON?

2020-05-12 Thread Rickard von Essen
It should, otherwise open an issue.

On Tue, May 12, 2020, 16:09 drj  wrote:

> I am working on building an image using the vpshere-iso builder
> unfortunately some of the naming conventions in our vsphere env are using
> spaces in our esources names created, for e.g. the datastore name is
> called the below highlighted in yellow. I don't have the admin rights to go
> in the env to rename that datastore to a name w/ out the spaces is
> there a workaround by adding some escape characters in the following below?
> "datastore": "dev-test (1)"
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/4f4213a3-5b94-40db-91ea-89e5acb0806a%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9sMDyAsr2A-rzmrtkMMm625pMqpx06gEc4gsYX1tbWXw%40mail.gmail.com.


Re: [packer] Re: Provisioner shell inline command does not run

2020-05-07 Thread Rickard von Essen
Yes provisioner depends on the communicator, in this case ssh.

On Thu, May 7, 2020, 16:58 jz  wrote:

> Just clarify - the reason I am doing this is try to run a command line to
> create a new user in inline. Also this user is meant to be a ssh user from
> Packer host to VM. I am using Photon so the root shh is blocked by default.
> Long story short - if provisioner shell relies on ssh between packer host
> and the VM this provisioner will not work anyway. Is this true that
> provisioner shell type depends on ssh?
>
> On Thursday, May 7, 2020 at 2:19:00 AM UTC-4, jz wrote:
>>
>> Pack 1.5.5
>> vsphere-iso v2.3
>> Photon 3
>>
>> Running into an issue: the provisioner section seems never be executed.
>> Here is the json file:
>>
>>   "builders": [
>> {
>>   "type": "vsphere-iso",
>>
>>   "vcenter_server":  "vcsas11001.mycompany.com",
>>   "username":"administrator@vsphere.local",
>>   "password":"X",
>>   "insecure_connection": "true",
>>   "vm_name": "photon3-ga-1",
>>   "notes": "Build via Packer",
>>   "cluster": "VxRail-Virtual-SAN-Cluster-X",
>>   "host": "esxas11001.mycompany.com",
>>   "datastore": "VxRail-Virtual-SAN-Datastore-X",
>>   "folder": "MY VMs",
>>
>>   "guest_os_type": "vmwarePhoton64Guest",
>>
>>   "ssh_username": "sshuser",
>>   "ssh_password": "XX",
>>
>>   "CPUs": 2,
>>   "RAM":  4096,
>>   "RAM_reserve_all": false,
>>   "network": "Management Network-X",
>>
>>   "convert_to_template": false,
>>
>>   "disk_controller_type":  "pvscsi",
>>   "disk_size":25000,
>>   "disk_thin_provisioned": true,
>>
>>   "network_card": "vmxnet3",
>>   "shutdown_command": "",
>>
>>   "iso_paths": ["[VxRail-Virtual-SAN-Datastore-X]
>> iso/photon-os-3.0-ga/photon-3.0-58f9c74-bundle.iso"],
>>   "floppy_files": [
>> "{{user `ks_path`}}/photon_ks.cfg"
>>   ],
>>   "boot_command": ["",
>> "vmlinuz initrd=initrd.img root=/dev/ram0
>> loglevel=3 ks=cdrom:/isolinux/photon_ks.cfg photon.media=cdrom",
>> ""]
>>   }
>>   ],
>>
>>"provisioners": [
>>{
>>  "type": "shell",
>>  "inline": ["mkdir -p /tmp/threetimes"],
>>  "only": ["vsphere-iso"]
>>}
>>   ]
>> }
>>
>> All I am doing is to create a dummy directory under /tmp. With or
>> without  "only": ["vsphere-iso"] is the same result - no directory is
>> created. Anything wrong here?
>>
>> Thanks,
>>
>> J
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/5cf5ffd2-d419-4098-aea9-27849b9274e3%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_twTQNM3T7u%2B3oeC5%2BUEtbhu-0BAeuJNL1kTVXDaC8hg%40mail.gmail.com.


Re: [packer] failed while creating image in GCP

2020-04-29 Thread Rickard von Essen
It seems like it was preempted.

"Instance failed to start due to preemption."

On Wed, Apr 29, 2020, 10:14 Farrukh Fareed 
wrote:

> I have use packer for creating GCP images , there i used preemptive
> instances for cost saving most of the time it failed to create image giving
> errors like below:
> *==> googlecompute: dial tcp x.x.x.x:22: i/o timeout*
> or
>
>
>
> *==> googlecompute: Error creating instance: 1 error(s) occurred:==>
> googlecompute:==> googlecompute: * Instance failed to start due to
> preemption.Build 'googlecompute' errored: Error creating instance: 1
> error(s) occurred:*
>
> *Instance failed to start due to preemption.*
>
> i am using
> Packer version: 1.3
> Builder: GCP
> Provisioner: Ansible
> GCP Region: us-east4
>
> Please help me out here
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/9b7ca226-ab1d-4d42-b830-7ce0562a80ed%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9YNW%3D1D2jxj0y75vjzKXvVY-%3D1%2BK-kfgYyixZT8tZhQg%40mail.gmail.com.


Re: [packer] temporary_key_pair_name Applicability

2020-04-02 Thread Rickard von Essen
It's not applicable. It's just for builders where ssh public keys are
served by the API to instances to that will be added by cloud-init (or
something similar) will automatically add them to a authorized_keys file.

On Thu, Apr 2, 2020, 04:15 Lesley Kimmel  wrote:

> I noticed that this SSH communicator option is available for several
> builders (based on the Packer docs). Specifically, I am using the
> vsphere-iso builder. I was playing with this option but it doesn't seem to
> do anything. When I search about it, it is generally in the context of
> Amazon builders. Is this option even applicable to the VMware builders? If
> so, how does it work?
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/464b36a7-6d64-4227-86c0-4fb24c086e08%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9nTr190TrUnCb5v1p6%2BPN8ZyxHj0BoO1pWxRsvLhL3iQ%40mail.gmail.com.


Re: [packer] how to use the ISo url as source_image in packer using the openstack builder

2020-03-30 Thread Rickard von Essen
You can't do that. You need reference an image.

If you need to build from scratch, use the qemu builder and upload the
image to OpenStack.

On Mon, Mar 30, 2020, 13:48 Sunil Kathait 
wrote:

> my file is here
>
> {
>   "builders": [
> {
>   "type": "openstack",
>   "provider": "http://.metacloud.net:5000/v2.0",
>   "openstack_provider": "",
>   "region": "RegionOne",
>   "ssh_username": "monkey",
>   "image_name": "ubuntu1404_packer_test_1",
>   "source_image": 
> "https:pkg.adfinis-sygroup.ch/centos/7.5.1804/isos/x86_64/CentOS-7-x86_64-NetInstall-1804.iso;,
>   "flavor": "2"
> }
>   ]
> }
>
> the error i am getting is : openstack: Error launching source server: Bad 
> request with: [POST 
> https://iadosvip01.ece.ellucian.com:8774/v2/78e00e3a402a4d5e8b50f593e92db117/servers],
>  error message: {"badRequest": {"message": "Invalid input for field/attribute 
> imageRef. Value: 
> https://pkg.adfinis-sygroup.ch/centos/7.5.1804/isos/x86_64/CentOS-7-x86_64-NetInstall-1804.iso.
>  
> u'https://pkg.adfinis-sygroup.ch/centos/7.5.1804/isos/x86_64/CentOS-7-x86_64-NetInstall-1804.iso'
>  is not valid under any of the given schemas", "code": 400}}
>
> i want to download the image from the site 
> https:pkg.adfinis-sygroup.ch/centos/7.5.1804/isos/x86_64/CentOS-7-x86_64-NetInstall-1804.iso
>  and then create a image out of it.
>
> i do not want to give the image id from the existing image in openstack.
>
> how can i achieve this.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/a9b6a2e1-6e82-4d07-9bad-a3d5e080f16f%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt815jY%3DGjoAN%3DF-3d%3DxKw%3Do3-enQmybJJ_fjNHuLPt%3DXg%40mail.gmail.com.


Re: [packer] 'amazon-ebs' errored: Script exited with non-zero exit status: 1.Allowed exit codes are: [0]

2020-03-22 Thread Rickard von Essen
Add -on-error=ask flag to packer build and the you can access the instance
when it fails and poke around.

If this is a bash script add set -x to the top of the script and it will
echo each command before executing it.

On Sun, Mar 22, 2020, 05:05 Venkatesh R  wrote:

> Packer Build fails with below error:
>
> ==> amazon-ebs: Script exited with non-zero exit status: 1.Allowed exit
> codes are: [0]
> [live ] ==> amazon-ebs: Step "StepProvision" failed, aborting...
> [live ] ==> amazon-ebs: aborted: skipping cleanup of step "StepConnect"
> [live ] ==> amazon-ebs: aborted: skipping cleanup of step "StepGetPassword"
> [live ] ==> amazon-ebs: aborted: skipping cleanup of step
> "StepRunSourceInstance"
> [live ] ==> amazon-ebs: aborted: skipping cleanup of step
> "StepCleanupVolumes"
> [live ] ==> amazon-ebs: aborted: skipping cleanup of step
> "StepSecurityGroup"
> [live ] ==> amazon-ebs: aborted: skipping cleanup of step "StepKeyPair"
> [live ] ==> amazon-ebs: aborted: skipping cleanup of step "StepNetworkInfo"
> [live ] ==> amazon-ebs: aborted: skipping cleanup of step
> "StepSourceAMIInfo"
> [live ] ==> amazon-ebs: aborted: skipping cleanup of step "StepPreValidate"
> [live ] Build 'amazon-ebs' errored: Script exited with non-zero exit
> status: 1.Allowed exit codes are: [0]
>
> Does packer gets timed out ? is there any logs that can be used for
> troubleshooting ?
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/d6a3d261-6f7a-44e4-83fd-54ab42cbd8bc%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_kzYK3EKSd4%3DaT42xnF1ASAsUCZaNO_R5TWQe9UNDk-A%40mail.gmail.com.


Re: [packer] Packer ssh connection timeout

2020-03-19 Thread Rickard von Essen
The set a upload a SSH pub key that you can use to AWS and set
ssh_private_key_file and ssh_keypair_name in packer and run packer build
-on-error=ask that will give you an opportunity to troubleshoot the network
manually.

On Thu, Mar 19, 2020, 10:39 'Ganesh Katakam' via Packer <
packer-tool@googlegroups.com> wrote:

> I have changed the ssh_username from root to ubuntu, still it is same
>
> On Thursday, March 19, 2020 at 2:22:15 PM UTC+5:30, Rickard von Essen
> wrote:
>>
>> Ubuntu doesn't allow SSH'ing with root. And you need to use the user that
>> cloud-init set the ssh key for. In this case ssh_username should be ubuntu.
>>
>> On Thu, Mar 19, 2020, 06:32 'Ganesh Katakam' via Packer <
>> packe...@googlegroups.com> wrote:
>>
>>> I am very new to packer and this is my first script that too taken from
>>> packer website itself. While it is trying to do ssh with the instance it is
>>> failing. Can someone help me??
>>>
>>> This is my template file:
>>>
>>> {
>>>   "variables": {
>>> "aws_access_key": "",
>>> "aws_secret_key": ""
>>>   },
>>>   "builders": [
>>> {
>>>   "type": "amazon-ebs",
>>>   "access_key": "{{user `aws_access_key`}}",
>>>   "secret_key": "{{user `aws_secret_key`}}",
>>>   "region": "ap-south-1",
>>>   "source_ami_filter": {
>>> "filters": {
>>>   "virtualization-type": "hvm",
>>>   "name": "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*",
>>>   "root-device-type": "ebs"
>>> },
>>> "owners": [
>>>   "099720109477"
>>> ],
>>> "most_recent": true
>>>   },
>>>   "instance_type": "t2.micro",
>>>   "ssh_username": "root",
>>>   "ami_name": "fcp-runwayci {{timestamp}}",
>>>   "tags":{
>>> "Name": "GaneshK - {{timestamp}}"
>>>   }
>>> }
>>>   ],
>>>   "provisioners": [
>>> {
>>>   "type": "shell",
>>>   "script": "install.sh"
>>> }
>>>   ]
>>> }
>>>
>>> This is my console output:
>>>
>>> 2020/03/19 05:22:54 [INFO] Packer version: 1.5.4 [go1.13.7 linux amd64]
>>>
>>> 2020/03/19 05:22:54 Checking 'PACKER_CONFIG' for a config file path
>>>
>>> 2020/03/19 05:22:54 'PACKER_CONFIG' not set; checking the default config
>>> file path
>>>
>>> 2020/03/19 05:22:54 Attempting to open config file:
>>> /home/ubuntu/.packerconfig
>>>
>>> 2020/03/19 05:22:54 [WARN] Config file doesn't exist:
>>> /home/ubuntu/.packerconfig
>>>
>>> 2020/03/19 05:22:54 Setting cache directory:
>>> /home/ubuntu/packer/packer_cache
>>>
>>> 2020/03/19 05:22:54 Creating plugin client for path: /usr/bin/packer
>>>
>>> 2020/03/19 05:22:54 Starting plugin: /usr/bin/packer
>>> []string{"/usr/bin/packer", "plugin", "packer-builder-amazon-ebs"}
>>>
>>> 2020/03/19 05:22:54 Waiting for RPC address for: /usr/bin/packer
>>>
>>> 2020/03/19 05:22:54 Received unix RPC address for /usr/bin/packer: addr
>>> is /tmp/packer-plugin972069966
>>>
>>> 2020/03/19 05:22:54 packer-builder-amazon-ebs plugin: [INFO] Packer
>>> version: 1.5.4 [go1.13.7 linux amd64]
>>>
>>> 2020/03/19 05:22:54 packer-builder-amazon-ebs plugin: Checking
>>> 'PACKER_CONFIG' for a config file path
>>>
>>> 2020/03/19 05:22:54 packer-builder-amazon-ebs plugin: 'PACKER_CONFIG'
>>> not set; checking the default config file path
>>>
>>> 2020/03/19 05:22:54 packer-builder-amazon-ebs plugin: Attempting to open
>>> config file: /home/ubuntu/.packerconfig
>>>
>>> 2020/03/19 05:22:54 packer-builder-amazon-ebs plugin: [WARN] Config file
>>> doesn't exist: /home/ubuntu/.packerconfig
>>>
>>> 2020/03/19 05:22:54 packer-builder-amazon-ebs plugin: Setting cache
>>> directory: /home/ubuntu/packer/packer_cache
>>>
>>> 2020/03/19 05:22:54 packer-builder-amazon-ebs plugin: args

Re: [packer] Packer ssh connection timeout

2020-03-19 Thread Rickard von Essen
Ubuntu doesn't allow SSH'ing with root. And you need to use the user that
cloud-init set the ssh key for. In this case ssh_username should be ubuntu.

On Thu, Mar 19, 2020, 06:32 'Ganesh Katakam' via Packer <
packer-tool@googlegroups.com> wrote:

> I am very new to packer and this is my first script that too taken from
> packer website itself. While it is trying to do ssh with the instance it is
> failing. Can someone help me??
>
> This is my template file:
>
> {
>   "variables": {
> "aws_access_key": "",
> "aws_secret_key": ""
>   },
>   "builders": [
> {
>   "type": "amazon-ebs",
>   "access_key": "{{user `aws_access_key`}}",
>   "secret_key": "{{user `aws_secret_key`}}",
>   "region": "ap-south-1",
>   "source_ami_filter": {
> "filters": {
>   "virtualization-type": "hvm",
>   "name": "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*",
>   "root-device-type": "ebs"
> },
> "owners": [
>   "099720109477"
> ],
> "most_recent": true
>   },
>   "instance_type": "t2.micro",
>   "ssh_username": "root",
>   "ami_name": "fcp-runwayci {{timestamp}}",
>   "tags":{
> "Name": "GaneshK - {{timestamp}}"
>   }
> }
>   ],
>   "provisioners": [
> {
>   "type": "shell",
>   "script": "install.sh"
> }
>   ]
> }
>
> This is my console output:
>
> 2020/03/19 05:22:54 [INFO] Packer version: 1.5.4 [go1.13.7 linux amd64]
>
> 2020/03/19 05:22:54 Checking 'PACKER_CONFIG' for a config file path
>
> 2020/03/19 05:22:54 'PACKER_CONFIG' not set; checking the default config
> file path
>
> 2020/03/19 05:22:54 Attempting to open config file:
> /home/ubuntu/.packerconfig
>
> 2020/03/19 05:22:54 [WARN] Config file doesn't exist:
> /home/ubuntu/.packerconfig
>
> 2020/03/19 05:22:54 Setting cache directory:
> /home/ubuntu/packer/packer_cache
>
> 2020/03/19 05:22:54 Creating plugin client for path: /usr/bin/packer
>
> 2020/03/19 05:22:54 Starting plugin: /usr/bin/packer
> []string{"/usr/bin/packer", "plugin", "packer-builder-amazon-ebs"}
>
> 2020/03/19 05:22:54 Waiting for RPC address for: /usr/bin/packer
>
> 2020/03/19 05:22:54 Received unix RPC address for /usr/bin/packer: addr is
> /tmp/packer-plugin972069966
>
> 2020/03/19 05:22:54 packer-builder-amazon-ebs plugin: [INFO] Packer
> version: 1.5.4 [go1.13.7 linux amd64]
>
> 2020/03/19 05:22:54 packer-builder-amazon-ebs plugin: Checking
> 'PACKER_CONFIG' for a config file path
>
> 2020/03/19 05:22:54 packer-builder-amazon-ebs plugin: 'PACKER_CONFIG' not
> set; checking the default config file path
>
> 2020/03/19 05:22:54 packer-builder-amazon-ebs plugin: Attempting to open
> config file: /home/ubuntu/.packerconfig
>
> 2020/03/19 05:22:54 packer-builder-amazon-ebs plugin: [WARN] Config file
> doesn't exist: /home/ubuntu/.packerconfig
>
> 2020/03/19 05:22:54 packer-builder-amazon-ebs plugin: Setting cache
> directory: /home/ubuntu/packer/packer_cache
>
> 2020/03/19 05:22:54 packer-builder-amazon-ebs plugin: args:
> []string{"packer-builder-amazon-ebs"}
>
> 2020/03/19 05:22:54 packer-builder-amazon-ebs plugin: Plugin address: unix
> /tmp/packer-plugin972069966
>
> 2020/03/19 05:22:54 packer-builder-amazon-ebs plugin: Waiting for
> connection...
>
> 2020/03/19 05:22:54 packer-builder-amazon-ebs plugin: Serving a plugin
> connection...
>
> 2020/03/19 05:22:54 Creating plugin client for path: /usr/bin/packer
>
> 2020/03/19 05:22:54 Starting plugin: /usr/bin/packer
> []string{"/usr/bin/packer", "plugin", "packer-provisioner-shell"}
>
> 2020/03/19 05:22:54 Waiting for RPC address for: /usr/bin/packer
>
> 2020/03/19 05:22:54 Received unix RPC address for /usr/bin/packer: addr is
> /tmp/packer-plugin020649790
>
> 2020/03/19 05:22:54 packer-provisioner-shell plugin: [INFO] Packer
> version: 1.5.4 [go1.13.7 linux amd64]
>
> 2020/03/19 05:22:54 packer-provisioner-shell plugin: Checking
> 'PACKER_CONFIG' for a config file path
>
> 2020/03/19 05:22:54 packer-provisioner-shell plugin: 'PACKER_CONFIG' not
> set; checking the default config file path
>
> 2020/03/19 05:22:54 packer-provisioner-shell plugin: Attempting to open
> config file: /home/ubuntu/.packerconfig
>
> 2020/03/19 05:22:54 packer-provisioner-shell plugin: [WARN] Config file
> doesn't exist: /home/ubuntu/.packerconfig
>
> 2020/03/19 05:22:54 packer-provisioner-shell plugin: Setting cache
> directory: /home/ubuntu/packer/packer_cache
>
> 2020/03/19 05:22:54 packer-provisioner-shell plugin: args:
> []string{"packer-provisioner-shell"}
>
> 2020/03/19 05:22:54 packer-provisioner-shell plugin: Plugin address: unix
> /tmp/packer-plugin020649790
>
> 2020/03/19 05:22:54 packer-provisioner-shell plugin: Waiting for
> connection...
>
> 2020/03/19 05:22:54 packer-provisioner-shell plugin: Serving a plugin
> connection...
>
> *amazon-ebs: output will be in this color.*
>
> 2020/03/19 05:22:54 Build debug mode: false
>
> 2020/03/19 05:22:54 Force build: false
>
> 2020/03/19 05:22:54 On error:
>
> 2020/03/19 

Re: [packer] Unable to install the Google Cloud Logging Agent when using Packer

2020-03-11 Thread Rickard von Essen
Try installing python2 before running the script.

On Wed, Mar 11, 2020, 20:28 'Alexander Christie' via Packer <
packer-tool@googlegroups.com> wrote:

> Hi Rickard,
>
> I actually tried that earlier today and was unable to find any additional
> logs to help me understand what was going on.
>
> I also tried changing the execute command in a few different
> configurations but was ultimately unable to get any additional details.
>
> Thanks,
> Alex
>
> On Wednesday, March 11, 2020 at 6:59:39 PM UTC, Rickard von Essen wrote:
>>
>> Instead of curling down the script, download it and use the file
>> privisioner to get it into the image and run that. Also add set -x on the
>> top of it and you will probably find the issue.
>>
>> On Wed, Mar 11, 2020, 17:07 'Alexander Christie' via Packer <
>> packe...@googlegroups.com> wrote:
>>
>>> Hi all!
>>>
>>> I've hit an issue which I can't explain regarding inconsistent behaviour
>>> of the "https://dl.google.com/cloudagents/install-logging-agent.sh;
>>> when run via terminal and via packer.
>>>
>>> Running via terminal produces the expected result of installing the
>>> agent whilst running via packer causes the following failure:
>>> ==> googlecompute: Failed to download metadata for repo
>>> 'google-cloud-logging'
>>> ==> googlecompute: Error: Failed to download metadata for repo
>>> 'google-cloud-logging'
>>>
>>> Now I understand that this looks a lot like the "I'm using /sh instead
>>> of /bash" from the
>>> https://packer.io/docs/provisioners/shell.html#troubleshooting section
>>> of the documentation. However this is not the case as I explicitly run the
>>> script with bash and have verified that it is being run with bash through
>>> packer in a couple of different ways.
>>>
>>> I've included a replication case below that can easily be spun up by
>>> anyone with a Google Cloud Project. Hopefully someone here can see what is
>>> going wrong?
>>>
>>> Thanks!
>>>
>>>
>>> {
>>>  "variables": {},
>>>  "builders": [{
>>>  "type": "googlecompute",
>>>  "ssh_username": "provisioning",
>>>  "source_image_family": "centos-8",
>>>  "zone": "europe-west1-b",
>>>  "disable_default_service_account": true,
>>>  "image_name": "centos-8-base-{{isotime \"2006-01-02\"}}"
>>>  }],
>>>  "provisioners": [
>>>  {
>>>  "type": "shell",
>>>  "inline": [
>>>  "sudo yum upgrade -y"
>>>  ]
>>>  },
>>>  {
>>>  "type": "shell",
>>>  "inline": [
>>>  "curl -sL https://dl.google.com/cloudagents/install-logging-agent.sh |
>>> sudo bash -"
>>>  ]
>>>  }
>>>  ]
>>> }
>>>
>>>
>>>
>>> --
>>> 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 packe...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/packer-tool/5a382fa4-078e-4685-bf24-a71482f1cc53%40googlegroups.com
>>> <https://groups.google.com/d/msgid/packer-tool/5a382fa4-078e-4685-bf24-a71482f1cc53%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/e941f51b-3c5e-4c5a-bd57-689bb14d152f%40googlegroups.com
> <https://groups.google.com/d/msgid/packer-tool/e941f51b-3c5e-4c5a-bd57-689bb14d152f%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt-FAHEuQn6bMvX0nSCJb8R%3D3fDHhtR2R4QWkDJTjMRccA%40mail.gmail.com.


Re: [packer] Unable to install the Google Cloud Logging Agent when using Packer

2020-03-11 Thread Rickard von Essen
Instead of curling down the script, download it and use the file
privisioner to get it into the image and run that. Also add set -x on the
top of it and you will probably find the issue.

On Wed, Mar 11, 2020, 17:07 'Alexander Christie' via Packer <
packer-tool@googlegroups.com> wrote:

> Hi all!
>
> I've hit an issue which I can't explain regarding inconsistent behaviour
> of the "https://dl.google.com/cloudagents/install-logging-agent.sh; when
> run via terminal and via packer.
>
> Running via terminal produces the expected result of installing the agent
> whilst running via packer causes the following failure:
> ==> googlecompute: Failed to download metadata for repo
> 'google-cloud-logging'
> ==> googlecompute: Error: Failed to download metadata for repo
> 'google-cloud-logging'
>
> Now I understand that this looks a lot like the "I'm using /sh instead of
> /bash" from the
> https://packer.io/docs/provisioners/shell.html#troubleshooting section of
> the documentation. However this is not the case as I explicitly run the
> script with bash and have verified that it is being run with bash through
> packer in a couple of different ways.
>
> I've included a replication case below that can easily be spun up by
> anyone with a Google Cloud Project. Hopefully someone here can see what is
> going wrong?
>
> Thanks!
>
>
> {
>  "variables": {},
>  "builders": [{
>  "type": "googlecompute",
>  "ssh_username": "provisioning",
>  "source_image_family": "centos-8",
>  "zone": "europe-west1-b",
>  "disable_default_service_account": true,
>  "image_name": "centos-8-base-{{isotime \"2006-01-02\"}}"
>  }],
>  "provisioners": [
>  {
>  "type": "shell",
>  "inline": [
>  "sudo yum upgrade -y"
>  ]
>  },
>  {
>  "type": "shell",
>  "inline": [
>  "curl -sL https://dl.google.com/cloudagents/install-logging-agent.sh |
> sudo bash -"
>  ]
>  }
>  ]
> }
>
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/5a382fa4-078e-4685-bf24-a71482f1cc53%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_SEO6bbTd6uFSrxVRAyYbtiRn5jmKr52eEndVqFx%3Du1Q%40mail.gmail.com.


Re: [packer] Packer in OCI Government

2020-03-05 Thread Rickard von Essen
If you have a key account manager at Oracle try contacting him/her since
Oracle contributed and maintains this plugin. That might increase the
visibility of your issue for them.

On Wed, Mar 4, 2020, 23:33 'twmcel...@me.com' via Packer <
packer-tool@googlegroups.com> wrote:

> Looking for help with this bug. It is filed under hashicorp/packer #8842
> (OCI Government Region Fails)
>
>
> Overview of the Issue
>
> I am working with Packer and using Oracle Government Cloud. oracle-oci
> builder calls https://iaas..oraclecloud.com/xxx which does not work for
> us-luke-1 and us-langley-1 regions. It needs to call
> https://iaas.region.oraclegovcloud.com/xxx. I cannot override this
> behavior even though the CLI will naturally call the right endpoint when
> the region is a Government region.
> Reproduction Steps
>
> Set "access_cfg_file_account" to profile that uses Oracle government cloud
> region.
> packer build .json
> Packer version
>
> $ packer version
> Packer v1.5.1
> Simplified Packer Buildfile
>
> "builders":[{
> "access_cfg_file_account": "{{user cli_account}}",
> "availability_domain": "{{user availability_domain}}",
> "base_image_ocid": "{{user base_image}}",
> "compartment_ocid": "{{user compartment_id}}",
> "image_name": "ConsulServer",
> "shape": "VM.Standard2.1",
> "ssh_username": "opc",
> "subnet_ocid": "{{user subnet_id}}",
> "type": "oracle-oci"
> }],
> Operating system and Environment details
>
> Windows 10.
> Log Fragments and crash.log files
>
> 2020/03/04 14:48:07 packer.exe plugin: Serving a plugin connection...
> 2020/03/04 14:48:07 ui: oracle-oci: output will be in this color.
> 2020/03/04 14:48:07 ui:
> 2020/03/04 14:48:07 Build debug mode: false
> 2020/03/04 14:48:07 Force build: false
> 2020/03/04 14:48:07 On error:
> 2020/03/04 14:48:07 Preparing build: oracle-oci
> 2020/03/04 14:48:07 Waiting on builds to complete...
> 2020/03/04 14:48:07 Starting build run: oracle-oci
> 2020/03/04 14:48:07 Running builder: oracle-oci
> 2020/03/04 14:48:07 [INFO] (telemetry) Starting builder oracle-oci
> 2020/03/04 14:48:07 ui: ==> oracle-oci: Creating temporary ssh key for
> instance...
> 2020/03/04 14:48:07 ui: ==> oracle-oci: Creating instance...
> 2020/03/04 14:48:07 ui error: ==> oracle-oci: Problem creating instance:
> Post https://iaas.us-langley-1.oraclecloud.com/20160918/instances: dial
> tcp: lookup iaas.us-langley-1.oraclecloud.com: getaddrinfow: This is
> usually a temporary error during hostname resolution and means that the
> local server did not receive a response from an authoritative server.
> 2020/03/04 14:48:07 [INFO] (telemetry) ending oracle-oci
> 2020/03/04 14:48:07 ui error: Build 'oracle-oci' errored: Problem creating
> instance: Post
> https://iaas.us-langley-1.oraclecloud.com/20160918/instances: dial tcp:
> lookup iaas.us-langley-1.oraclecloud.com: getaddrinfow: This is usually a
> temporary error during hostname resolution and means that the local server
> did not receive a response from an authoritative server.
> 2020/03/04 14:48:07 machine readable: error-count []string{"1"}
> 2020/03/04 14:48:07 ui error:
> ==> Some builds didn't complete successfully and had errors:
> 2020/03/04 14:48:07 machine readable: oracle-oci,error []string{"Problem
> creating instance: Post
> https://iaas.us-langley-1.oraclecloud.com/20160918/instances: dial tcp:
> lookup iaas.us-langley-1.oraclecloud.com: getaddrinfow: This is usually a
> temporary error during hostname resolution and means that the local server
> did not receive a response from an authoritative server."}
> 2020/03/04 14:48:07 ui error: --> oracle-oci: Problem creating instance:
> Post https://iaas.us-langley-1.oraclecloud.com/20160918/instances: dial
> tcp: lookup iaas.us-langley-1.oraclecloud.com: getaddrinfow: This is
> usually a temporary error during hostname resolution and means that the
> local server did not receive a response from an authoritative server.
> 2020/03/04 14:48:07 ui:
> ==> Builds finished but no artifacts were created.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/6403ce20-7ef5-48df-b3ed-660b4f7ec3ea%40googlegroups.com
> 
> .
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in 

Re: [packer] Packer not returning latest AMI ID

2020-02-25 Thread Rickard von Essen
Your describe-images command doesn't filter based on owners which makes it
vulnerable to finding images from untrusted/malicious sources.

On Tue, Feb 25, 2020, 18:23 Mohammed Majid 
wrote:

> Dear Packer group,
>
> I am using latest packer 1.5.4
>
> I want to get the latest AMI ID's for Ubuntu 16.04, 18.04, CentOS7,
> AmazonLinux2
>
> Packer always uses the AMI ID which is one ami behind the latest ami, even
> though i tell to use the latest AMI.
>
> The following is the aws ec2 command which will return the latest AMI.
>
> aws ec2 describe-images \
>
>  --filters
> "Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-*"
> \
>
>  --query 'Images[*].[ImageId,CreationDate]' --output text \
>
>  | sort -k2 -r \
>
>  | head -n1
>
>
> Which returns *ami-092d0fe375260a228 ,* it is the latest one.
>
> In the packer json template i am using the following.
>
> "source_ami": "{{user `source_ami`}}",
> "source_ami_filter": {
>"filters": {
> "virtualization-type": "hvm",
>
> "name":"ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-*",
> "root-device-type": "ebs"
>   },
>   "owners": ["099720109477"],
>   "most_recent": true
>}
>
> it returns *ami-08bc77a2c7eb2b1da* and is not the latest one.
>
> In the above code i am passing the latest ami id in the source_ami
> variable, its not considering that, instead it picks an ami id which is one
> ami behind the latest one.
>
> Could you please let me know how can i solve this issue ?
>
> Appreciate your reply.
>
> Thanks & Regards
> Majid M A
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/CAGr0K9dkPcsy1cJaaGxNke2%3D03CPy-p%3DY8NV8wVsu9-GZkZT4A%40mail.gmail.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt-nDRX%3DNRsE8uQbkbY3_zoTmf5rzXKH1aE4B8W_6Uwdrg%40mail.gmail.com.


Re: [packer] Re: unable to parse private key

2020-02-24 Thread Rickard von Essen
Is thia the key you use for
https://packer.io/docs/builders/triton.html#triton_key_material?

Does it have a passphrase? Have you loaded it into your ssh-agent?

On Mon, Feb 24, 2020, 21:37 Mohammed Afroz  wrote:

> if am right this issue is similar to
> https://github.com/joyent/triton-kubernetes/issues/11
>
>
> On Monday, 24 February 2020 14:19:25 UTC-5, Mohammed Afroz wrote:
>>
>> while I validate my template json file, packer throws the exception as
>> below:
>>
>> Template validation failed. Errors are shown below.
>>
>> Errors validating build 'triton'. 1 error occurred:
>> * Error creating Triton request signer: unable to parse private key:
>> asn1: structure error: tags don't match (16 vs {class:1 tag:15 length:112
>> isCompound:true}) {optional:false explicit:false application:false
>> private:false defaultValue: tag: stringType:0 timeType:0
>> set:false omitEmpty:false} pkcs1PrivateKey @2
>>
>> I have tried generating new the ssh key but no luck, did anyone
>> encountered this before?
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/e35ebc76-b1b1-4267-8fd0-3690791b23bc%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt96OB-5hra%2BuEUMo9QTP1nUDfAPD9QpSHuWUxrjh0M7rw%40mail.gmail.com.


Re: [packer] unable to parse private key

2020-02-24 Thread Rickard von Essen
Can you Shar one ot the keys and what command you used to create it?

On Mon, Feb 24, 2020, 20:19 Mohammed Afroz  wrote:

> while I validate my template json file, packer throws the exception as
> below:
>
> Template validation failed. Errors are shown below.
>
> Errors validating build 'triton'. 1 error occurred:
> * Error creating Triton request signer: unable to parse private key: asn1:
> structure error: tags don't match (16 vs {class:1 tag:15 length:112
> isCompound:true}) {optional:false explicit:false application:false
> private:false defaultValue: tag: stringType:0 timeType:0
> set:false omitEmpty:false} pkcs1PrivateKey @2
>
> I have tried generating new the ssh key but no luck, did anyone
> encountered this before?
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/a547f312-e30a-4870-96a9-1aa80c503fa8%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_XSTjeF6ECb-ACviyryNvv103%2B82V__QcbheuLhjY-fw%40mail.gmail.com.


Re: [packer] output ovf file

2020-02-13 Thread Rickard von Essen
Change keep_input_artifact to true and you will also have the ovf file
after the build.

On Thu, Feb 13, 2020, 18:09 Mosby Simmons  wrote:

> Thanks for the response.  Yes, just a vagrant post-process:
>
>   "post-processors": [
> {
>   "type": "vagrant",
>   "keep_input_artifact": false,
>   "output": "windows_10_{{.Provider}}.box",
>   "vagrantfile_template": "vagrantfile-windows_10.template"
> }
>   ],
>
>
> On Wednesday, February 12, 2020 at 11:16:37 PM UTC-8, Rickard von Essen
> wrote:
>>
>> That should work. Do you have any post-processors?
>>
>> On Thu, Feb 13, 2020, 01:45 Mosby Simmons  wrote:
>>
>>> How do you output an ovf file from virtualbox-iso builder?
>>>
>>> I tried this:
>>>   "format": "ovf",
>>>   "output_directory": "c:\\packer\\output"
>>>
>>> I see the file as its building but then it disappears.
>>>
>>> Thanks
>>>
>>> --
>>> 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 packe...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/packer-tool/f6a9af5f-29c5-4412-861e-22a1f067ed5f%40googlegroups.com
>>> <https://groups.google.com/d/msgid/packer-tool/f6a9af5f-29c5-4412-861e-22a1f067ed5f%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/0cb0de85-e5dc-4e62-a6a1-782eb3b0d01a%40googlegroups.com
> <https://groups.google.com/d/msgid/packer-tool/0cb0de85-e5dc-4e62-a6a1-782eb3b0d01a%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_ubaofzw4FkC2kZzxmE%2BfOCvLwEfEizDXg%3D8eYWL00SQ%40mail.gmail.com.


Re: [packer] Using packer to copy files needed for build

2020-02-11 Thread Rickard von Essen
Scp works as normal from an instance. There is nothing special regarding
that when running packer. Build with --on-error=ask, when it fails log into
the instance end debug manually before destroying it.

On Mon, Feb 10, 2020 at 9:57 PM Gautam Singh 
wrote:

> Why not use file provisioner instead.
>
> https://packer.io/docs/provisioners/file.html
>
> Thanks
> Gautam
>
> On Mon, Feb 10, 2020, 2:45 PM Ralphael Johnson 
> wrote:
>
>> I have a file on a remote server that I am trying to have copied over
>> during the build process. Its failing to copy the file but it is connecting
>> successfully.  Is anyone using scp inside a script to copy a file from a
>> remote server during the packer build?
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/packer-tool/8cec51e4-7578-4ce1-be05-2a6eff92e406%40googlegroups.com
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/CAA7kr8AvZWT7wn4YPuQBscWwCZrN%2B7Vq5rdqesF-heWnvNDhJg%40mail.gmail.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9%2Bu78xByKGN5aPNtHccchAeS_8Yu1YFjJoUfTMqkaFeQ%40mail.gmail.com.


Re: [packer] Can I get the AMI ID from the source_ami_filter

2020-02-10 Thread Rickard von Essen
See https://packer.io/docs/builders/amazon-ebs.html#build-template-data

On Mon, Feb 10, 2020, 15:17 Ibrahim Buamod 
wrote:

> 
> Can I get the AMI ID from the source_ami_filter
> 
> 
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/0cf87eb0-afe1-43e2-b6ea-f4ab42ad3322%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9bMkm1FM8_qeBAZppJbixB%3DRkxyHyvFPmfUvGKDUyMEg%40mail.gmail.com.


Re: [packer] Packer, GCP, and reservations.

2020-01-30 Thread Rickard von Essen
Run packer with env var PACKER_LOG=1 and you will get more debug info.

On Thu, Jan 30, 2020, 21:17 Tony Worm  wrote:

> Google Cloud has the concept of VM reservations, which we use to ensure
> K80s are available when needed.
>
> I'm trying to build an image with packer, but it fails to consume any of
> the reservation. A VM with the same configuration does consume the
> reservation. There are flags to control how this works, but we have it set
> to defaults (with no need to specify flags) and still see our reservations
> used outside of packer.
>
> How can I see what packer is sending to the GCloud API Or where to start
> tracing this issue? Code and / or debug flags maybe?
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/a688ef34-c576-493c-bfb8-b13641c143bb%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9K3G91MvxWvC8UN7CYUie2%3D%3D9H1Ytc%2B6FS3NH1iKw3yQ%40mail.gmail.com.


Re: [packer] custome kms_key_id get error while using in launch_block_device_mappings in amzon-ebs builder

2020-01-30 Thread Rickard von Essen
You'r using a really old version of Packer. Try upgrading to a more
recent version.

On Wed, Jan 29, 2020 at 9:21 PM vrushabh  wrote:

> packer versoin 1.0.4
> Builder type : amazon-ebs
> I am following this docs:
> https://www.packer.io/docs/builders/amazon-ebs.html#block-devices-configuration
>
>  "launch_block_device_mappings": [{
> "device_name": "/dev/sda1",
> "volume_type": "gp2",
> "volume_size": 30,
> "encrypted": true,
> "kms_key_id": "12-aa-12-aa-12",
> "delete_on_termination": true
>   }]
>
>
>
> 1 error(s) occurred:
>
> * unknown configuration key: "launch_block_device_mappings[0].kms_key_id"
> Build step 'Execute shell' marked build as failure
>
>
> What is wrong in above code block?
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/d73ca7c4-bc47-44e0-a95f-1356ef50df6c%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9OBdJYTBgGye6zhz-JWE1orxfKh1%3Dz2Zm88KRzD5wfgg%40mail.gmail.com.


Re: [packer] Packer Openstack Builders - Specify Subnet

2020-01-30 Thread Rickard von Essen
Maybe you are looking for this:
https://packer.io/docs/builders/openstack.html#instance_floating_ip_net

On Wed, Jan 29, 2020 at 12:06 AM Ben Somogyi 
wrote:

> I have a network in openstack that has 4 different subnets.  One subnet
> does not have a gateway to my external network, and therefore cannot be
> assigned Floating IPs.  So,  I don't want my Packer builder instance to
> ever be created in that subnet.  However, for the life of me, I can't see
> how to specify the CIDR range or subnet that my packer builder instance
> should be created within. I see the ability to specify  "networks" and
> "floating_ip_pool" in the builder, but nothing for subnets.
>
> Appreciate any help!
>
> Thanks!
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/2cc795a7-89ab-4744-b6f5-fd1fed28d6a5%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt-Ji8DByd952fpQv%2BO9F0Asr0jE58MjyHhfcHPzxskQ6A%40mail.gmail.com.


Re: [packer] Continue on error during post-processing

2020-01-22 Thread Rickard von Essen
The -on-error argument is for troubleshooting not something you should use
by default.

If you want to ignore error just ensures that your script returns 0. On a
posix system that would just be ending your script with exit 0. (I have no
idea how to do that in Powershell)

But it think you should step back and think of the consequences of doing
this. If you allow your scripts to fail you won't know what's in your image
anymore which is the main reason of building the image from source in the
first place.

On Wed, Jan 22, 2020, 20:16 Chad Sylvester  wrote:

> I have a Packer build job for a Windows 2016 image.  The build and
> configuration works well.  The Processing works well.  Sometimes I get
> errors in the Post-Processing.  Maybe the site I'm trying to upload to is
> down or something else is wrong.  I'd like to be able to tell Packer to
> continue running the Post-Processing even when it runs into an error.  I
> hope I'm understanding Packer correctly, but the only item I see related to
> this topic is the "on-error=something".  The only options
> are: -on-error=cleanup, -on-error=abort, -on-error=ask.  I don't want it to
> cleanup, abort, or ask me to retry.  I'd like to either retry or simply
> continue.  I don't see either of these as options currently.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/3cae1149-d0b9-4455-9c0a-cb72d03d6d2f%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9-02R0rQ9p%3DZLR8yd%2BCBLqSrayyJYv36qE78Q2Y0Pe4g%40mail.gmail.com.


Re: [packer] how to change the size of disk with Packer chroot builder?

2020-01-19 Thread Rickard von Essen
I have never used Azure but maybe this is the option you are looking for?

https://packer.io/docs/builders/azure-chroot.html#os_disk_size_gb

On Sun, Jan 19, 2020, 10:15 Rodrigue Chakode 
wrote:

> Hello,
> Is it possible to change the default size of the device setup by Packer to
> build an image using chroot?
> Indeed, it seems that the size is fixed to 2Gb and in my case the
> provisionning script installs tools that make the disk full (causing the
> failing of the build).
>
> ==> azure-chroot: No apport report written because the error message
> indicates a disk full error
>
>
> https://groups.google.com/group/packer-tool
>
> Here is an extract of df -h
>
> /dev/sdd1   2.0G  1.7G  320M  84% /mnt/packer-azure-chroot-disks/sdd
>
> Thanks,
>
> Rodrigue
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/8ed1bd67-8840-45f1-92b4-df3966d8c647%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt8V-_WhkoF_yw1nn2tjrPSeS7Y9BEo%2BGYhiXKw4H4YkVg%40mail.gmail.com.


Re: [packer] packer and GCloud integration

2020-01-10 Thread Rickard von Essen
Try using source_image instead of source_image_family and point out the
exact image. Also verify that you can launch an instance from that image
with the gcloud command on the same host running Packer with the same
credentials.

On Thu, Jan 9, 2020, 17:21 Dimitar Dimov  wrote:

> I've been using the tools from HashiCorp (Packer and Terraform) to create
> images and then build VMs by using Jenkins on AWS. Now I have a project
> that is on GCloud and I have successfully configured Terraform to create a
> VM but when I try to run packer I get the following error root@packer
> packer]# packer build createImage.json
>
> googlecompute output will be in this color.
>
> ==> googlecompute: Checking image does not exist...
> ==> googlecompute: Creating temporary SSH key for instance...
> ==> googlecompute: Error getting source image for instance creation: Could 
> not find image, centos-7, in projects, [persuasive-axe-264518 centos-cloud 
> coreos-cloud debian-cloud google-containers opensuse-cloud rhel-cloud 
> suse-cloud ubuntu-os-cloud windows-cloud gce-nvme]: 11 error(s) occurred:
> ==> googlecompute:
> ==> googlecompute: * googleapi: got HTTP response code 400 with body:
> ==> googlecompute: * googleapi: got HTTP response code 400 with body:
> ==> googlecompute: * googleapi: got HTTP response code 400 with body:
> ==> googlecompute: * googleapi: got HTTP response code 400 with body:
> ==> googlecompute: * googleapi: got HTTP response code 400 with body:
> ==> googlecompute: * googleapi: got HTTP response code 400 with body:
> ==> googlecompute: * googleapi: got HTTP response code 400 with body:
> ==> googlecompute: * googleapi: got HTTP response code 400 with body:
> ==> googlecompute: * googleapi: got HTTP response code 400 with body:
> ==> googlecompute: * googleapi: got HTTP response code 400 with body:
> ==> googlecompute: * googleapi: got HTTP response code 400 with body:
> Build 'googlecompute' errored: Error getting source image for instance 
> creation: Could not find image, centos-7, in projects, [persuasive-axe-264518 
> centos-cloud coreos-cloud debian-cloud google-containers opensuse-cloud 
> rhel-cloud suse-cloud ubuntu-os-cloud windows-cloud gce-nvme]: 11 error(s) 
> occurred:
>
> * googleapi: got HTTP response code 400 with body:
> * googleapi: got HTTP response code 400 with body:
> * googleapi: got HTTP response code 400 with body:
> * googleapi: got HTTP response code 400 with body:
> * googleapi: got HTTP response code 400 with body:
> * googleapi: got HTTP response code 400 with body:
> * googleapi: got HTTP response code 400 with body:
> * googleapi: got HTTP response code 400 with body:
> * googleapi: got HTTP response code 400 with body:
> * googleapi: got HTTP response code 400 with body:
> * googleapi: got HTTP response code 400 with body:
>
> ==> Some builds didn't complete successfully and had errors:
> --> googlecompute: Error getting source image for instance creation: Could 
> not find image, centos-7, in projects, [persuasive-axe-264518 centos-cloud 
> coreos-cloud debian-cloud google-containers opensuse-cloud rhel-cloud 
> suse-cloud ubuntu-os-cloud windows-cloud gce-nvme]: 11 error(s) occurred:
>
> * googleapi: got HTTP response code 400 with body:
> * googleapi: got HTTP response code 400 with body:
> * googleapi: got HTTP response code 400 with body:
> * googleapi: got HTTP response code 400 with body:
> * googleapi: got HTTP response code 400 with body:
> * googleapi: got HTTP response code 400 with body:
> * googleapi: got HTTP response code 400 with body:
> * googleapi: got HTTP response code 400 with body:
> * googleapi: got HTTP response code 400 with body:
> * googleapi: got HTTP response code 400 with body:
> * googleapi: got HTTP response code 400 with body:
>
> ==> Builds finished but no artifacts were created.
>
> This is my createImage.json
>
> {
>  "variables": {
> "project_id": "persuasive-axe-264518"
>   },
>  "builders": [
> {
>   "type": "googlecompute",
>   "region": "europe-west1",
>   "zone": "europe-west1-b",
>   "project_id": "{{user `project_id`}}",
>   "source_image_family": "centos-7",
>   "image_name": "My-Test-Image",
>   "disk_size": 10,
>   "machine_type": "f1-micro",
>   "ssh_username": "centos"
> }
>   ]
> }
>
> I should mention that the service account that I am using is even given a
> owner permission just to be sure that I have no issues with the
> permissions. Does anybody has any idea why I have this issue while on AWS
> it works great.
>
> --
> 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 

Re: [packer] Packer docker builder stopping processes running on base image container

2019-12-29 Thread Rickard von Essen
When building with Packer no metadata is inherited like when you build with
a Dockerfile. So you need to refine CMD, ENTRYPOINT etc.

On Sun, Dec 29, 2019, 14:35 Satwik Mukherjee 
wrote:

> I am using below packer.json file to put war file into tomcat container &
> build it
>
> {
>   "builders": [{
> "type": "docker",
> "image": "tomcat:8.0",
> "commit": "true"
>   }],
>   "provisioners": [
> {
> "type": "file",
> "source": "sample.war",
> "destination": "/usr/local/tomcat/webapps/"
> }
>],
>   "post-processors": [
> [
>   {
> "type": "docker-tag",
> "repository": "satwikmukherjee/runner-poc",
> "tag": "{{timestamp}}"
>   },
>   {
> "type": "docker-push",
> "login": "true",
> "login_username": "",
> "login_password": ""
>   }
> ]
>   ]
> }
>
>
> After building while I am running the image committed , within container I
> am seeing tomcat is not running ,
>
> But while I am doing the same stuff through Dockerfile , no issue found ,
> Dockerfile used as below with the same logic .
>
>
> FROM tomcat:8.0
> COPY sample.war /usr/local/tomcat/webapps/
>
>
> Please let me know if I am doing anything wrong ..
>
> Regards,
> Satwik
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/15c136ed-5d87-40d3-9109-9ec1291da722%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_QH10Vb-m8cR01iO36%3DHnERFF_EwBDcKoehRkzajCtkQ%40mail.gmail.com.


Re: [packer] Creating temporary drives only during image build

2019-12-27 Thread Rickard von Essen
If I remember correctly you first add the device in
launch_block_device_mappings and then in ami_block_device_mappings you add
the same device again, but this time with the no_device set to true.

See https://packer.io/docs/builders/amazon-ebs.html#no_device

On Fri, Dec 27, 2019, 01:15 John Jones <
jjo...@integratedauctionsolutions.com> wrote:

> I'm trying to create a temporary drive during the packer build so i can
> make references to that additional drive in IIS virtual directories.  But i
> don't want this drive to be included in the AMI created, because a network
> drive will be used instead.
> It appears that both the ami and launch_block_device_mappings result in an
> AMI created with those drives included.  How do add a drive during the
> build so that I can configure IIS, but not have the drive included in the
> AMI?
>
> Here is what i am using so far, but results in /dev/sdf included in the
> AMI.
>
> "launch_block_device_mappings": [
> {
>   "device_name": "/dev/sda1",
>   "volume_size": 50,
>   "volume_type": "gp2",
>   "delete_on_termination": true
> },
> {
>   "device_name": "/dev/sdf",
>   "volume_size": 50,
>   "volume_type": "gp2",
>   "delete_on_termination": true
> }
>],
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/cd006c7a-8005-4ef9-bac1-4f8f582da636%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9DNGZK%2BVxChHCZOH41EuB7XBMaF_cF0Fsi5Bva1xet6A%40mail.gmail.com.


Re: [packer] Re: guix vagrant script stuck after reboot

2019-12-19 Thread Rickard von Essen
It's a very big topic and largely depends on related knowledge of
networking and Linux system administration etc.

Maybe check this
https://hostadvice.com/amp/how-to/how-to-troubleshoot-ssh-issues/

Or familiarize more with Linux administration:
https://debian-handbook.info/browse/stable/

On Thu, Dec 19, 2019, 07:26 Bashid  wrote:

> what topic i must explore when it's stick in error position?
>
> you troubleshoot ssh both from the host and inside the VM
>
>
> What's you mean? is it possible to explain more?
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/394077e0-1514-49af-bb2a-9279dc0e9457%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9gzr_txfobGC%2BmR_aPbOgH%3DEPyM1C4KCQ5Msu3uiSvkQ%40mail.gmail.com.


Re: [packer] Re: List of valid "guest_os_type" values for vSphere builder?

2019-12-18 Thread Rickard von Essen
I think the simplest way to find out is to manually create a VM with the
settings you want and then open the VMX file and check the content.

On Wed, Dec 18, 2019, 19:40 Emory Christenson  wrote:

> I managed to find a way to get the list from vCenter itself. That's not on
> there, I'll try it if the identifiers it listed don't get me anywhere.
> Thanks.
>
> On Wednesday, December 18, 2019 at 10:08:26 AM UTC-8, James Muldrow wrote:
>>
>> "windows9-64" worked for me for Server 2016.
>>
>> I have a working setup with instructions for Server 2016 on my github @
>> https://github.com/jamesmuldrow/Server-2016_Template_for_Packer
>>
>> Im still building on it but its a decent start.
>>
>> On Wednesday, December 18, 2019 at 12:43:00 PM UTC-5, Emory Christenson
>> wrote:
>>>
>>> Hi,
>>>
>>> No matter what I put for this value, our templates show up in vSphere as
>>> “Other (32-bit).”
>>> I’ve even taking to trying to edit the VMX directly during our builds.
>>> Nothing works.
>>>
>>>
>>> For Windows 2016 I’ve tried:
>>> windows9srv-64
>>> windows
>>> Windows2016_64
>>> etc, etc
>>>
>>>
>>> If anyone has any advice on how I can get the "Guest OS" field to
>>> populate correctly in vSphere, I would really, really appreciate it.
>>>
>>>
>>> Thanks
>>>
>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/af43ec77-e50f-45e8-97d6-df341858a5d7%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt97zy-nYTxPC9JLTkg%2B0kSP6qy_6auAWEcAgUerVi%3D0KQ%40mail.gmail.com.


Re: [packer] Re: guix vagrant script stuck after reboot

2019-12-18 Thread Rickard von Essen
Run with flag --on-error=ask.

When if fails you troubleshoot ssh both from the host and inside the VM.
And don't run headless when troubleshooting.

On Wed, Dec 18, 2019, 12:38 Bashid  wrote:

> in below is also debug messages.
>
>
> 2019/12/18 11:28:41 packer: 2019/12/18 11:28:41 [INFO] 35 bytes written
> for 'uploadData'
> 2019/12/18 11:28:41 [INFO] 35 bytes written for 'uploadData'
> 2019/12/18 11:28:41 packer: 2019/12/18 11:28:41 [DEBUG] Opening new ssh
> session
> 2019/12/18 11:28:41 packer: 2019/12/18 11:28:41 [ERROR] ssh session open
> error: 'client not available', attempting reconnect
> 2019/12/18 11:28:41 packer: 2019/12/18 11:28:41 [DEBUG] reconnecting to
> TCP connection for SSH
> 2019/12/18 11:28:41 packer: 2019/12/18 11:28:41 [DEBUG] handshaking with
> SSH
> 2019/12/18
>  11:28:45 packer: 2019/12/18 11:28:45 Retryable error: Error uploading
> script: ssh: handshake failed: ssh: unable to authenticate, attempted
> methods [none password publickey], no supported methods remain
>
>
>
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/5f873f17-96ea-4318-a30d-01f1fae94c8b%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_zfrWmhxa0OHryUDAPn5Su-dA7ek_F780FCH3745u86w%40mail.gmail.com.


Re: [packer] Re: Multi-stage builds

2019-12-18 Thread Rickard von Essen
No it doesn't have any built in support for multi stages. You have to have
different template files and build them in series.

For VM images there isn't usually any reason to build in multiple stages.
It's usually better to include "down streams" on the source level instead.

On Mon, Dec 16, 2019, 14:59 Loup Kreidl  wrote:

> Hello,
>
> This seems like an interesting idea to me!
>
> I've an extra use case to add to Max's one:
> We intend to use Packer to create our windows 10 ghost image and deploy it
> via PXE.
>
> To do so, we start from an iso and a VmWareIso builder, we apply the
> windows updates (+one or two tweaks) in this first build.
> Then we start a new packer build with a VmWareOvf builder that takes the
> artifact generated above. During this build we run the meat of our
> provisionning (installing softs via salt-masterless).
> And for the last build we also use the generated artifact but this time we
> are changing the VM's settings to boot via PXE so we can capture the VM.
>
> Since the two first step can take a while (up to 8h cumulated) if I can
> split those steps and have a "valid" artifact generated at each I can use
> those to make tests/changes on the next "layer" without having to rerun the
> whole process.
>
> We where wondering if packer could take another "packer-template" as a
> builder input and run successive builds by itself? (maybe this already
> exitst and we did not saw it?)
> Or maybe we are taking the wrong direction here?
>
> Best regards,
> Loup
>
> Le mercredi 23 octobre 2019 15:06:56 UTC+2, Max Weber a écrit :
>>
>> Hi,
>>
>> has Packer any kind of build-in support for multi-stage builds,
>> comparable to the one of Docker:
>>
>> https://docs.docker.com/develop/develop-images/multistage-build/
>>
>> At the moment I'm building a base image and use this one to build the
>> final image that contains my application. I only need to rebuild the base
>> image, when I install or update Linux packages or make changes that should
>> not be repeated on every normal build.
>>
>> Best regards,
>>
>> Max
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/925ff1e5-d1fa-4caf-85ad-db96c1a07be9%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9Cd0Nan5NjWBObmBhpx8j9U1MSx%3Dy79wS8ypYcCt-c0w%40mail.gmail.com.


Re: [packer] Packer node reboot is failing

2019-12-06 Thread Rickard von Essen
As the error message says, if you expect the script to disconnect the ssh
connection you need to add expect_disconnect": true. But a question, do you
need to reboot? When an instance is launched from the image it will boot
the latest (installed) kernel?

On Fri, Dec 6, 2019 at 5:17 AM Rajendra Kumar  wrote:

> Hi,
> While baking for *GCP* image, in my config.json I have a script which
> checks if the current kernel version is not the same as latest kernel
> version.
> if the kernel version is old then I do a reboot of my packer node. below
> is the code for the reboot.
>
>
>
>
>
>
>
>
>
>
> *latest_version=`rpm -qa kernel | sort -V| tail -1`latest_version=`echo 
> $latest_version | sed 's/\(kernel-*\)/''/g'`current_version=`uname -r`if [[ 
> $latest_version != $current_version ]]; then  DO_REBOOT=1fiif [ "$DO_REBOOT" 
> -eq 1 ]; then  /sbin/rebootfi*
>
>
>
> *But the packer is failing with the below error, not able to figure out what 
> is the issue here, Any idea what might be the issue here ?*
>
>
>
> *1575604931,,ui,message,gcp: Complete!
> 1575604932,,ui,say,==> gcp: Provisioning with shell script: 
> ../../commonscripts/check_reboot.sh
> 1575604932,,ui,error,==> gcp: + DO_REBOOT=0
> 1575604932,,ui,error,==> gcp: + yum -y erase /opt/nvidia/cuda/bin/nvcc
> 1575604932,,ui,message,gcp: Loaded plugins: fastestmirror
> 1575604932,,ui,error,==> gcp: No Match for argument: /opt/nvidia/cuda/bin/nvcc
> 1575604932,,ui,message,gcp: No Packages marked for removal
> 1575604932,,ui,error,==> gcp: + [[ '' == Standard_NC* ]]
> 1575604932,,ui,error,==> gcp: + [[ '' == g2.* ]]
> 1575604932,,ui,error,==> gcp: ++ rpm -qa kernel
> 1575604932,,ui,error,==> gcp: ++ sort -V
> 1575604932,,ui,error,==> gcp: ++ tail -1
> 1575604932,,ui,error,==> gcp: + latest_version=kernel-3.10.0-862.el7.x86_64
> 1575604932,,ui,error,==> gcp: ++ echo kernel-3.10.0-862.el7.x86_64
> 1575604932,,ui,error,==> gcp: ++ sed 's/\(kernel-*\)//g'
> 1575604932,,ui,error,==> gcp: + latest_version=3.10.0-862.el7.x86_64
> 1575604932,,ui,error,==> gcp: ++ uname -r
> 1575604932,,ui,error,==> gcp: + current_version=3.10.0-862.14.4.el7.x86_64
> 1575604932,,ui,error,==> gcp: + [[ 3.10.0-862.el7.x86_64 != 
> 3.10.0-862.14.4.el7.x86_64 ]]
> 1575604932,,ui,error,==> gcp: + DO_REBOOT=1
> 1575604932,,ui,error,==> gcp: + '[' 1 -eq 1 ']'
> 1575604932,,ui,error,==> gcp: + /sbin/reboot
> 1575604933,,ui,say,==> gcp: Provisioning step had errors: Running the cleanup 
> provisioner%!(PACKER_COMMA) if present...
> 1575604933,,ui,say,==> gcp: Deleting instance...
> 1575605107,,ui,message,gcp: Instance has been deleted!
> 1575605107,,ui,say,==> gcp: Deleting disk...
> 1575605110,,ui,message,gcp: Disk has been deleted!
> 1575605110,,ui,error,Build 'gcp' errored: Script disconnected unexpectedly. 
> If you expected your script to disconnect%!(PACKER_COMMA) i.e. from a 
> restart%!(PACKER_COMMA) you can try adding `"expect_disconnect": true` or 
> `"valid_exit_codes": [0%!(PACKER_COMMA) 2300218]` to the shell provisioner 
> parameters.
> 1575605110,,error-count,1
> 1575605110,,ui,error,\n==> Some builds didn't complete successfully and had 
> errors:
> 1575605110,gcp,error,Script disconnected unexpectedly. If you expected your 
> script to disconnect%!(PACKER_COMMA) i.e. from a restart%!(PACKER_COMMA) you 
> can try adding `"expect_disconnect": true` or `"valid_exit_codes": 
> [0%!(PACKER_COMMA) 2300218]` to the shell provisioner parameters.
> 1575605110,,ui,error,--> gcp: Script disconnected unexpectedly. If you 
> expected your script to disconnect%!(PACKER_COMMA) i.e. from a 
> restart%!(PACKER_COMMA) you can try adding `"expect_disconnect": true` or 
> `"valid_exit_codes": [0%!(PACKER_COMMA) 2300218]` to the shell provisioner 
> parameters.
> 1575605110,,ui,say,\n==> Builds finished but no artifacts were created.*
>
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/8b016b9b-4088-4bb2-a37c-7bd3650d9494%40googlegroups.com
> 
> .
>

-- 
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 

Re: [packer] Re: Passing sudo password to ansible (remote) provisioner

2019-11-23 Thread Rickard von Essen
See https://stackoverflow.com/a/29799758/226174

On Mon, Nov 18, 2019, 19:20 Valentin Leon 
wrote:

> Apologies for the double posting, I kept seeing Google Groups errors..
> some days nothing works.
>
> An error (#847) occurred while communicating with the server.
> RELOAD
>
> On Monday, November 18, 2019 at 10:18:55 AM UTC-8, Valentin Leon wrote:
>>
>> Hello,
>>
>> I am trying to provision a host using ansible (remote). The host is a
>> clean ubuntu 18.04 install, but I am blocked running a simple ansible
>> cookbook that requires root privileges.
>>
>> I can run simple shell commands such as:
>> echo '{{user `ssh_password`}}' | sudo -S shutdown -P now
>>
>> But I need a way to feed the sudo password into ansible, otherwise it
>> fails:
>> ubuntu-18.04: fatal: [default]: FAILED! => {"cache_update_time":
>> 1574096255, "cache_updated": false, "changed": false, "msg":
>> "'/usr/bin/apt-get
>>  -y -o \"Dpkg::Options::=--force-confdef\" -o
>> \"Dpkg::Options::=--force-confold\"  install 'mariadb-server''
>> failed: E: Could not open lock file /var/lib/dpkg/lock-frontend - open
>> (13: Permission denied)\nE: Unable to acquire the dpkg frontend lock
>> (/var/lib/dpkg/lock-frontend), are you root?\n", "rc": 100, "stderr": "E:
>>  Could not open lock file /var/lib/dpkg/lock-frontend - open (13:
>> Permission denied)\nE: Unable to acquire the dpkg frontend lock
>> (/var/lib/dpkg/lock-frontend), are you root?\n", "stderr_lines": ["E:
>> Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission
>> denied)", "E: Unable to acquire the dpkg frontend lock
>> (/var/lib/dpkg/lock-frontend), are you root?"], "stdout": "",
>> "stdout_lines": []}
>>
>> I have tried to tell ansible to use become:
>> ubuntu-18.04: fatal: [default]: FAILED! => {"msg": "Missing sudo
>> password"}
>>
>> I have tried to pass the password as input:
>> "provisioners": [
>>
>> "type": "ansible",
>>
>> "command": "bash -c \"echo '{{user `ssh_password`}}' |
>> ansible-playbook $@\"",
>> "extra_arguments":
>> [
>> "--ask-become-pass"
>> ],
>>
>> however, this fails as it seems we cannot pass a commands with arguments:
>>
>> * Error running "bash -c "echo '' | ansible-playbook $@"
>> --version": exec: "bash -c \"echo '' | ansible-playbook $@\"":
>> executable file not found in $PATH
>>
>> I have tried to use the user root directly:
>> "provisioners": [
>> "type": "ansible",
>>
>> "user": "root",
>>
>> however this fails because I imagine ubuntu does not allow root to SSH
>> directly:
>>
>> ubuntu-18.04: fatal: [default]: UNREACHABLE! => {"changed": false,
>> "msg": "Authentication or permission failure. In some cases, you may
>> have been able to authenticate and did not have permissions on the target
>> directory. Consider changing the remote tmp path in ansible.cfg to a path
>> rooted in \"/tmp\". Failed command was: ( umask 77 && mkdir -p \"` echo
>> /root/.ansible/tmp/ansible-tmp-1574094286.5371425-44623893214428 `\" &&
>> echo ansible-tmp-1574094286.5371425-44623893214428=\"` echo
>> /root/.ansible/tmp/ansible-tmp-1574094286.5371425-44623893214428 `\" ),
>> exited with result 1", "unreachable": true}
>>
>> I would like to find a solution that does not requires lowering the
>> security of my host, such as allowing root SSH, or passwordless sudo. This
>> seem like a pretty basic scenario, and I am surprised that I could not fine
>> anyone explaining how to solve this issue. The only reference I found is
>> this post:
>> https://github.com/hashicorp/packer/issues/4263#issuecomment-280103496
>> but it got shutdown and the poster did not created a ticket.
>>
>> Any ideas or help would be very welcome.
>>
>> Thanks
>>
>> Val
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/827f4b20-b10e-4090-83de-5dac7e641ca8%40googlegroups.com
> 
> .
>

-- 
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 

Re: [packer] Packer not connecting to custom port in google cloud

2019-11-07 Thread Rickard von Essen
Run packer build with PACKER_LOG=1 and you will get more information.

Please share your template.

On Fri, Nov 8, 2019, 04:37 Azhagiri panneer 
wrote:

> Kindly share me syntax if you have for custom port.
>
> On Fri, Nov 8, 2019, 9:06 AM Azhagiri panneer 
> wrote:
>
>> It's updated but still it not working... The log are not show which port
>> is trying to connect...
>>
>> On Fri, Nov 8, 2019, 3:18 AM Rickard von Essen <
>> rickard.von.es...@gmail.com> wrote:
>>
>>> Most likely you didn't update the GCP firewall rules.
>>>
>>> On Thu, Nov 7, 2019, 13:37 Azhagiri panneer 
>>> wrote:
>>>
>>>> Hi Team
>>>>
>>>> what to know how to connect with custom port in google cloud packer
>>>>
>>>> --
>>>> 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+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/packer-tool/a17fd5bc-0965-4c54-8ed8-5c777129aa05%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/packer-tool/a17fd5bc-0965-4c54-8ed8-5c777129aa05%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/packer-tool/CALz9Rt-%2B1cMDqhBCFOnV7b67mnozAzfyKJ6B2D0maXZagRnMAQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/packer-tool/CALz9Rt-%2B1cMDqhBCFOnV7b67mnozAzfyKJ6B2D0maXZagRnMAQ%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/CAK7oeN2PgHOFz5C1%2BoHOfsVepCg3v5y_WUnzy06_uDKAFKaw_w%40mail.gmail.com
> <https://groups.google.com/d/msgid/packer-tool/CAK7oeN2PgHOFz5C1%2BoHOfsVepCg3v5y_WUnzy06_uDKAFKaw_w%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_zDWQ9qjFwmDXzw_NA1ghkSe3WZ%2BoXyoVckOHtyJxsew%40mail.gmail.com.


Re: [packer] Packer not connecting to custom port in google cloud

2019-11-07 Thread Rickard von Essen
Most likely you didn't update the GCP firewall rules.

On Thu, Nov 7, 2019, 13:37 Azhagiri panneer 
wrote:

> Hi Team
>
> what to know how to connect with custom port in google cloud packer
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/a17fd5bc-0965-4c54-8ed8-5c777129aa05%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt-%2B1cMDqhBCFOnV7b67mnozAzfyKJ6B2D0maXZagRnMAQ%40mail.gmail.com.


Re: [packer] Permission denied: '/etc/.ansible_tmp4jZR1Denvironment'

2019-11-06 Thread Rickard von Essen
Try running it as a normal user.

https://packer.io/docs/provisioners/ansible.html#become-yes

On Wed, Nov 6, 2019, 17:53 Hakim KHANCHOUCH <
hakim-externe.khancho...@dalkia.fr> wrote:

> yes
>
> Le mercredi 6 novembre 2019 14:36:41 UTC+1, Rickard von Essen a écrit :
>>
>> Are you running Packer as root?
>>
>> On Tue, Nov 5, 2019, 17:20 Hakim KHANCHOUCH 
>> wrote:
>>
>>> Hello,
>>>
>>> I'm using packet to create an AMI and ansible to setup the instance.
>>> but running the packer script, i got this message [Errno 13] Permission
>>> denied: '/etc/.ansible_tmp4jZR1Denvironment'"}
>>> PS: I'm using become: yes in my playbook file.
>>>
>>> Could you please help ?
>>>
>>> Thanks.
>>>
>>> --
>>> 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 packe...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/packer-tool/24725672-5c76-446f-b5eb-b95fca4df62d%40googlegroups.com
>>> <https://groups.google.com/d/msgid/packer-tool/24725672-5c76-446f-b5eb-b95fca4df62d%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/2bd1eaef-7d68-4b7f-8247-08bb2e678426%40googlegroups.com
> <https://groups.google.com/d/msgid/packer-tool/2bd1eaef-7d68-4b7f-8247-08bb2e678426%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt-JApKZuOnNc-AuPszbC4QyKYbQnjDX%2BKM53A4uLy%3DHLg%40mail.gmail.com.


Re: [packer] Re: Looking for WinRM instructions

2019-11-06 Thread Rickard von Essen
You need to set them in autounattended.xml since a powershell provisioner
requires the WinRM connection.

On Wed, Nov 6, 2019, 09:59 Jimster  wrote:

> This works for me building W2016 Servers, YMMV...
>
> Here is my build file:
> {
> "builders": [{
> "type": "amazon-ebs",
> "vpc_id":   "**",
> "subnet_id":"**",
> "region":   "us-east-1",
> "source_ami":   "**",
> "ami_name": "My packer-demo-{{timestamp}}",
> "user_data_file":   "*./USERDATA2.0.txt*",
> "communicator": "winrm",
> "winrm_username":   "Administrator",
> "instance_type":"m3.medium",
> "winrm_use_ssl":true,
> "winrm_insecure":   true
> }],
>
> "provisioners": [
> {
> "type": "file",
> "source":   "./packages/something/",
> "destination":  "C:\\temp"
> },
> {
> "type": "powershell",
> "script":   "./install_something.ps1"
> },
> {
> "type": "powershell",
> "inline": [
>
> "C:/ProgramData/Amazon/EC2-Windows/Launch/Scripts/InitializeInstance.ps1 
> -Schedule"
> ,
>
> "C:/ProgramData/Amazon/EC2-Windows/Launch/Scripts/SysprepInstance.ps1 
> -NoShutdown"
> ]
> }
>
> ]
> }
>
> Then in *USERDATA2.0.txt* I have:
> 
>
>
> write-output "Running User Data Script"
> write-host "(host) Running User Data Script"
>
>
> Set-ExecutionPolicy Unrestricted -Scope LocalMachine -Force -ErrorAction
> Ignore
>
>
> # Don't set this before Set-ExecutionPolicy as it throws an error
> $ErrorActionPreference = "stop"
>
>
> # Remove HTTP listener
> Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse
>
>
> $Cert = New-SelfSignedCertificate -CertstoreLocation Cert:\LocalMachine\My
> -DnsName "packer"
> New-Item -Path WSMan:\LocalHost\Listener -Transport HTTPS -Address *
> -CertificateThumbPrint $Cert.Thumbprint -Force
>
>
> #Create Folder for Package Source Files (AMI Install Version)
> Write-Host "Doing Temp File Folder Creation"
> New-Item -Path "c:\" -name "temp" -itemType "directory" -force
>
>
> # WinRM
> write-output "Setting up WinRM"
> write-host "(host) setting up WinRM"
>
>
> cmd.exe /c winrm quickconfig -q
> cmd.exe /c winrm set "winrm/config" '@{MaxTimeoutms="180"}'
> cmd.exe /c winrm set "winrm/config/winrs" '@{MaxMemoryPerShellMB="1024"}'
> cmd.exe /c winrm set "winrm/config/service" '@{AllowUnencrypted="true"}'
> cmd.exe /c winrm set "winrm/config/client" '@{AllowUnencrypted="true"}'
> cmd.exe /c winrm set "winrm/config/service/auth" '@{Basic="true"}'
> cmd.exe /c winrm set "winrm/config/client/auth" '@{Basic="true"}'
> cmd.exe /c winrm set "winrm/config/service/auth" '@{CredSSP="true"}'
> cmd.exe /c winrm set "winrm/config/listener?Address=*+Transport=HTTPS"
> "@{Port=`"5986`";Hostname=`"packer`";CertificateThumbprint=`"$($Cert.Thumbprint)`"}"
> cmd.exe /c netsh advfirewall firewall set rule group="remote
> administration" new enable=yes
> cmd.exe /c netsh firewall add portopening TCP 5986 "Port 5986"
> Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 2048
> cmd.exe /c net stop winrm
> cmd.exe /c sc config winrm start= auto
> cmd.exe /c net start winrm
>
>
> 
>
> Try that setup.
>
>
>
> On Wednesday, 6 November 2019 00:06:22 UTC, Mosby Simmons wrote:
>>
>> I'm new to Packer and trying to get a base image up for Win10.
>>
>> Is there a good resource somewhere on getting WinRM to work in Packer?
>>
>> I'm running on a Win10 system with virtualbox and I just can't seem to
>> get WinRM to work.  It just sits there waiting to connect.
>>
>> I have lines:
>>
>>   "winrm_insecure": true,
>>   "winrm_use_ntlm": true,
>>   "winrm_use_ssl": true,
>>   "communicator": "winrm",
>>   "winrm_username": "vagrant",
>>   "winrm_password": "vagrant",
>>
>> and tried various flavors but no luck.
>>
>> Also do people usually set winrm information in the autounattend file or
>> as a separate powershell script?  And does it matter?
>>
>> A little guidance would be very helpful.
>>
>> TIA.
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/80ee81c7-9482-4ca3-bd8f-65acc0b17484%40googlegroups.com
> 

Re: [packer] Permission denied: '/etc/.ansible_tmp4jZR1Denvironment'

2019-11-06 Thread Rickard von Essen
Are you running Packer as root?

On Tue, Nov 5, 2019, 17:20 Hakim KHANCHOUCH <
hakim-externe.khancho...@dalkia.fr> wrote:

> Hello,
>
> I'm using packet to create an AMI and ansible to setup the instance.
> but running the packer script, i got this message [Errno 13] Permission
> denied: '/etc/.ansible_tmp4jZR1Denvironment'"}
> PS: I'm using become: yes in my playbook file.
>
> Could you please help ?
>
> Thanks.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/24725672-5c76-446f-b5eb-b95fca4df62d%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt-FXWnH-uXoz6twKf899pBq4a1D0L82oEqZcH9pj%2BpaTQ%40mail.gmail.com.


Re: [packer] using ami_product_codes usage

2019-11-01 Thread Rickard von Essen
If I remember correctly this is how it works:

You can't change product code. It is given when you upload a new AMI to the
AWS Marketplace. That requires a Market place partnership with AWS. The
product code follows the AMI (even if it's copied or create from a snapshot
base on an instance launched from it). This ensure that all users of the
software sold on the Marketplace pays for the usage.

On Thu, Oct 31, 2019, 22:17 John Roh  wrote:

> Hi,
>
> I have backed Centos AMI based on the AWS Marketplace which contains the
> product codes.
> I want to overwrite the product code that I used ami_product_codes :[ 'my
> custom string' ] during the packer . build.
> Is there any a better way to overwrite the existing product code? As
> passing a string value in am_product_codes, I ran into the error message
> saying "Error modify AMI attributes: InvalidParameterValue: Invalid value
> 'my custom string' for productCode".
> Is that meaning I can't update the existing ProductCode?
>
> John.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/dc8c0dd4-83db-4861-8baf-dbce733cd50f%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt-BAyXSMOToP7mYSRLHzMW%3Dr3_eXhdbHCyTUimrU%2BnYYA%40mail.gmail.com.


Re: [packer] resetting network interface before saving image

2019-10-16 Thread Rickard von Essen
See this code
https://github.com/chef/bento/blob/master/packer_templates/centos/scripts/cleanup.sh#L15

On Thu, Oct 17, 2019, 02:31 Mauricio Tavares  wrote:

> So I have packer create a centos image, but when it saves (creates) it, it
> saves the old mac address, associating it with the default interface. Is
> there a way to remove that so when I create a vm guest based on said image
> it will configure the default interface based on whatever mac/uuid it is
> given?
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/455a2eeb-57e3-4192-8e85-21443edcf97e%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9HH3TTJPSF4KgT%2BQgZMpz%2BVdhmWLsvt_3BxqwpE2qMug%40mail.gmail.com.


Re: [packer] How to fix 'Permission denied error'?

2019-10-16 Thread Rickard von Essen
It should be "sudo bash -c 'echo \'$PreserveFQDN on\' >>
/etc/rsyslog.d/server.conf'"

On Wed, Oct 16, 2019, 04:44 Anil Wadghule  wrote:

> When I have following config
>
> {
> "type": "shell",
> "inline":[
> "sudo echo '$PreserveFQDN on' >>
> /etc/rsyslog.d/server.conf”,
> ]
>  } ] }
>
> I get this error
>
> ==> amazon-ebs: /tmp/script_1019.sh: 27: /tmp/script_1019.sh: cannot
> create /etc/rsyslog.d/server.conf: Permission denied
>
> I know sudo mv a local file would fix that, but I don’t want to copy whole
> server.conf locally and move.
>
> cannot create /etc/rsyslog.d/server.conf: Permission denied
>
> Thanks,
> Anil
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/7F5A79E0-003D-4986-9087-F78BE0A0A529%40gmail.com
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt8W9HRNDQXUZp9L1KUdTgDef%3DjZD0tmwvJAbjZa-nJ1XQ%40mail.gmail.com.


Re: [packer] Passing Tags & Run_tags Blocks in var-file : Is This Possible?

2019-10-16 Thread Rickard von Essen
No, currently this is not supported. Only single values and arrays work.

On Wed, Oct 16, 2019, 10:31 Jimster  wrote:

> Hi,
>
> Been tasked with cleaning up packer code to remove duplication of explicit
> values in our working  build .json files - and use a few general
> *var-files* that will contain the relevant DEV, TEST and PROD instance
> types, vpc details, disk sizes etc.
>
> One of the builders sections we use are *tags *(and *run_tags*) of the
> format:
>
> "run_tags": {
>"Environment":  "DEV",
>"Application":  "Dave",
>"Tier": "Web App",
>"Function": "Dev Dave Web App",
>"Version":  "1.0",
>"CostCentre":   "0300 3246",
>"BusinessUnit": "AppServices",
>"Project":  "DaveMigration to AWS",
>"Product":  "IIS Server for Dave",
>"SupportEmail": "d...@dave.com",
>"ComplianceDomain": "YES",
>"DataClass":"5",
>"ProvisionedBy":"Packer",
>"ProvisionedWho":   "d...@dave.com",
>"ProjectName":  "Dave",
>"Name": "Dave Dev Web Box"
>},
>
> I'm not sure if or how I can include these arrays in a var-file.  Ideally
> the build file wants to refer to these as some kind of user variable e.g.
> in line with the usual ones:
> "builders": [{
>"type": "amazon-ebs",
>
> "region":   "{{ user `DEV_server_region`}}",
>"source_ami":   "{{ user `DEV_server_source_ami`}}",
> *"tags": "{{ user `DEV_dave_tags`}}",  <== WHATEVER
> FORMAT THIS SHOULD BE IN FOR A TAG BLOCK (Array?)*
>"instance_type":"{{ user `DEV_server_instance_type`}}",
>"winrm_use_ssl":true,
>"winrm_insecure":   true
>}],
>
> I've tried to capture these tag arrays in the var-file as so (snippet):
> ...
>
> "PROD_server_user_data_file":   "./USERDATA2.0.txt",
>
> "CA_server_run_tags": [{
>"Environment":  "DEV",
>"Application":  "Dave",
>"Tier": "Web App",
>"Function": "Dev Dave Web App",
>"Version":  "1.0",
>"CostCentre":   "0300 3246",
>"BusinessUnit": "AppServices",
>"Project":  "DaveMigration to AWS",
>"Product":  "IIS Server for Dave",
>"SupportEmail": "d...@dave.com",
>"ComplianceDomain": "YES",
>"DataClass":"5",
>"ProvisionedBy":"Packer",
>"ProvisionedWho":   "d...@dave.com",
>"ProjectName":  "Dave",
>"Name": "Dave Dev Web Box"
> }]
>
>
> But I get:
> packer validate -var-file .\dave_vars.json .\build_var_test_Dave.json
> invalid value ".\\dave_vars.json" for flag -var-file: Error reading
> variables in '.\dave_vars.json': json: cannot unmarshal array into Go value
> of type string
>
> Can someone please advise on how best to include (if possible) these tags
> and run_tags arrays into the var-file *and* refer to the resulting user
> array variable properly in the builder file?
>
> Thanks,
> Jimster
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/8975abcb-e431-4005-8e76-b40f6b048e8f%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt-5-EBD%2Bhjv4jZbN3EJHaUxUuGwsF6nZ2jErDJ07vqa4A%40mail.gmail.com.


Re: [packer] AWS Credential Passing Issue

2019-10-09 Thread Rickard von Essen
The packer program use your credentials to make API directly. Nor
credentials is passed to the EC2 instance launched. The canonical way of
giving it AWS API access is by using iam_instance_profile.

See https://packer.io/docs/builders/amazon-ebs.html#iam_instance_profile

On Wed, Oct 9, 2019, 15:21 CJ Ess  wrote:

> The documentation is a bit vague about how credential passing works. I've
> given the packer server all of the credentials it needs for the amazon ebs
> builder including iam:passrole for * resources in its instance profile, and
> I removed all other references to IAM from the json template. I noticed
> today that AWS cli commands running on the packer builder are failing
> because they can't determine their credentials.
>
> I was assuming that the key/secret/token was being passed to the packer
> builder, or that it would just use the profile of the packer builder. Is
> that not how it works?
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/4e1e2710-a5fc-493a-ac30-b90719e1eedb%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9%2BR0jrX7NaF2fFp5XLDcWHORT33J%3DqF52kLmg%2BuKWkiA%40mail.gmail.com.


Re: [packer] Help - CoreOS/Hyperv-iso not working # Timeout waiting for SSH.

2019-10-08 Thread Rickard von Essen
DId you follow the note on the bottom of
https://packer.io/docs/builders/hyperv-iso.html?

Note for *nix guests: Please note that packer requires the VM to be running
> a hyper-v KVP daemon in order to detect the IP address of the guest VM. On
> RHEL based machines this may require installing the package hyperv-daemons
> and ensuring the hypervkvpd service is started at boot. On Debian based
> machines, you may need linux-cloud-tools-common for hv_kvp_daemon. Failure
> to do this may cause packer to wait at Waiting for SSH to become
> available... before eventually timing out.


On Tue, Oct 8, 2019 at 6:56 PM Andre Moraes (ICARO TECH) <
andre.mor...@motorolasolutions.com> wrote:

> Hello everyone,
>
> I’m new in Packer world and I’m stuck in a few days trying to create an
> hyperv image using CoreOS as ‘iso’.
> Here’s the template that I’m using right now:
>
> {
> "description": "CoreOS image for a VirtualBox platform.",
>
> "builders": [{
>   "type": "hyperv-iso",
>   "iso_url": 
> "https://stable.release.core-os.net/amd64-usr/current/coreos_production_iso_image.iso;,
>   "iso_checksum": "5d41fe61404f298a87f303d766b84d3b",
>   "iso_checksum_type": "md5",
>   "ssh_username": "packer",
>   "ssh_password": "packer",
>   "vm_name": "testvm",
>   "memory": 3000,
>"ssh_timeout" : "10m",
>   "shutdown_command": "echo 'packer' | sudo -S shutdown -P now",
>   "boot_wait": "50s",
>   "http_directory": "./extra/files",
>   "boot_command": [
> "sudo -i",
> "systemctl stop sshd.socket",
> "wget http://{{ .HTTPIP }}:{{ .HTTPPort }}/install.yml",
> "coreos-install -d /dev/sda -C {{user `channel`}} -c install.yml",
>   "reboot"
>   ]
> }]
>
> }
>
> Error: [DEBUG] Error getting SSH address: No ip address
> Timeout waiting for SSH.
>
>
> Full packer_log attached.
>
> Your privacy is important to us. That is why we have taken appropriate
> measures to ensure the data you provide to us is kept secure. To learn more
> about how we process your personal information, how we comply with
> applicable data protection laws, and care for the security and privacy of
> your personal data, please review our Privacy Policy
> .
> If you have any questions related to data protection and compliance with
> applicable laws, please contact us at our Security Operations Center at 
> 1-302-444-9838
> or mail us at:
>
> Attention: Privacy Compliance Program, P.O. Box 59263, Schaumburg, IL
> USA, 60159-0263
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/50eea96a-3d64-4d90-9a6c-5bb4d48edc85%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9c%3DCJsdENHpdyUxwxMgRL8io6zY2wZYsooM2XX3qiEdg%40mail.gmail.com.


Re: [packer] How to specify variable for 'bool' item

2019-10-06 Thread Rickard von Essen
See https://github.com/hashicorp/packer/issues/2630

On Sun, Oct 6, 2019, 00:57 Yusuke Masuda  wrote:

> Hi.
>
> I want to specify a variable for 'bool' type item such as
> "keep_input_artifact".
>
> Firstly, I tried this.
>   "keep_input_artifact": "{{user `keep_input_artifact`}}",
>:
>:
>   "variables": {
> "keep_input_artifact": true,
>   }
>
> Then I got an error below.
> Failed to parse template: 2 errors occurred:
> * variable keep_input_artifact: '' expected type 'string', got
> unconvertible type 'bool'
> * post-processor 1.1: 1 error(s) decoding:
> * 'keep_input_artifact' expected type 'bool', got unconvertible type
> 'string'
>
> It seems to say that it is wrong to specify the string value to 'bool'
> type.
>
> Next I tried removing the quotes.
>   "keep_input_artifact": {{user `keep_input_artifact`}},
>:
>:
>   "variables": {
> "keep_input_artifact": true,
>   }
>
> So I got another error below.
> Failed to parse template: Error parsing JSON: invalid character '{'
> looking for beginning of object key string
> At line 42, column 34 (offset 1204):
>41: "type": "vagrant",
>42: "keep_input_artifact": {{
>^
>
> The error was a kind of JSON syntax error, seemed that it interpret the
> bracket for template as a part of JSON object.
>
> I wonder I cannot use a variable for not string fields.
> Please give me any advice for this, if you have.
>
> Sincerly,
>
> Yusuke
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/81b07ab2-bea2-4ccb-b9c4-4f81641a4bb0%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt8GR7_1b70od%3D1AFejPLRXSh2FN_W37SGhtkuzB3PUs4g%40mail.gmail.com.


Re: [packer] Packer Ansible provisioner, how to specify the host of the container/machine?

2019-09-19 Thread Rickard von Essen
It seems like you only need to add

extra_arguments: [ "--extra-vars", "kubernetes_role=master"]

On Wed, Sep 18, 2019, 18:15 Kevin Galkov  wrote:

> How would I indicate to the machine what kubernetes installation it needs
> to use? For clarity, I'm using these roles:
> https://github.com/geerlingguy/ansible-role-kubernetes#two-or-more-nodes-single-master-cluster
>
> On Wednesday, September 18, 2019 at 12:17:30 AM UTC-7, Rickard von Essen
> wrote:
>>
>> Try to remove the inventory_file option
>>
>> On Wed, Sep 18, 2019, 07:20 Kevin Galkov  wrote:
>>
>>> Hi #packer!
>>>
>>> I am trying to learn more about Packer and Ansible. I think those too
>>> along with Terraform, Bazel and jsonnet will be great to use!
>>>
>>> With packer I am able to pass in a playbook.yml and an inventory file to
>>> Ansible. However, I would like to be able to specify to ansible what host
>>> it is currently running on, so it knows what section of the inventory file
>>> to utilize.
>>>
>>> I tried the `host_alias` parameter, but I then ended up with:
>>>
>>>amazon-ebs: fatal: [master_host]: UNREACHABLE! => {"changed": false,
>>> "msg": "Failed to connect to the host via ssh: ssh: Could not resolve
>>> hostname master_host: nodename nor servname provided, or not known",
>>> "unreachable": true}
>>>
>>> Any ideas on what is the best way to tell Ansible what machine it is
>>> provisioning through Packer?
>>>
>>> Thank you!
>>>
>>> Kevin
>>>
>>> [provision.yml file:::]
>>> ---
>>>
>>> - hosts: all
>>>
>>>   vars:
>>> kubernetes_allow_pods_on_master: true
>>>
>>>   roles:
>>> - geerlingguy.docker
>>> - geerlingguy.kubernetes
>>>
>>> [inventory_master file:::]
>>> [master]
>>> master_host
>>>
>>> [master:vars]
>>> kubernetes_role=master
>>>
>>> [node]
>>> node_host1
>>> node_host2
>>>
>>> [node:vars]
>>> kubernetes_role=node
>>>
>>> [example.json file:::]
>>> {
>>>   "variables": {
>>> "aws_access_key": "",
>>> "aws_secret_key": ""
>>>   },
>>>   "builders": [{
>>> "type": "amazon-ebs",
>>> "access_key": "{{user `aws_access_key`}}",
>>> "secret_key": "{{user `aws_secret_key`}}",
>>> "region": "us-east-1",
>>> "source_ami_filter": {
>>>   "filters": {
>>> "virtualization-type": "hvm",
>>> "name": "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*",
>>> "root-device-type": "ebs"
>>>   },
>>>   "owners": ["099720109477"],
>>>   "most_recent": true
>>> },
>>> "instance_type": "t2.micro",
>>> "ssh_username": "ubuntu",
>>> "ami_name": "packer-example {{timestamp}}"
>>>   }],
>>>   "provisioners": [{
>>>   "type": "ansible",
>>>   "user": "root",
>>>   "playbook_file": "/Users/kevin/pdev/tgkj/corp/dev/provision.yml",
>>>   "inventory_file":
>>> "/Users/kevin/pdev/tgkj/corp/dev/inventory_master.yml",
>>>   "host_alias": "master_host"
>>> }, {
>>>   "type": "shell",
>>>   "inline": [
>>> "echo Thanks to https://alex.dzyoba.com/blog/packer-for-docker/
>>> and make sure to use jsonnet to properly share the configuration."
>>>   ]
>>> }
>>>   ]
>>> }
>>>
>>> --
>>> 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

Re: [packer] Packer Ansible provisioner, how to specify the host of the container/machine?

2019-09-18 Thread Rickard von Essen
Try to remove the inventory_file option

On Wed, Sep 18, 2019, 07:20 Kevin Galkov  wrote:

> Hi #packer!
>
> I am trying to learn more about Packer and Ansible. I think those too
> along with Terraform, Bazel and jsonnet will be great to use!
>
> With packer I am able to pass in a playbook.yml and an inventory file to
> Ansible. However, I would like to be able to specify to ansible what host
> it is currently running on, so it knows what section of the inventory file
> to utilize.
>
> I tried the `host_alias` parameter, but I then ended up with:
>
>amazon-ebs: fatal: [master_host]: UNREACHABLE! => {"changed": false,
> "msg": "Failed to connect to the host via ssh: ssh: Could not resolve
> hostname master_host: nodename nor servname provided, or not known",
> "unreachable": true}
>
> Any ideas on what is the best way to tell Ansible what machine it is
> provisioning through Packer?
>
> Thank you!
>
> Kevin
>
> [provision.yml file:::]
> ---
>
> - hosts: all
>
>   vars:
> kubernetes_allow_pods_on_master: true
>
>   roles:
> - geerlingguy.docker
> - geerlingguy.kubernetes
>
> [inventory_master file:::]
> [master]
> master_host
>
> [master:vars]
> kubernetes_role=master
>
> [node]
> node_host1
> node_host2
>
> [node:vars]
> kubernetes_role=node
>
> [example.json file:::]
> {
>   "variables": {
> "aws_access_key": "",
> "aws_secret_key": ""
>   },
>   "builders": [{
> "type": "amazon-ebs",
> "access_key": "{{user `aws_access_key`}}",
> "secret_key": "{{user `aws_secret_key`}}",
> "region": "us-east-1",
> "source_ami_filter": {
>   "filters": {
> "virtualization-type": "hvm",
> "name": "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*",
> "root-device-type": "ebs"
>   },
>   "owners": ["099720109477"],
>   "most_recent": true
> },
> "instance_type": "t2.micro",
> "ssh_username": "ubuntu",
> "ami_name": "packer-example {{timestamp}}"
>   }],
>   "provisioners": [{
>   "type": "ansible",
>   "user": "root",
>   "playbook_file": "/Users/kevin/pdev/tgkj/corp/dev/provision.yml",
>   "inventory_file":
> "/Users/kevin/pdev/tgkj/corp/dev/inventory_master.yml",
>   "host_alias": "master_host"
> }, {
>   "type": "shell",
>   "inline": [
> "echo Thanks to https://alex.dzyoba.com/blog/packer-for-docker/
> and make sure to use jsonnet to properly share the configuration."
>   ]
> }
>   ]
> }
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/0a2dffd5-e0f2-4927-bde9-af089c4ecd55%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt8ZxPkvsuB0rs_%2B_zkLpgQ7wSgYWPQe%3DMWBQMr1_uSbTQ%40mail.gmail.com.


Re: [packer] Can't feed kickstart file from floppy

2019-09-13 Thread Rickard von Essen
See this issue for some details
https://github.com/hashicorp/packer/issues/2920

On Fri, Sep 13, 2019, 19:21 Rickard von Essen 
wrote:

> Pretty sure floppy support in kickstart was removed in recent versions of
> EL.
>
> On Fri, Sep 13, 2019, 16:51 Mauricio Tavares  wrote:
>
>> So I am trying to deploy a centos guest on a vmware host using packer. I 
>> want to feed the kickstart file using the a floppy drive 
>> (https://www.packer.io/docs/builders/vmware-iso.html#floppy_files). So, here 
>> is my setup:
>>
>>
>> # Stolen from the last example in 
>> https://www.packer.io/docs/builders/vmware-iso.html
>>
>>"builders": [
>> {
>>   "type": "vmware-iso",
>>   "guest_os_type" : "{{user `guest_os`}}",
>>   "iso_url": "{{user `iso_url`}}",
>>   "iso_checksum_url": "{{user `iso_checksum_url`}}",
>> [...]
>>  "floppy_files": [
>> "floppy/ks.cfg"
>>   ],
>>   "boot_command": [
>> " inst.text inst.ks=hd:fd0:/ks.cfg "
>>   ],
>>   "boot_wait": "8s",
>>   "shutdown_command": "echo {{user `ssh_pass`}} | sudo -S shutdown -P -h 
>> now"
>> }
>>   ]
>> }
>>
>>
>> When I run it, it behaves as it cannot find the ks.cfg file and goes to
>> the normal manual setup. Am I missing something here?
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/packer-tool/771f2a19-3b3b-416f-8c2f-aa80f0a42712%40googlegroups.com
>> <https://groups.google.com/d/msgid/packer-tool/771f2a19-3b3b-416f-8c2f-aa80f0a42712%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_CaTO8Fm0cSy1-qTeKNnOLqZ3yAC%3D%3Dbk2z2T0pnOi%3DHA%40mail.gmail.com.


Re: [packer] Can't feed kickstart file from floppy

2019-09-13 Thread Rickard von Essen
Pretty sure floppy support in kickstart was removed in recent versions of
EL.

On Fri, Sep 13, 2019, 16:51 Mauricio Tavares  wrote:

> So I am trying to deploy a centos guest on a vmware host using packer. I want 
> to feed the kickstart file using the a floppy drive 
> (https://www.packer.io/docs/builders/vmware-iso.html#floppy_files). So, here 
> is my setup:
>
>
> # Stolen from the last example in 
> https://www.packer.io/docs/builders/vmware-iso.html
>
>"builders": [
> {
>   "type": "vmware-iso",
>   "guest_os_type" : "{{user `guest_os`}}",
>   "iso_url": "{{user `iso_url`}}",
>   "iso_checksum_url": "{{user `iso_checksum_url`}}",
> [...]
>  "floppy_files": [
> "floppy/ks.cfg"
>   ],
>   "boot_command": [
> " inst.text inst.ks=hd:fd0:/ks.cfg "
>   ],
>   "boot_wait": "8s",
>   "shutdown_command": "echo {{user `ssh_pass`}} | sudo -S shutdown -P -h 
> now"
> }
>   ]
> }
>
>
> When I run it, it behaves as it cannot find the ks.cfg file and goes to
> the normal manual setup. Am I missing something here?
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/771f2a19-3b3b-416f-8c2f-aa80f0a42712%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt-UtAr9ecbrmWEXmYhUXgLUT%3DAh0%2BtiLkoGweu0wGnAhw%40mail.gmail.com.


Re: [packer] Reuse object

2019-09-06 Thread Rickard von Essen
There is no way to do that currently without preprocessing. Doing it with
something like jq would be fairly easy.

On Fri, Sep 6, 2019, 19:40 Markku Nikkanen 
wrote:

> Hello,
>
> I use same keys in tags and run_tags options:
>
> "builders": [
> {
>   "tags": {
>   
>   },
>   "run_tags": {
>   
>   }
>
> How one can define tags once and reuse those in tags and run_tags options?
> Following did not work:
>
> "variables": {
> "reusable_tags": {
> 
> }
> ...
> "builders": [
> {
>   "tags": "{{user `reusable_tags `}}",
>   "run_tags": "{{user `reusable_tags `}}"
> ...
>
> Best regards,
> Markku
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/686c0408-d437-4599-bab4-8f06f826d54f%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt-z5xruOKU1iUX-edVsEY-g%3DskCZnNCsOnFJq7NKy%3D2QQ%40mail.gmail.com.


Re: [packer] grub config being overwritten when starting an image created with packer (Openstack/Packer/CentOS)

2019-09-04 Thread Rickard von Essen
So my question was if you are using PV (para-virtualized) or HVM (hardware
assisted virtualization).

(and you can run OpenStack with many different underlying virtualization
systems).

On Fri, Aug 30, 2019, 11:38 Matt Faraday  wrote:

> Hi
>
> It's openstack, so KVM.
> These are VMs.
>
>
>
> On Thursday, 29 August 2019 22:57:28 UTC+1, Rickard von Essen wrote:
>>
>> Could you provide some more details? What's the underlying virtualization
>> system? Is this PV or HVM VM's? Etc
>>
>> On Thu, Aug 29, 2019, 19:34 Matt Faraday  wrote:
>>
>>> Hi All,
>>>
>>> I'm facing a strange issue, where I've modified /etc/default/grub in my
>>> image to change GRUB_CMDLINE_LINUX to add some extra flags. If I do this to
>>> an already running instance, it's fine, a reboot and the changes persist.
>>>
>>> I'm creating images using packer, and if I make this change when
>>> creating an image, when the instance starts those changes are not there,
>>> despite packer making the change and then creating the image.
>>>
>>> Any idea what is over-writing this ? Can't seem to find any info online,
>>> and other people suggest making changes to the kernel boot parameters in
>>> the same way as I'm doing. I am also running grub2-mkconfig -o
>>> /boot/grub2/grub.cfg as well after making the change.
>>>
>>> OS is CentOS 7.
>>>
>>> Example output from packer (it does a cat /etc/default/grub for me to
>>> show what it is)
>>>
>>> [0;32m openstack: GRUB_TIMEOUT=1 [0m
>>> [0;32m openstack: GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g'
>>> /etc/system-release)" [0m
>>> [0;32m openstack: GRUB_DEFAULT=saved [0m
>>> [0;32m openstack: GRUB_DISABLE_SUBMENU=true [0m
>>> [0;32m openstack: GRUB_TERMINAL="serial console" [0m
>>> [0;32m openstack: GRUB_SERIAL_COMMAND="serial --speed=115200" [0m
>>> [0;32m openstack: GRUB_CMDLINE_LINUX="console=tty0 crashkernel=auto
>>> console=ttyS0,115200 net.ifnames=0 biosdevname=0 audit=1"
>>>
>>> but after starting the image 
>>>
>>> [root@kernel4-nic-test-2471ee92 cloud]# cat /etc/default/grub
>>>
>>> GRUB_TIMEOUT=1
>>> GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
>>> GRUB_DEFAULT=saved
>>> GRUB_DISABLE_SUBMENU=true
>>> GRUB_TERMINAL="serial console"
>>> GRUB_SERIAL_COMMAND="serial --speed=115200"
>>> GRUB_CMDLINE_LINUX="console=tty0 crashkernel=auto console=ttyS0,115200"
>>>
>>>
>>> Does anyone know what is overwriting this ?
>>>
>>> --
>>> 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 packe...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/packer-tool/ad7247f8-3b6f-482e-864b-8d165be39933%40googlegroups.com
>>> <https://groups.google.com/d/msgid/packer-tool/ad7247f8-3b6f-482e-864b-8d165be39933%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/8e81a820-3b4a-4f48-a6b6-25312e8823e0%40googlegroups.com
> <https://groups.google.com/d/msgid/packer-tool/8e81a820-3b4a-4f48-a6b6-25312e8823e0%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_QONmhrvpiwkadZMet3qfeRswZiHSXK7WH84nJMDGmCQ%40mail.gmail.com.


Re: [packer] Help - Timeout Waiting SSH virtualbox-ovf

2019-09-04 Thread Rickard von Essen
Some kind of networking needs to work for Packer to be able to reach the VM
over SSH.

On Tue, Sep 3, 2019, 14:54 Andre Moraes (ICARO TECH) <
andre.mor...@motorolasolutions.com> wrote:

> Networking doesn't work but is running in my local computer in virtualbox.
>
>   The most strange thing is that, now I was able to use boot commands to
> make the login but it still get stucks in "Waiting for ssh"
>
> On Monday, September 2, 2019 at 5:18:38 PM UTC-3, Rickard von Essen wrote:
>>
>> Does that image start ssh on boot? Is network working? Can you manually
>> ssh with the given credentials to the VM?
>>
>> Could you rerun with PACKER_LOG=1 set and provide the full output here.
>>
>> What's the VM? Is it something public?
>>
>> On Mon, Sep 2, 2019, 20:02 Andre Moraes (ICARO TECH) <
>> andre...@motorolasolutions.com> wrote:
>>
>>> Hi.
>>>
>>> I'm facing the following issue when I try to use packer to build an VM
>>> image.
>>> Looks like packer can't connect in my VM and make the login, so it stay
>>> stuck forever.
>>>
>>> The file that I'm using is an OVA file from an existing VM.
>>> During the process, virtualbox get the VM up and running but when comes
>>> to login page it stuck forever:
>>>
>>> JSON file:
>>>
>>> {
>>> "builders": [
>>> {
>>> "type": "virtualbox-ovf",
>>> "source_path":
>>> "C:\Users\Administrator\Desktop\Packer\cloudconnect-2.0.ova",
>>> "ssh_username": "user",
>>> "ssh_password": "password",
>>> "communicator": "ssh",
>>> "ssh_pty": true,
>>> "ssh_port": 22,
>>> "shutdown_command": "echo 'packer' | sudo -S shutdown -P now"
>>> }
>>> ]
>>> }
>>>
>>> Attaching the log in the image.
>>> As you can see, the VM is avaiable and waiting for the login, but even I
>>> got ssh timeout
>>>
>>> Your privacy is important to us. That is why we have taken appropriate
>>> measures to ensure the data you provide to us is kept secure. To learn more
>>> about how we process your personal information, how we comply with
>>> applicable data protection laws, and care for the security and privacy of
>>> your personal data, please review our Privacy Policy
>>> <https://www.motorolasolutions.com/en_us/about/privacy-policy.html#privacystatement>.
>>> If you have any questions related to data protection and compliance with
>>> applicable laws, please contact us at our Security Operations Center at 
>>> 1-302-444-9838
>>> or mail us at:
>>>
>>> Attention: Privacy Compliance Program, P.O. Box 59263, Schaumburg, IL
>>> USA, 60159-0263
>>>
>>> --
>>> 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 packe...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/packer-tool/1f45ce6e-93d1-4690-84af-1c2f5e03c4e5%40googlegroups.com
>>> <https://groups.google.com/d/msgid/packer-tool/1f45ce6e-93d1-4690-84af-1c2f5e03c4e5%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>
> Your privacy is important to us. That is why we have taken appropriate
> measures to ensure the data you provide to us is kept secure. To learn more
> about how we process your personal information, how we comply with
> applicable data protection laws, and care for the security and privacy of
> your personal data, please review our Privacy Policy
> <https://www.motorolasolutions.com/en_us/about/privacy-policy.html#privacystatement>.
> If you have any questions related to data protection and compliance with
> applicable laws, please contact us at our Security Operations Center at 
> 1-302-444-9838
> or mail us at:
>
> Attention: Privacy Compliance Program, P.O. Box 59263, Schaumburg, IL
> USA, 60159-0263
>
> --
>

Re: [packer] Getting packer to be able to change an image from a local GCP bucket

2019-09-04 Thread Rickard von Essen
It's how GCE works.

(You can't do that with AWS for normal EBS backed AMI's either)

On Tue, Sep 3, 2019, 14:43 Wes Quinn  wrote:

> Thanks for responding.
>
> So is this a limitation on packer or GCP?
>
> So it is impossible to modify my OVA file, in my personal bucket?
>
> I was just wondering which app is putting the restriction on, since I can
> do this fine using AWS.
>
> If it is packer, then hopefully I can get someone to change it.
>
> If it is GCP, I can see why from them.
>
> Thanks,
> Wes Quinn
>
> On Wednesday, August 21, 2019 at 4:42:02 PM UTC-4, Rickard von Essen wrote:
>>
>> And to use a non default source image you should set
>> https://packer.io/docs/builders/googlecompute.html#source_image_project_id
>>
>> On Wed, Aug 21, 2019, 22:39 Rickard von Essen 
>> wrote:
>>
>>> First you have to create an image from the disk in gcs with gcloud, see
>>> https://cloud.google.com/sdk/gcloud/reference/compute/images/create
>>>
>>> Use the --source-uri argument.
>>>
>>> On Wed, Aug 21, 2019, 21:58 Wes Quinn  wrote:
>>>
>>>> Hello,
>>>>
>>>> I am working with packerpy and GCP to be able to load an OVA file to a
>>>> personal bucket and then modify that image and create a new image from
>>>> that, using the provisioners feature in a JSON file.
>>>>
>>>> I have the process to upload to a personal bucket working, but I can't
>>>> figure out how to get packer to find my image in my personal bucket.
>>>> Packer keeps searching the public area.  I didn't see where I can use a
>>>> bucket.
>>>>
>>>> Anyone have any idea on how to get packet to modify the image from the
>>>> personal bucket?
>>>>
>>>> On a separate note, I am able to use packer, in this same manner with
>>>> AWS, just fine.
>>>>
>>>> Here is an example of my JSON for GCP:
>>>>
>>>> {
>>>>   "variables": {
>>>> "disk_size": 150,
>>>> "project_id": "proj-id",
>>>> "result_image": "packer-example-{{timestamp}}",
>>>> "source_image": "rhel-7-5-x86-64-minimal-ova",
>>>> "ssh_password": "password",
>>>> "ssh_timeout": "3m",
>>>> "ssh_username": "user",
>>>> "zone": "us-east-1"
>>>>   },
>>>>   "builders": [
>>>> {
>>>>   "disk_size": "{{user `disk_size`}}",
>>>>   "image_name": "{{user `result_image`}}",
>>>>   "project_id": "{{user `project_id`}}",
>>>>   "source_image": "{{user `source_image`}}",
>>>>   "ssh_password": "{{user `ssh_password`}}",
>>>>   "ssh_username": "{{user `ssh_username`}}",
>>>>   "type": "googlecompute",
>>>>   "zone": "{{user `zone`}}"
>>>> }
>>>>   ],
>>>>   "provisioners": [
>>>> {
>>>>   "type": "file",
>>>>   "source": "./welcome.sh",
>>>>   "destination": "/root/",
>>>>   "direction": "upload"
>>>> },
>>>> {
>>>>   "type": "shell",
>>>>   "inline": [
>>>> "chmod +x welcome.sh",
>>>> "./welcome.sh"
>>>>   ]
>>>> }
>>>>   ]
>>>> }
>>>>
>>>> Here is the Python code that uses the above JSON code:
>>>> import argparse
>>>> import json
>>>> from packerpy import PackerExecutable
>>>> parser = argparse.ArgumentParser(description='This script modifies a
>>>> GCP image in GCP.')
>>>> parser.add_argument('-f', '--json_file', required=True, help='The JSON
>>>> file that contains the changes to make to the image file.')
>>>> args = parser.parse_args()
>>>> json_file = args.json_file
>>>> packer_bin = '/usr/local/bin/packer'
>>>> p = PackerExecutable(packer_bin)
>>>> (results, output, error) = p.build(json_file)
>>>> if res

Re: [packer] DHCP Problem while generating an image on ESXi

2019-09-04 Thread Rickard von Essen
Did you follow the instructions here?

https://packer.io/docs/builders/vmware-iso.html#building-on-a-remote-vsphere-hypervisor

With the excli command mentioned above you should get the IP of the VM if
guestiohack have been enabled.

On Tue, Sep 3, 2019, 11:04 Thorsten Baumeister 
wrote:

> The Ubuntu Installer prints: "Network autoconfiguration has succeeded".
>
> The command 'esxcli network ip interface list' just lists the network
> interace of the server, but if I do a 'esxcli vm process list', the machine
> gets listed between all the others VMs running on the server.
> -ubuntu-18.04
>World ID: 27543498
>Process ID: 0
>VMX Cartel ID: 27543497
>UUID: 56 4d a2 2c 40 4e 41 08-7d 3c 34 86 57 dc fa 9b
>Display Name: -ubuntu-18.04
>Config File:
> /vmfs/volumes/59c0ffa0-c794a290-37b2-001cc4972452/-ubuntu-18.04/-ubuntu-18.04.vmx
>
> The problem exists regardless using a E1000 or a VMXNET3 NIC.
>
>
> Am Montag, 2. September 2019 19:52:24 UTC+2 schrieb Rickard von Essen:
>>
>> What's the exact output when you say there is a successful dhcp message?
>>
>> If you log into the ESXi, in the excli is the machine listed in:
>> network ip interface list
>>
>> On Mon, Sep 2, 2019, 17:58 Thorsten Baumeister 
>> wrote:
>>
>>> Hi,
>>> I use packer 1.4.3 on Unbuntu 16.04 to build an Ubuntu 18.05 VM on an
>>> ESXi-Server 6.0.0.
>>> The "vmware-iso" builder manages to create, register and boot the VM and
>>> it starts the installation. I can follow the steps at the console of the
>>> vSphere Client.
>>> After the DHCP-query the installation stalls: the last output the Ubuntu
>>> installer generates is the success statement of the DHCP-query. After that
>>> the text vanishes and nothing else happens until the time limit is reached
>>> and the builder destroys the VM.
>>> If I interrupt the network configuration via DHCP (by clicking "Cancel"
>>> in the installer) and fill in the network parameters by hand, everything
>>> works fine. The builder generates the machine and it get's exported.
>>> Has anyone a tip for me?
>>>
>>> Regards,
>>> Thorsten
>>>
>>> --
>>> 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 packe...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/packer-tool/a617b2c1-9077-4119-83b7-3b574697f04f%40googlegroups.com
>>> <https://groups.google.com/d/msgid/packer-tool/a617b2c1-9077-4119-83b7-3b574697f04f%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/addfa1b9-8404-4d39-ac7c-1975bfb2bce4%40googlegroups.com
> <https://groups.google.com/d/msgid/packer-tool/addfa1b9-8404-4d39-ac7c-1975bfb2bce4%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_hfTORn5ZnsvbvBJiJGxOj7RHDVC%2BJBpP26eTK%3DkSOXg%40mail.gmail.com.


Re: [packer] Re: Packer build for fails with Bundler Bundler::SudoNotPermittedError

2019-08-31 Thread Rickard von Essen
Without analyzing what's going wrong I would take the path of least
resistance. Enabla password less (NOPASSWORD) for the user (ssh_username)
you are using and then run chef with sudo. That should work without any
problems.

And if you don't want passwordless sudo just remove it after chef have been
executed.

On Sat, Aug 31, 2019, 19:18 Rhythm Chopra  wrote:

> I have already tried execute command overload to the following.
>
> "execute_command": "echo password | sudo -S bash {{ .Script }}"
>
> But then my build fails with following logs.
>
>> 2019/08/31 20:17:06 packer: 2019/08/31 20:17:06 opening new ssh session
>> 2019/08/31 20:17:06 packer: 2019/08/31 20:17:06 Starting remote scp
>> process:  scp -vt /tmp/packer-chef-solo
>> 2019/08/31 20:17:06 packer: 2019/08/31 20:17:06 Started SCP session,
>> beginning transfers...
>> 2019/08/31 20:17:06 packer: 2019/08/31 20:17:06 Copying input data into
>> temporary file so we can read the length
>> 2019/08/31 20:17:06 packer: 2019/08/31 20:17:06 [DEBUG] scp: Uploading
>> solo.rb: perms=C0644 size=58
>> 2019/08/31 20:17:06 packer: 2019/08/31 20:17:06 SCP session complete,
>> closing stdin pipe.
>> 2019/08/31 20:17:06 packer: 2019/08/31 20:17:06 Waiting for SSH session
>> to complete.
>> 2019/08/31 20:17:06 packer: 2019/08/31 20:17:06 scp stderr (length 23):
>> Sink: C0644 58 solo.rb
>> 2019/08/31 20:17:06 ui: virtualbox-iso: Creating JSON attribute file
>> 2019/08/31 20:17:06 packer: 2019/08/31 20:17:06 [INFO] 619 bytes written
>> for 'uploadData'
>> 2019/08/31 20:17:06 packer: 2019/08/31 20:17:06 opening new ssh session
>> 2019/08/31 20:17:06 [INFO] 619 bytes written for 'uploadData'
>> 2019/08/31 20:17:06 packer: 2019/08/31 20:17:06 Starting remote scp
>> process:  scp -vt /tmp/packer-chef-solo
>> 2019/08/31 20:17:06 packer: 2019/08/31 20:17:06 Started SCP session,
>> beginning transfers...
>> 2019/08/31 20:17:06 packer: 2019/08/31 20:17:06 Copying input data into
>> temporary file so we can read the length
>> 2019/08/31 20:17:06 packer: 2019/08/31 20:17:06 [DEBUG] scp: Uploading
>> node.json: perms=C0644 size=619
>> 2019/08/31 20:17:06 packer: 2019/08/31 20:17:06 SCP session complete,
>> closing stdin pipe.
>> 2019/08/31 20:17:06 packer: 2019/08/31 20:17:06 Waiting for SSH session
>> to complete.
>> 2019/08/31 20:17:06 packer: 2019/08/31 20:17:06 scp stderr (length 26):
>> Sink: C0644 619 node.json
>> 2019/08/31 20:17:06 [INFO] (telemetry) ending chef-solo
>> 2019/08/31 20:17:06 [INFO] (telemetry) found error: Error executing Chef:
>> template: root:1:31: executing "root" at <.Script>: can't evaluate field
>> Script in type *chefsolo.ExecuteTemplate
>>
>>
>
> Please suggest
>
> Thanks,
> Rhythm
>
>
> On Saturday, August 31, 2019 at 8:09:02 PM UTC+3, Rhythm Chopra wrote:
>>
>> Hi,
>> I'm struggling with a packer build for a long time now. So I'm trying to
>> build Ubuntu 1404 server image with Packer using chef provisioner.
>> Initially build was getting stuck at the following command after installing
>> chef successfully,
>>
>>> 2019/08/31 17:36:04 ui: ==> virtualbox-iso: Provisioning with chef-solo
>>> 2019/08/31 17:36:04 ui: virtualbox-iso: Installing Chef...
>>> 2019/08/31 17:36:04 packer: 2019/08/31 17:36:04 opening new ssh session
>>> 2019/08/31 17:36:04 packer: 2019/08/31 17:36:04 starting remote command:
>>> curl -L https://omnitruck.chef.io/install.sh | { echo 'qwerty'; cat -;
>>> } | sudo -S bash -s -- -v 13.8.5
>>> 2019/08/31 17:36:04 ui: virtualbox-iso: % Total% Received %
>>> Xferd  Average Speed   TimeTime Time  Current
>>> 2019/08/31 17:36:04 ui: virtualbox-iso: Dload  Upload   Total
>>> SpentLeft  Speed
>>> 2019/08/31 17:36:04 ui: virtualbox-iso: 0 00 00
>>> 0  0  0 --:--:-- --:--:-- --:--:-- 0[sudo] password for
>>> metasploitable3: no talloc stackframe at ../source3/param/loadparm.c:4864,
>>> leaking memory
>>> 2019/08/31 17:36:04 ui: virtualbox-iso: 100 23103  100 23103
>>> 0 0   166k  0 --:--:-- --:--:-- --:--:--  167k
>>> 2019/08/31 17:36:04 ui: virtualbox-iso: ubuntu 14.04 x86_64
>>> 2019/08/31 17:36:04 ui: virtualbox-iso: Getting information for chef
>>> stable 13.8.5 for ubuntu...
>>> 2019/08/31 17:36:04 ui: virtualbox-iso: downloading
>>> https://omnitruck.chef.io/stable/chef/metadata?v=13.8.5=ubuntu=14.04=x86_64
>>> 2019/08/31 17:36:04 ui: virtualbox-iso: to file
>>> /tmp/install.sh.1749/metadata.txt
>>> 2019/08/31 17:36:04 ui: virtualbox-iso: trying wget...
>>> 2019/08/31 17:36:04 ui: virtualbox-iso: sha1
>>> 1ecb70effcf557dbac0d0de528bbef6937f9c581
>>> 2019/08/31 17:36:04 ui: virtualbox-iso: sha256
>>> ce0ff3baf39c8c13ed474104928e7e4568a4997a1d5797cae2b2ba3ee001e3a8
>>> 2019/08/31 17:36:04 ui: virtualbox-iso: url
>>> https://packages.chef.io/files/stable/chef/13.8.5/ubuntu/14.04/chef_13.8.5-1_amd64.deb
>>> 2019/08/31 17:36:04 ui: virtualbox-iso: version13.8.5
>>> 2019/08/31 17:36:04 ui: virtualbox-iso: downloaded 

Re: [packer] VMWare-iso provisioner - disk thin provisioning

2019-08-30 Thread Rickard von Essen
Provide your complete template, all scripts etc and the full output of a
build with PACKER_LOG=1 set. Also what the output of whatever command you
run to inspect the result and what exact version of ESXi you are using.

On Fri, Aug 30, 2019, 07:39 Pearl Dsilva  wrote:

> I am giving the disk_type_id as a string, but still am facing the issue.
>
> On Fri, Aug 30, 2019, 10:40 AM Rickard von Essen <
> rickard.von.es...@gmail.com> wrote:
>
>> You are supposed to use the strings and not the numbers. See
>> https://packer.io/docs/builders/vmware-iso.html#disk_type_id
>>
>> On Fri, Aug 30, 2019, 07:00 Pearl D'Silva  wrote:
>>
>>> Yes, I have used vmware-iso builder on a remote host.
>>>
>>> On Friday, August 30, 2019 at 10:09:24 AM UTC+5:30, Rickard von Essen
>>> wrote:
>>>>
>>>> I'm a bit confused here, do you use the vmware-iso builder on a remote
>>>> host (ESXi)?
>>>>
>>>> On Fri, Aug 30, 2019, 05:15 Pearl D'Silva  wrote:
>>>>
>>>>> Setting the "disk_type_id" to "5" leads the the following error:
>>>>>
>>>>> [image: packer_error.PNG]
>>>>>
>>>>> Following is the snippet of my packer configuration:
>>>>>
>>>>>  "builders": [
>>>>> {
>>>>>   "type": "vmware-iso",
>>>>>   "format": "ovf",
>>>>>   "skip_export": true,
>>>>>   "iso_url": "{{user `url`}}",
>>>>>   "iso_checksum": "{{user `checksum`}}",
>>>>>   "iso_checksum_type": "sha256",
>>>>>   "ssh_username": "{{user `ssh_username`}}",
>>>>>   "ssh_password": "{{user `ssh_password`}}",
>>>>>   "ssh_wait_timeout": "30m",
>>>>>   "cpus": "4",
>>>>>   "memory": "32000",
>>>>>   "disk_size": "68",
>>>>>   "disk_type_id": "5",
>>>>>   "headless": false,
>>>>>  . . .
>>>>>  . . .
>>>>> } ],
>>>>>
>>>>>
>>>>> Any pointers as to where I am going wrong?
>>>>>
>>>>> On Thursday, August 29, 2019 at 4:29:02 PM UTC+5:30, Rickard von Essen
>>>>> wrote:
>>>>>>
>>>>>> Post your template and a debug output from running Packer with
>>>>>> PACKER_LOG=1.
>>>>>>
>>>>>> On Thu, Aug 29, 2019, 12:48 Pearl Dsilva  wrote:
>>>>>>
>>>>>>> Yes I did, setting disk_type_id to the numeric values causes the
>>>>>>> packer build to fail. However, setting it to "thin" lead to the build to
>>>>>>> proceed, however the disk is thick provisioned eager zeroed
>>>>>>>
>>>>>>> On Thu, Aug 29, 2019, 4:14 PM Rickard von Essen <
>>>>>>> rickard...@gmail.com> wrote:
>>>>>>>
>>>>>>>> Have you looked at
>>>>>>>> https://packer.io/docs/builders/vmware-iso.html#disk_type_id ?
>>>>>>>>
>>>>>>>> On Thu, Aug 29, 2019, 11:33 Pearl D'Silva 
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> I am trying to enable thin provisioning for the disk by using the
>>>>>>>>> following: "disk_type_id": "thin", However, on vCenter, when the VM is
>>>>>>>>> being provisioned, I notice that the hard disk type is set to "Thick
>>>>>>>>> Provision Eager Zeroed". Any pointers on what could be causing this 
>>>>>>>>> issue
>>>>>>>>> would be really helpful.
>>>>>>>>>
>>>>>>>>> The partitioning recipe in the preseed file is as follows:
>>>>>>>>> d-i partman-auto/expert_recipe string \
>>>>>>>>>   boot-root ::\
>>>>>>>>>   1 1 1 free method{ biosgrub } . \
>>>>>>>>>   250 250 250 ext2\
>>>>

Re: [packer] VMWare-iso provisioner - disk thin provisioning

2019-08-29 Thread Rickard von Essen
You are supposed to use the strings and not the numbers. See
https://packer.io/docs/builders/vmware-iso.html#disk_type_id

On Fri, Aug 30, 2019, 07:00 Pearl D'Silva  wrote:

> Yes, I have used vmware-iso builder on a remote host.
>
> On Friday, August 30, 2019 at 10:09:24 AM UTC+5:30, Rickard von Essen
> wrote:
>>
>> I'm a bit confused here, do you use the vmware-iso builder on a remote
>> host (ESXi)?
>>
>> On Fri, Aug 30, 2019, 05:15 Pearl D'Silva  wrote:
>>
>>> Setting the "disk_type_id" to "5" leads the the following error:
>>>
>>> [image: packer_error.PNG]
>>>
>>> Following is the snippet of my packer configuration:
>>>
>>>  "builders": [
>>> {
>>>   "type": "vmware-iso",
>>>   "format": "ovf",
>>>   "skip_export": true,
>>>   "iso_url": "{{user `url`}}",
>>>   "iso_checksum": "{{user `checksum`}}",
>>>   "iso_checksum_type": "sha256",
>>>   "ssh_username": "{{user `ssh_username`}}",
>>>   "ssh_password": "{{user `ssh_password`}}",
>>>   "ssh_wait_timeout": "30m",
>>>   "cpus": "4",
>>>   "memory": "32000",
>>>   "disk_size": "68",
>>>   "disk_type_id": "5",
>>>   "headless": false,
>>>  . . .
>>>  . . .
>>> } ],
>>>
>>>
>>> Any pointers as to where I am going wrong?
>>>
>>> On Thursday, August 29, 2019 at 4:29:02 PM UTC+5:30, Rickard von Essen
>>> wrote:
>>>>
>>>> Post your template and a debug output from running Packer with
>>>> PACKER_LOG=1.
>>>>
>>>> On Thu, Aug 29, 2019, 12:48 Pearl Dsilva  wrote:
>>>>
>>>>> Yes I did, setting disk_type_id to the numeric values causes the
>>>>> packer build to fail. However, setting it to "thin" lead to the build to
>>>>> proceed, however the disk is thick provisioned eager zeroed
>>>>>
>>>>> On Thu, Aug 29, 2019, 4:14 PM Rickard von Essen 
>>>>> wrote:
>>>>>
>>>>>> Have you looked at
>>>>>> https://packer.io/docs/builders/vmware-iso.html#disk_type_id ?
>>>>>>
>>>>>> On Thu, Aug 29, 2019, 11:33 Pearl D'Silva  wrote:
>>>>>>
>>>>>>> I am trying to enable thin provisioning for the disk by using the
>>>>>>> following: "disk_type_id": "thin", However, on vCenter, when the VM is
>>>>>>> being provisioned, I notice that the hard disk type is set to "Thick
>>>>>>> Provision Eager Zeroed". Any pointers on what could be causing this 
>>>>>>> issue
>>>>>>> would be really helpful.
>>>>>>>
>>>>>>> The partitioning recipe in the preseed file is as follows:
>>>>>>> d-i partman-auto/expert_recipe string \
>>>>>>>   boot-root ::\
>>>>>>>   1 1 1 free method{ biosgrub } . \
>>>>>>>   250 250 250 ext2\
>>>>>>>   $primary{ } $bootable{ }\
>>>>>>>   method{ format } format{ }  \
>>>>>>>   use_filesystem{ } filesystem{ ext2 }\
>>>>>>>   mountpoint{ /boot } \
>>>>>>>   .   \
>>>>>>>   500 18 18 ext4   \
>>>>>>>   lv_name{ root } \
>>>>>>>   method{ lvm } format{ } \
>>>>>>>   use_filesystem{ } filesystem{ ext4 }\
>>>>>>>   mountpoint{ / } \
>>>>>>>   $lvmok{ }   \
>>>>>>>   .   \
>>>>>>>  

Re: [packer] VMWare-iso provisioner - disk thin provisioning

2019-08-29 Thread Rickard von Essen
I'm a bit confused here, do you use the vmware-iso builder on a remote host
(ESXi)?

On Fri, Aug 30, 2019, 05:15 Pearl D'Silva  wrote:

> Setting the "disk_type_id" to "5" leads the the following error:
>
> [image: packer_error.PNG]
>
> Following is the snippet of my packer configuration:
>
>  "builders": [
> {
>   "type": "vmware-iso",
>   "format": "ovf",
>   "skip_export": true,
>   "iso_url": "{{user `url`}}",
>   "iso_checksum": "{{user `checksum`}}",
>   "iso_checksum_type": "sha256",
>   "ssh_username": "{{user `ssh_username`}}",
>   "ssh_password": "{{user `ssh_password`}}",
>   "ssh_wait_timeout": "30m",
>   "cpus": "4",
>   "memory": "32000",
>   "disk_size": "68",
>   "disk_type_id": "5",
>   "headless": false,
>  . . .
>  . . .
> } ],
>
>
> Any pointers as to where I am going wrong?
>
> On Thursday, August 29, 2019 at 4:29:02 PM UTC+5:30, Rickard von Essen
> wrote:
>>
>> Post your template and a debug output from running Packer with
>> PACKER_LOG=1.
>>
>> On Thu, Aug 29, 2019, 12:48 Pearl Dsilva  wrote:
>>
>>> Yes I did, setting disk_type_id to the numeric values causes the packer
>>> build to fail. However, setting it to "thin" lead to the build to proceed,
>>> however the disk is thick provisioned eager zeroed
>>>
>>> On Thu, Aug 29, 2019, 4:14 PM Rickard von Essen 
>>> wrote:
>>>
>>>> Have you looked at
>>>> https://packer.io/docs/builders/vmware-iso.html#disk_type_id ?
>>>>
>>>> On Thu, Aug 29, 2019, 11:33 Pearl D'Silva  wrote:
>>>>
>>>>> I am trying to enable thin provisioning for the disk by using the
>>>>> following: "disk_type_id": "thin", However, on vCenter, when the VM is
>>>>> being provisioned, I notice that the hard disk type is set to "Thick
>>>>> Provision Eager Zeroed". Any pointers on what could be causing this issue
>>>>> would be really helpful.
>>>>>
>>>>> The partitioning recipe in the preseed file is as follows:
>>>>> d-i partman-auto/expert_recipe string \
>>>>>   boot-root ::\
>>>>>   1 1 1 free method{ biosgrub } . \
>>>>>   250 250 250 ext2\
>>>>>   $primary{ } $bootable{ }\
>>>>>   method{ format } format{ }  \
>>>>>   use_filesystem{ } filesystem{ ext2 }\
>>>>>   mountpoint{ /boot } \
>>>>>   .   \
>>>>>   500 18 18 ext4   \
>>>>>   lv_name{ root } \
>>>>>   method{ lvm } format{ } \
>>>>>   use_filesystem{ } filesystem{ ext4 }\
>>>>>   mountpoint{ / } \
>>>>>   $lvmok{ }   \
>>>>>   .   \
>>>>>   500 50 50 xfs\
>>>>>   lv_name{ data } \
>>>>>   method{ lvm } format{ } \
>>>>>   use_filesystem{ } filesystem{ xfs } \
>>>>>   mountpoint{ /data } \
>>>>>   $lvmok{ }   \
>>>>>   .
>>>>>
>>>>>
>>>>> --
>>>>> 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
>

Re: [packer] Re: Debugging packer with visual studio code

2019-08-29 Thread Rickard von Essen
> but would
be nice to have this info in the documentation somewhere so I wouldn't
have to waste my time trying to figure out why debugging doesn't work
with packer.

Yes that would be nice (but as always with open source software someone has
to contribute that)

On Thu, Aug 29, 2019, 16:20 Khai Do  wrote:

> I'm not trying to do anything specific yet I just wanted to prepare a
> general development environment to make contributions which, for me,
> includes a debugger.  Thanks for the clarification Rickard but would
> be nice to have this info in the documentation somewhere so I wouldn't
> have to waste my time trying to figure out why debugging doesn't work
> with packer.
>
> On Thu, Aug 29, 2019 at 3:42 AM Rickard von Essen
>  wrote:
> >
> > Each plugin is running in a separate process and the communicates with
> RCP over a socket. So using a debugger will not work (be complicated at
> least).
> >
> > But most of the Packer code is really simple and easy to follow with
> PACKER_LOG turned on. If that doesn't work adding some extra debug print
> outs when you have homed in on the problem is usually enough.
> >
> > What are trying to do?
> >
> > On Thu, Aug 29, 2019, 01:38 Khai Do  wrote:
> >>
> >> Also this is my VS code launch configuration:
> >>
> >>
> >> {
> >>  "version": "0.2.0",
> >>  "configurations": [
> >>  {
> >>  "name": "Launch",
> >>  "type": "go",
> >>  "request": "launch",
> >>  "mode": "auto",
> >>  "program": "${fileDirname}",
> >>  "env": {"PACKER_LOG": "1", "AWS_PROFILE": "itsandbox", "AWS_REGION":
> "us-east-1"},
> >>  "cwd": "/work/packer/test",
> >>  "args": ["build", "-debug", "-on-error=ask", "template.json"]
> >>  }
> >>  ]
> >> }
> >>
> >>
> >> --
> >> 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+unsubscr...@googlegroups.com.
> >> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/73d89fd6-1f70-4d09-be5b-5d3a86947722%40googlegroups.com
> .
> >
> > --
> > 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 a topic in the
> Google Groups "Packer" group.
> > To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/packer-tool/sfmZootjHBU/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to
> packer-tool+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/CALz9Rt8Ko%3Dmnq%2BOamYOuYAtZ8DAFpkQSvw3cr_dUVRbfabtcng%40mail.gmail.com
> .
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/CAOAVMhZMRnq6TD65qJMPwdJ_%2B3qcpW0f2FmXVp%3DgVm%2BkWtuE_Q%40mail.gmail.com
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt8wRx5WpgEKMiUPf%2BkC1SRFSAay0pEBuYMLc6UT5NQ7Dg%40mail.gmail.com.


Re: [packer] grub config being overwritten when starting an image created with packer (Openstack/Packer/CentOS)

2019-08-29 Thread Rickard von Essen
Could you provide some more details? What's the underlying virtualization
system? Is this PV or HVM VM's? Etc

On Thu, Aug 29, 2019, 19:34 Matt Faraday  wrote:

> Hi All,
>
> I'm facing a strange issue, where I've modified /etc/default/grub in my
> image to change GRUB_CMDLINE_LINUX to add some extra flags. If I do this to
> an already running instance, it's fine, a reboot and the changes persist.
>
> I'm creating images using packer, and if I make this change when creating
> an image, when the instance starts those changes are not there, despite
> packer making the change and then creating the image.
>
> Any idea what is over-writing this ? Can't seem to find any info online,
> and other people suggest making changes to the kernel boot parameters in
> the same way as I'm doing. I am also running grub2-mkconfig -o
> /boot/grub2/grub.cfg as well after making the change.
>
> OS is CentOS 7.
>
> Example output from packer (it does a cat /etc/default/grub for me to show
> what it is)
>
> [0;32m openstack: GRUB_TIMEOUT=1 [0m
> [0;32m openstack: GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g'
> /etc/system-release)" [0m
> [0;32m openstack: GRUB_DEFAULT=saved [0m
> [0;32m openstack: GRUB_DISABLE_SUBMENU=true [0m
> [0;32m openstack: GRUB_TERMINAL="serial console" [0m
> [0;32m openstack: GRUB_SERIAL_COMMAND="serial --speed=115200" [0m
> [0;32m openstack: GRUB_CMDLINE_LINUX="console=tty0 crashkernel=auto
> console=ttyS0,115200 net.ifnames=0 biosdevname=0 audit=1"
>
> but after starting the image 
>
> [root@kernel4-nic-test-2471ee92 cloud]# cat /etc/default/grub
>
> GRUB_TIMEOUT=1
> GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
> GRUB_DEFAULT=saved
> GRUB_DISABLE_SUBMENU=true
> GRUB_TERMINAL="serial console"
> GRUB_SERIAL_COMMAND="serial --speed=115200"
> GRUB_CMDLINE_LINUX="console=tty0 crashkernel=auto console=ttyS0,115200"
>
>
> Does anyone know what is overwriting this ?
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/ad7247f8-3b6f-482e-864b-8d165be39933%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt-RD4Qs-z3uOzfMey1sRMsVg8eRzjExYcD0nq9Vk0-Ftg%40mail.gmail.com.


Re: [packer] Alternatives to vagrant post processor for aws

2019-08-29 Thread Rickard von Essen
I would just use a script wrapping the aws cli or a micro TF setup if I
wanted to launch adhoc instances.

On Thu, Aug 29, 2019, 02:28 Tom Rutherford  wrote:

> Hi All,
>
> The vagrant-aws project seems to be abandoned
> , and my attempts to
> get the box file generated by the vagrant post processor (as described in
> the getting started guide
> ) to work with
> vagrant have been unsuccessful.
>
> Is there a currently recommended solution for launching ad hoc instances
> of an ami?
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/4fd66f47-dede-4723-80a9-8ea837173496%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt-QmoBu_%3DHAPrvaCFqEi0trqC%3DtHrhumLhQfXAuzHc2cQ%40mail.gmail.com.


Re: [packer] VMWare-iso provisioner - disk thin provisioning

2019-08-29 Thread Rickard von Essen
Post your template and a debug output from running Packer with PACKER_LOG=1.

On Thu, Aug 29, 2019, 12:48 Pearl Dsilva  wrote:

> Yes I did, setting disk_type_id to the numeric values causes the packer
> build to fail. However, setting it to "thin" lead to the build to proceed,
> however the disk is thick provisioned eager zeroed
>
> On Thu, Aug 29, 2019, 4:14 PM Rickard von Essen <
> rickard.von.es...@gmail.com> wrote:
>
>> Have you looked at
>> https://packer.io/docs/builders/vmware-iso.html#disk_type_id ?
>>
>> On Thu, Aug 29, 2019, 11:33 Pearl D'Silva  wrote:
>>
>>> I am trying to enable thin provisioning for the disk by using the
>>> following: "disk_type_id": "thin", However, on vCenter, when the VM is
>>> being provisioned, I notice that the hard disk type is set to "Thick
>>> Provision Eager Zeroed". Any pointers on what could be causing this issue
>>> would be really helpful.
>>>
>>> The partitioning recipe in the preseed file is as follows:
>>> d-i partman-auto/expert_recipe string \
>>>   boot-root ::\
>>>   1 1 1 free method{ biosgrub } . \
>>>   250 250 250 ext2\
>>>   $primary{ } $bootable{ }\
>>>   method{ format } format{ }  \
>>>   use_filesystem{ } filesystem{ ext2 }\
>>>   mountpoint{ /boot } \
>>>   .   \
>>>   500 18 18 ext4   \
>>>   lv_name{ root } \
>>>   method{ lvm } format{ } \
>>>   use_filesystem{ } filesystem{ ext4 }\
>>>   mountpoint{ / } \
>>>   $lvmok{ }   \
>>>   .   \
>>>   500 50 50 xfs\
>>>   lv_name{ data } \
>>>   method{ lvm } format{ } \
>>>   use_filesystem{ } filesystem{ xfs } \
>>>   mountpoint{ /data } \
>>>   $lvmok{ }   \
>>>   .
>>>
>>>
>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/packer-tool/0f5b9b82-4cba-4e8c-81c9-5bfa2e803119%40googlegroups.com
>>> <https://groups.google.com/d/msgid/packer-tool/0f5b9b82-4cba-4e8c-81c9-5bfa2e803119%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/packer-tool/CALz9Rt_4_KL_L%2BaR%3DwEz3magJ5tLwouwmt%2Bt1Z%2ByWBcy1W3%2B2Q%40mail.gmail.com
>> <https://groups.google.com/d/msgid/packer-tool/CALz9Rt_4_KL_L%2BaR%3DwEz3magJ5tLwouwmt%2Bt1Z%2ByWBcy1W3%2B2Q%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> This mailing list is

Re: [packer] VMWare-iso provisioner - disk thin provisioning

2019-08-29 Thread Rickard von Essen
Have you looked at
https://packer.io/docs/builders/vmware-iso.html#disk_type_id ?

On Thu, Aug 29, 2019, 11:33 Pearl D'Silva  wrote:

> I am trying to enable thin provisioning for the disk by using the
> following: "disk_type_id": "thin", However, on vCenter, when the VM is
> being provisioned, I notice that the hard disk type is set to "Thick
> Provision Eager Zeroed". Any pointers on what could be causing this issue
> would be really helpful.
>
> The partitioning recipe in the preseed file is as follows:
> d-i partman-auto/expert_recipe string \
>   boot-root ::\
>   1 1 1 free method{ biosgrub } . \
>   250 250 250 ext2\
>   $primary{ } $bootable{ }\
>   method{ format } format{ }  \
>   use_filesystem{ } filesystem{ ext2 }\
>   mountpoint{ /boot } \
>   .   \
>   500 18 18 ext4   \
>   lv_name{ root } \
>   method{ lvm } format{ } \
>   use_filesystem{ } filesystem{ ext4 }\
>   mountpoint{ / } \
>   $lvmok{ }   \
>   .   \
>   500 50 50 xfs\
>   lv_name{ data } \
>   method{ lvm } format{ } \
>   use_filesystem{ } filesystem{ xfs } \
>   mountpoint{ /data } \
>   $lvmok{ }   \
>   .
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/0f5b9b82-4cba-4e8c-81c9-5bfa2e803119%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_4_KL_L%2BaR%3DwEz3magJ5tLwouwmt%2Bt1Z%2ByWBcy1W3%2B2Q%40mail.gmail.com.


Re: [packer] Re: Debugging packer with visual studio code

2019-08-29 Thread Rickard von Essen
Each plugin is running in a separate process and the communicates with RCP
over a socket. So using a debugger will not work (be complicated at least).

But most of the Packer code is really simple and easy to follow with
PACKER_LOG turned on. If that doesn't work adding some extra debug print
outs when you have homed in on the problem is usually enough.

What are trying to do?

On Thu, Aug 29, 2019, 01:38 Khai Do  wrote:

> Also this is my VS code launch configuration:
>
>
> {
>  "version": "0.2.0",
>  "configurations": [
>  {
>  "name": "Launch",
>  "type": "go",
>  "request": "launch",
>  "mode": "auto",
>  "program": "${fileDirname}",
>  "env": {"PACKER_LOG": "1", "AWS_PROFILE": "itsandbox", "AWS_REGION":
> "us-east-1"},
>  "cwd": "/work/packer/test",
>  "args": ["build", "-debug", "-on-error=ask", "template.json"]
>  }
>  ]
> }
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/73d89fd6-1f70-4d09-be5b-5d3a86947722%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt8Ko%3Dmnq%2BOamYOuYAtZ8DAFpkQSvw3cr_dUVRbfabtcng%40mail.gmail.com.


Re: [packer] Windows AMI creation on EC2

2019-08-26 Thread Rickard von Essen
To get the IP for running ansible in shell-local do:

A) Run a shell provisioner that saves the IP in a file. Use a file
provisioner to download it and read it in the shell-local script.
Or B) use some aws tag specific to this build and run the aws cli to find
the IP of that instance.

I would expect Ansible 2.8 with WinRM support in Packer to be at best
rocky. But if you are into troubleshooting things it's probably worth at
least trying.

On Mon, Aug 26, 2019 at 6:22 PM Angel Rengifo Cancino 
wrote:

> Hello guys:
>
> I have a doubt. What's the currently recommended or supported way of
> provisioning Windows with ansible on EC2?
>
> I mean, there's a Ansible connection plugin for Packer that must be
> created (downloaded or installed) before attempting to use a code like this:
>
> "provisioners": [
>   {
> "type": "*ansible*",
> "playbook_file": "../playbooks/windows_image_build/playbook.yml",
>
> "extra_arguments": [
>   "--extra-vars", "{'environment_name': 'packer',
> 'hosting_environment': 'aws',* 'connection': 'packer'*}",
>   "--skip-tags", "gitchecks",
>   "--skip-tags", "gather_facts",
>   "--skip-tags", "slack"
> ]
>   }
> ]
>
> The other way I had in mind is running ansible with shell-local, like this:
>
> "provisioners": [
> {
> "type": "*shell-local*",
> "inline":   [
> "ansible-playbook -i {{ user `os_ipaddr` }}, \\",
> "-e ansible_user='{{ user `os_adminuser` }}' \\",
> "-e ansible_password='{{ user `os_adminpass` }}' \\",
> "-e os_update='{{ user `os_update` }}' \\",
> "-e os_firstinstall={{ user `os_firstinstall`}} \\",
> "{{ user `ansible_playbook` }}"
> ]
> }
> ]
>
> (please ignore my custom vars)
>
> I'm not sure how to setup my connection plugin for ansible 2.8.x. Any
> ideas on this?
>
> Otherwise, do you know how can I get the public IPv4 and password for my
> recently created Windows EC2 instance? I'm not sure if {{.WinRMPassword}}
> variable is valid here.
>
> Hope someone can give me some guidance.
>
> Thanks in advance
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/CAA3McK9buB6U1Buw8%3D%3DAJm17Tf9wbM-JhQySLziEbS_4UVJnEA%40mail.gmail.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt-xJUGT-VdnMA-dRU99Qw4Z0h3Yfqt5bKtuK1FSz1_fpw%40mail.gmail.com.


Re: [packer] Jenkins and Packer

2019-08-21 Thread Rickard von Essen
It seems like you have an old version of Packer. Remove it and install a
new version. Also add packer version to the top of your script.

On Wed, Aug 21, 2019, 23:03 Pietto Vasco  wrote:

> I have a strange issue where i can run packer from the cmdline without
> issue.
>
> But when i setup a jenkins to job schedule the build it fails to build. I
> tried with the packer plugin and without
>
> Running as SYSTEM
>
> Building in workspace C:\Program Files (x86)\Jenkins\workspace\packer build 2
>
> [packer build 2] $ cmd /c call C:\Windows\TEMP\jenkins5282781951821865303.bat
>
>
>
> C:\Program Files (x86)\Jenkins\workspace\packer build 2>packer build 
> C:\Users\Administrator\Documents\vaec-amiauto\vaec-encryptedcrispami.json
>
> Failed to initialize build 'amazon-ebs': provisioner type not found: 
> windows-update
>
> amazon-ebs output will be in this color.
>
>
>
>
>
> ==> Builds finished but no artifacts were created.
>
>
>
> C:\Program Files (x86)\Jenkins\workspace\packer build 2>exit 0
>
> Finished: SUCCESS
>
>
> Attached is my packer plugin config
>
>
>
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/78116bd3-e3f6-4277-adf6-e91f527a7ff1%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt-0n1WBKEnmZtvg%2BfOKGp_%2BqygKZcrn2vULnHyGSdd1uA%40mail.gmail.com.


Re: [packer] ignore building images that already exists

2019-08-21 Thread Rickard von Essen
No you can't do that. As a workaround you can use the aws cli to check if
the AMI exists, if so run packer build with -exclude=amazon-ebs

On Wed, Aug 21, 2019, 23:39 Khai Do  wrote:

> We are using packer with the amazon-ebs builder.  The packer build command
> throws an error when attempting to build an AMI with a name that matches an
> existing AMI on AWS.  I would like to make packer provide the same info but
> NOT fail for this use case?  Instead I would like it to just ignore and
> continue to the next image build.  Is there a way to tell packer to ignore
> builds where an AMI already exists?  something like an
> '-skip-already-exist' flag?
>
> ➜ packer --version
> 1.4.3
> ➜  packer build -var-file=../vars.json template.json
> amazon-ebs output will be in this color.
>
> ==> amazon-ebs: Prevalidating AMI Name: weechat-v1.0.0
> ==> amazon-ebs: Error: AMI Name: 'weechat-v1.0.0' is used by an existing
> AMI: ami-0ee682a1a7e3717d0
> Build 'amazon-ebs' errored: Error: AMI Name: 'weechat-v1.0.0' is used by
> an existing AMI: ami-0ee682a1a7e3717d0
>
> ==> Some builds didn't complete successfully and had errors:
> --> amazon-ebs: Error: AMI Name: 'weechat-v1.0.0' is used by an existing
> AMI: ami-0ee682a1a7e3717d0
>
> ==> Builds finished but no artifacts were created.
> ➜   echo $?
> 1
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/50f8f68f-aca8-43a0-9e20-7e050475a6d3%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_z6oQcw4r3O%2Bid_2%2BG7V%2BhozTnRkZqUrcGhdBHpXo%3DEA%40mail.gmail.com.


Re: [packer] Getting packer to be able to change an image from a local GCP bucket

2019-08-21 Thread Rickard von Essen
And to use a non default source image you should set
https://packer.io/docs/builders/googlecompute.html#source_image_project_id

On Wed, Aug 21, 2019, 22:39 Rickard von Essen 
wrote:

> First you have to create an image from the disk in gcs with gcloud, see
> https://cloud.google.com/sdk/gcloud/reference/compute/images/create
>
> Use the --source-uri argument.
>
> On Wed, Aug 21, 2019, 21:58 Wes Quinn  wrote:
>
>> Hello,
>>
>> I am working with packerpy and GCP to be able to load an OVA file to a
>> personal bucket and then modify that image and create a new image from
>> that, using the provisioners feature in a JSON file.
>>
>> I have the process to upload to a personal bucket working, but I can't
>> figure out how to get packer to find my image in my personal bucket.
>> Packer keeps searching the public area.  I didn't see where I can use a
>> bucket.
>>
>> Anyone have any idea on how to get packet to modify the image from the
>> personal bucket?
>>
>> On a separate note, I am able to use packer, in this same manner with
>> AWS, just fine.
>>
>> Here is an example of my JSON for GCP:
>>
>> {
>>   "variables": {
>> "disk_size": 150,
>> "project_id": "proj-id",
>> "result_image": "packer-example-{{timestamp}}",
>> "source_image": "rhel-7-5-x86-64-minimal-ova",
>> "ssh_password": "password",
>> "ssh_timeout": "3m",
>> "ssh_username": "user",
>> "zone": "us-east-1"
>>   },
>>   "builders": [
>> {
>>   "disk_size": "{{user `disk_size`}}",
>>   "image_name": "{{user `result_image`}}",
>>   "project_id": "{{user `project_id`}}",
>>   "source_image": "{{user `source_image`}}",
>>   "ssh_password": "{{user `ssh_password`}}",
>>   "ssh_username": "{{user `ssh_username`}}",
>>   "type": "googlecompute",
>>   "zone": "{{user `zone`}}"
>> }
>>   ],
>>   "provisioners": [
>> {
>>   "type": "file",
>>   "source": "./welcome.sh",
>>   "destination": "/root/",
>>   "direction": "upload"
>> },
>> {
>>   "type": "shell",
>>   "inline": [
>> "chmod +x welcome.sh",
>> "./welcome.sh"
>>   ]
>> }
>>   ]
>> }
>>
>> Here is the Python code that uses the above JSON code:
>> import argparse
>> import json
>> from packerpy import PackerExecutable
>> parser = argparse.ArgumentParser(description='This script modifies a GCP
>> image in GCP.')
>> parser.add_argument('-f', '--json_file', required=True, help='The JSON
>> file that contains the changes to make to the image file.')
>> args = parser.parse_args()
>> json_file = args.json_file
>> packer_bin = '/usr/local/bin/packer'
>> p = PackerExecutable(packer_bin)
>> (results, output, error) = p.build(json_file)
>> if results == 0:
>>   print('Success!')
>> else:
>>   print('Error:', error)
>> print('\nOutput:', output)
>>
>> If you have any questions, please ask.
>>
>> Thank you very much!
>> Wes Quinn
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/packer-tool/5b866b6d-1ee3-4632-8df9-1c585d710e77%40googlegroups.com
>> <https://groups.google.com/d/msgid/packer-tool/5b866b6d-1ee3-4632-8df9-1c585d710e77%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9b6JyMDc8ykerdz%2BtNcJUShmhM8U5bN%2BUMG1BprNLKDw%40mail.gmail.com.


Re: [packer] Export VM as ovf using packer's vmware-iso builder

2019-08-20 Thread Rickard von Essen
you have  "skip_export": true

On Tue, Aug 20, 2019 at 11:14 AM Pearl Dsilva 
wrote:

> This is the template that I am currently using, which creates vmx and vmdk
> files.
>
> ```
> {
>   "builders": [
> {
>   "type": "vmware-iso",
>   "format": "ovf",
>   "iso_url": "{{user `url`}}",
>   "iso_checksum": "{{user `checksum`}}",
>   "iso_checksum_type": "sha256",
>   "ssh_username": "ubuntu",
>   "ssh_password": "xx",
>   "ssh_wait_timeout": "30m",
>   "disk_size": "20480",
>   "headless": false,
>   "shutdown_command": "echo ''|sudo -S /sbin/halt -h -p",
>   "http_directory": "http",
>   "http_port_min":9001,
>   "http_port_max":9001,
>   "vnc_bind_address": "0.0.0.0",
>   "vnc_disable_password":true,
>   "vnc_port_min": 5902,
>   "vnc_port_max": 5902,
>   "vm_name": "example",
>   "network":"hostonly",
>   "remote_type": "esx5",
>   "remote_host": "x.x.x.x",
>   "remote_username": "abc",
>   "remote_password": "yy",
>   "remote_datastore": "xxx",
>   "remote_cache_datastore": "xxx",
>   "remote_cache_directory": "packer_test",
>   "skip_compaction": true,
>   "skip_export": true,
>   "boot_wait": "0s",
>   "boot_command": [
>
> "",
> "/install/vmlinuz noapic",
> " auto",
> " console-setup/ask_detect=false",
> " console-setup/layoutcode=us",
> " console-setup/modelcode=pc105",
> " debconf/frontend=noninteractive",
> " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg",
>     " debian-installer=en_US",
> " fb=false",
> " initrd=/install/initrd.gz",
> " kbd-chooser/method=us",
> " keyboard-configuration/layout=USA",
> " keyboard-configuration/variant=USA",
> " locale=en_US",
> " netcfg/get_domain=vm",
> " netcfg/get_hostname=ubuntu",
> " grub-installer/bootdev=/dev/sda",
> " -- ",
> ""
>   ],
>
>   "vmx_data": {
> "ethernet0.present": true,
> "ethernet0.networkName": "VM Network"
>   },
>   "vmx_data_post": {
> "floppy0.present": false
>   }
> }
>   ],
>   "provisioners": [
> {
> "type": "shell",
> "script": "scripts/prepenv_ubuntu.sh"
> }
>   ]
> }
> ```
>
> On Tuesday, August 20, 2019 at 12:44:37 PM UTC+5:30, Rickard von Essen
> wrote:
>>
>> It should. Can you please give some more details, your template, what you
>> saw, what you expected, etc.
>>
>> On Tue, Aug 20, 2019, 08:53 Pearl Dsilva  wrote:
>>
>>> I am trying to build an image using vmware-iso and want the image to be
>>> finally exported as an ovf image. Setting the "format" configuration option
>>> to "ovf" in vmware-iso builder doesn't seem to create an ovf image. Is
>>> there a way to achieve it.
>>>
>>> --
>>> 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 packe...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/packer-tool/daf1c35f-2a73-424a-afc8-be80725790b1%40googlegroups.com
>>> <https://groups.google.com/d/msgid/packer-tool/daf1c35f-2a73-424a-afc8-be80725790b1%40googlegroups.com?utm_medium=email_source=footer>

Re: [packer] Using Packer to build a windows box and provision with Ansible

2019-08-20 Thread Rickard von Essen
Don't know much about the Windows stuff but you don't need the dynamic EC2
inventory, remove it and try again.

On Tue, Aug 20, 2019, 09:01 'Richard Payne' via Packer <
packer-tool@googlegroups.com> wrote:

> This is what I have:
>
> Packer JSON:
>
> {
> "variables": {
>   "aws_access_key": "",
>   "aws_secret_key": ""
> },
> "builders": [{
>   "type": "amazon-ebs",
>   "access_key": "{{user `aws_access_key`}}",
>   "secret_key": "{{user `aws_secret_key`}}",
>   "region": "eu-west-2",
>   "vpc_id": "vpc-xxx",
>   "subnet_id": "subnet-",
>   "source_ami": "ami-xxx",
>   "instance_type": "t2.micro",
>   "iam_instance_profile": "packer_builder",
>   "ami_name": "Windows Core 1809 {{timestamp}}",
>   "user_data_file": "./user_data.ps1",
>   "communicator": "winrm",
>   "winrm_username": "Administrator",
>   "winrm_use_ssl": true,
>   "winrm_insecure": true,
>   "tags": [
> { "windows": "" }
>   ],
>   "launch_block_device_mappings": [{
> "delete_on_termination": "true",
> "device_name": "xvde",
> "volume_size": 100,
> "volume_type": "gp2"
>   }]
> }],
>"provisioners": [
>   {
> "type": "ansible",
> "playbook_file": "../playbooks/windows_image_build/playbook.yml",
> "extra_arguments": [
>   "--connection", "packer",
>   "--extra-vars", "ansible_shell_type=powershell
> ansible_shell_executable=None"
> ]
>   }
> ]
>   }
>
>
> user_data.ps1:
>
> 
>
> #Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False
> #Enable-PSRemoting -SkipNetworkProfileCheck -Force
>
> write-output "Running User Data Script"
> write-host "(host) Running User Data Script"
>
> Set-ExecutionPolicy Unrestricted -Scope LocalMachine -Force -ErrorAction
> Ignore
>
> # Don't set this before Set-ExecutionPolicy as it throws an error
> $ErrorActionPreference = "stop"
>
> # Remove HTTP listener
> Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse
>
> Set-Item WSMan:\localhost\MaxTimeoutms 180
> Set-Item WSMan:\localhost\Service\Auth\Basic $true
>
> $Cert = New-SelfSignedCertificate -CertstoreLocation Cert:\LocalMachine\My
> -DnsName "packer"
> New-Item -Path WSMan:\LocalHost\Listener -Transport HTTPS -Address *
> -CertificateThumbPrint $Cert.Thumbprint -Force
>
> # WinRM
> write-output "Setting up WinRM"
> write-host "(host) setting up WinRM"
>
> cmd.exe /c winrm quickconfig -q
> cmd.exe /c winrm set "winrm/config" '@{MaxTimeoutms="180"}'
> cmd.exe /c winrm set "winrm/config/winrs" '@{MaxMemoryPerShellMB="1024"}'
> cmd.exe /c winrm set "winrm/config/service" '@{AllowUnencrypted="true"}'
> cmd.exe /c winrm set "winrm/config/client" '@{AllowUnencrypted="true"}'
> cmd.exe /c winrm set "winrm/config/service/auth" '@{Basic="true"}'
> cmd.exe /c winrm set "winrm/config/client/auth" '@{Basic="true"}'
> cmd.exe /c winrm set "winrm/config/service/auth" '@{CredSSP="true"}'
> cmd.exe /c winrm set "winrm/config/listener?Address=*+Transport=HTTPS"
> "@{Port=`"5986`";Hostname=`"packer`";CertificateThumbprint=`"$($Cert.Thumbprint)`"}"
> cmd.exe /c netsh advfirewall firewall set rule group="remote
> administration" new enable=yes
> cmd.exe /c netsh firewall add portopening TCP 5986 "Port 5986"
> cmd.exe /c net stop winrm
> cmd.exe /c sc config winrm start= auto
> cmd.exe /c net start winrm
>
> 
>
>
> ec2launch.json:
>
> {
> "setComputerName": false,
> "setWallpaper": false,
> "addDnsSuffixList": false,
> "extendBootVolumeSize": false,
> "handleUserData": false,
> "adminPasswordType": "Random"
> }
>
>
> aws_ec2.yml (dynamic inventory):
>
> plugin: aws_ec2
> regions:
>   - eu-west-2
> filters:
>   tag:Name: Packer Builder
> keyed_groups:
>   - key: tags
> prefix: ''
> separator: ""
> compose:
>   ansible_host: private_ip_address
> hostnames:
>   - network-interface.addresses.private-ip-address
>
> groups_vars/windows:
>
> ansible_connection: winrm
> ansible_winrm_transport: ntlm
> ansible_winrm_server_cert_validation: ignore
> ansible_port: 5986
> ansible_winrm_scheme: https
>
>
>
>
> On Friday, 16 August 2019 15:34:47 UTC+1, Alvaro Miranda Aguilera wrote:
>>
>> hello
>>
>> could you share some code that works?
>>
>> in case someone came later to this thread, will be good to have a working
>> example
>>
>> thanks
>> alvaro
>>
>> On Wed, Aug 14, 2019 at 9:39 AM 'Richard Payne' via Packer <
>> packe...@googlegroups.com> wrote:
>>
>>> Yeah, the relevant directories are accessible and writable by my user.
>>>
>>> I have managed to get it working using this:
>>> https://www.packer.io/docs/provisioners/ansible.html
>>>
>>> You have to create connection plugin alongside the playbook.
>>>
>>>
>>> On Tuesday, 13 August 2019 11:45:23 UTC+1, deanwarrenuk wrote:

 Looks like its saying you don't have permissions to create
 ~/.ansible/tmp/etc...
 e.g.
 exec request: 

Re: [packer] Export VM as ovf using packer's vmware-iso builder

2019-08-20 Thread Rickard von Essen
It should. Can you please give some more details, your template, what you
saw, what you expected, etc.

On Tue, Aug 20, 2019, 08:53 Pearl Dsilva  wrote:

> I am trying to build an image using vmware-iso and want the image to be
> finally exported as an ovf image. Setting the "format" configuration option
> to "ovf" in vmware-iso builder doesn't seem to create an ovf image. Is
> there a way to achieve it.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/daf1c35f-2a73-424a-afc8-be80725790b1%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt-bYTSi5jLBMCcJ8sGSf932b2iqtRvZBoWzrYe4GEHQLA%40mail.gmail.com.


Re: [packer] parallels pvm ssh timeout

2019-08-19 Thread Rickard von Essen
You need to use the VM console to troubleshoot your network. Run with
-on-error=ask and you will get infinite time to it.

On Thu, Aug 15, 2019, 16:29 Nelson Ramirez  wrote:

> I keep running into a timeout error on a builder with two shell
> provisioners on parallels pvm.
>
> The first provisioner takes some time to complete and it seems that the
> next provisioner tries to start before the fist one is done, resulting in
> this timeout
>
>
>
> Build 'parallels-pvm' errored: Error uploading script: dial tcp 10.211.
> 55.5:22: i/o timeout
>
>
> I've tried updating the timeouts but that seems to have no effect.. Any
> ideas on how to deal with that timeout?
> I will move the second provisioner into its own builder if i can't make
> the timeout settings work.
> Thanks.
>
> Here's what the builder looks like.
>
> {
>   "variables": {
> "path":
> "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/Users/macosx-builder/.fastlane/bin"
> ,
> "home": "{{env `HOME`}}"
> },
>
>   "builders": [
>
>   {
> "type": "parallels-pvm",
> "parallels_tools_flavor": "mac",
> "source_path": "{{user
> `home`}}/Desktop/builds/file-build/file-image.pvm",
> "ssh_username": "macosx-builder",
> "ssh_password": "Deploy!",
> "ssh_agent_auth":"true",
> "ssh_wait_timeout": "30m",
> "ssh_read_write_timeout":"30m",
> "ssh_keep_alive_interval":"10s",
> "ssh_timeout": "30m",
> "output_directory":"{{user `home`}}/Desktop/builds/tools-build",
> "vm_name":"tools-image"
>   }
>   ],
>   "provisioners": [
>
>
> {
>   "type": "shell",
>   "execute_command": "bash -c '{{ .Vars }} {{ .Path }}'",
>   "scripts": ["./files/scripts/non-sudo-setup.sh"],
>   "expect_disconnect": true,
>   "timeout": "30m",
>   "skip_clean" : true,
>   "environment_vars": [
> "PATH={{ user `path` }}"
>   ]
> },
> {
>   "type": "shell",
>   "execute_command": "echo 'Deploy!' | sudo -S bash -c '{{ .Vars }}
> {{ .Path }}'",
>   "pause_before": "60s",
>   "timeout": "30m",
>   "scripts": ["./files/scripts/macosx-setup.sh"],
>   "skip_clean" : false,
>   "environment_vars": [
> "PATH={{ user `path` }}"
>   ]
> }
>   ]
> }
>
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/4fdad0b5-ef86-40a4-9b4b-0ba7fd0c8cc5%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_FLeLyJbk8YiNUjH4oqt_LXLgSo3H6kCWE%2BNzmS%3D-RLQ%40mail.gmail.com.


Re: [packer] ovf transfer failed while building image on a remote host

2019-08-19 Thread Rickard von Essen
So you are using vmware-iso? Can you please supply your template json file
and and a full Packer log from running Packer with PACKER_LOG=1 packer
build template.json.

On Mon, Aug 19, 2019, 22:52 Jiatong Wang  wrote:

> *Hi, I am using vmware workstation*
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/ae891fdd-831b-456d-b15f-2249cd7e5638%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt8L3U_zBc-E6SAZ6%3DTDzdWURTtbNrvKW-tWZyC94HONfg%40mail.gmail.com.


Re: [packer] ovf transfer failed while building image on a remote host

2019-08-19 Thread Rickard von Essen
Which builder are you using?

On Mon, Aug 19, 2019, 20:33 Jiatong Wang  wrote:

> Hi, I am trying to use `packer` to build images in a remote *esxi* host.
> The build process succeeded but error happened while transferring *ovf*
> back to my local machine.
>
>
> ==> centos-7: Exporting virtual machine...
> centos-7: Executing: ovftool --noSSLVerify=true --skipManifestCheck -
> tt=ovf vi://username:@hostname/centos-7 ./output/centos-7
> ==> centos-7: Error exporting virtual machine: exit status 1
> ==> centos-7: Opening VI source: vi://username@hostname:443/centos-7
> ==> centos-7: Opening OVF target: ./output/centos-7
> ==> centos-7: Writing OVF package: ./output/centos-7/centos-7/centos-7.ovf
> Transfer Failed
> ==> centos-7: Error: Failed to open file stream: https:
> //hostname:443/ha-nfc/524c1678-4260-5e2e-ce08-de46e3abcdb0/centos-7.nvram
> ==> centos-7: Deleting directory tree below: ./output/centos-7/centos-7
> ==> centos-7: Completed with errors
>
> ==> centos-7:
> ==> centos-7:
> ==> centos-7: Destroying virtual machine...
>
> *packer version: v1.4.3*
> I am sure that I opened 433 port in the esxi host. Anyone has some
> insights on this? Thanks
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/fb6638a5-dc19-4ba1-82c4-bd6712a16048%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt8wPxJqZLdEsHKNA%3DEwGem3gkw4cFv2qeW_%2BbpneY1rpg%40mail.gmail.com.


Re: [packer] Trouble with sshd_config with packer + virtualbox + vagrant

2019-08-14 Thread Rickard von Essen
One guess would be that cloud-init might do this.

On Wed, Aug 14, 2019, 19:19 Stephen Schlie  wrote:

> Hi Folks,
>
> I've run into an issue recently with packer where my output vagrant box
> has password based ssh disabled by default, even when I explicitly enable
> it in the last provisioner step. I'll include the template json below but
> in short we build an ubuntu 18.04.3 image with the virtualbox-iso builder,
> run a couple of scripts to setup things, and output the box.
>
> This was working until recently, I went and updated our setup to start
> building amis too, and the vagrant VMs stopped working. I tried rolling
> most of it back to see if it helped but I am still seeing this issue.
>
> template:
>
>   "_comment": "This file managed by salt. Local changes will be
> overwritten.",
>   "builders": [
> {
>   "vm_name": "{{user `vmname`}}",
>   "type": "virtualbox-iso",
>   "headless": true,
>   "vrdp_bind_address": "0.0.0.0",
>   "guest_os_type": "Ubuntu_64",
>   "iso_url": "http://{{user `webserver`}}/{{user `os_file`}}.iso",
>   "iso_checksum_url": "{{user `iso_checksum`}}",
>   "iso_checksum_type": "file",
>   "ssh_username": "packer",
>   "ssh_password": "packer",
>   "ssh_wait_timeout": "15m",
>   "shutdown_command": "echo 'packer' | sudo -S shutdown -P now",
>   "disk_size": "3",
>   "hard_drive_interface": "sata",
>   "vboxmanage": [
> [
>   "modifyvm",
>   "{{.Name}}",
>   "--boot1",
>   "dvd"
> ],
> [
>   "modifyvm",
>   "{{.Name}}",
>   "--boot2",
>   "disk"
> ],
> [
>   "modifyvm",
>   "{{.Name}}",
>   "--nictype1",
>   "virtio"
> ],
> [
>   "modifyvm",
>   "{{.Name}}",
>   "--memory",
>   "2048"
> ],
> [
>   "modifyvm",
>   "{{.Name}}",
>   "--cpus",
>   "4"
> ],
> [
>   "modifyvm",
>   "{{.Name}}",
>   "--audio",
>   "none"
> ],
> [
>   "modifyvm",
>   "{{.Name}}",
>   "--usb",
>   "off"
> ]
>   ],
>   "boot_command": [
> "",
> "/install/vmlinuz noapic ",
> "preseed/url=http://{{user `webserver`}}/{{user `os_file`}}.cfg ",
> "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
> "hostname={{user `vmname`}} ",
> "fb=false debconf/frontend=noninteractive ",
> "keyboard-configuration/modelcode=SKIP
> keyboard-configuration/layout=USA ",
> "keyboard-configuration/variant=USA
> console-setup/ask_detect=false ",
> "DEBCONF=debug ",
> "initrd=/install/initrd.gz -- "
>   ],
>   "output_directory": "vbox/"
> },
> {
>   "type": "amazon-ebs",
>   "access_key": "{{ user `access_key` }}",
>   "secret_key": "{{ user `secret_key` }}",
>   "ami_users": [
> "",
> ""
>   ],
>   "region": "us-east-1",
>   "source_ami_filter": {
> "filters": {
>   "name":
> "ubuntu/images/hvm-ssd/*ubuntu-bionic-18.04-amd64-server-*",
>   "root-device-type": "ebs"
> },
> "owners": ["099720109477"],
> "most_recent": true
>   },
>   "vpc_id": "vpc-04ee3040de35bc755",
>   "subnet_id": "subnet-05b0e1ad8679eb394",
>   "instance_type": "t3.micro",
>   "ssh_username": "ubuntu",
>   "ami_name": "{{user `vmname`}}-{{user `salt_environment`}}-{{ user
> `commit` }}",
>   "spot_price": "0.0104",
>   "run_tags": {
> "application": "packer"
>   }
> }
>   ],
>   "provisioners": [
> {
>   "type": "file",
>   "source": "upload/",
>   "destination": "/tmp"
> },
> {
>   "type": "shell",
>   "inline": [
> "/usr/bin/cloud-init status --wait"
>   ],
>   "only": ["amazon-ebs"]
> },
> {
>   "type": "shell",
>   "scripts": [
> "/etc/vmimage/init.sh"
>   ],
>   "environment_vars": [
> "SALT_ENVIRONMENT={{user `salt_environment`}}",
> "SALT_VERSION={{user `salt_version`}}",
> "SLS_STATES={{user `sls_states`}}"
>   ]
> },
> {
>   "type": "shell",
>   "inline": [
> "sudo mount /home/packer/VBoxGuestAdditions.iso /mnt",
> "sudo sh /mnt/VBoxLinuxAdditions.run || true",
> "sudo umount /mnt",
> "sudo dmidecode -s system-product-name > /home/packer/vmtype"
>   ],
>   "only": ["virtualbox-iso"]
> },
> {
>   "type": "shell",
>   "inline": [
> "sudo sed -i 's/^PasswordAuthentication no/PasswordAuthentication
> yes/' /etc/ssh/sshd_config",
> "sudo cat /etc/ssh/sshd_config"
>   ],
>   "only": ["virtualbox-iso"]
>  }
>   ],
>   "post-processors": [
> {
>   "type": "vagrant",
>   "output": 

Re: [packer] The new AMI is Building But Not Visible Using describe-images. Any ideas?

2019-08-13 Thread Rickard von Essen
This is 99% sure a permission issue with the credentials you are using to
run the aws cli. Double check that.

On Tue, Aug 13, 2019, 03:51 David Medinets  wrote:

> I am using the following JSON file to build an AMI which should be a copy
> of the Amazon Linux 2 AMI. The messages say the new AMI is built but it is
> not found when using describe-images - even five minutes later. I am
> passing the AWS credentials using the AWS_PROFILE env variable.
>
> The process seems dead simple. What am I doing wrong?
>
> -- example.json --
> {
>   "variables": {
> "aws_access_key": "",
> "aws_secret_key": ""
>   },
>   "builders": [{
> "type": "amazon-ebs",
> "access_key": "{{user `aws_access_key`}}",
> "secret_key": "{{user `aws_secret_key`}}",
> "region": "us-east-1",
> "source_ami": "ami-0b898040803850657",
> "instance_type": "t2.micro",
> "ssh_username": "ec2-user",
> "ami_name": "dmm-packer-example-{{timestamp}}"
>   }]
> }
>
> The output from is:
>
> -- packer build example.json --
> amazon-ebs output will be in this color.
>
> ==> amazon-ebs: Prevalidating AMI Name...
> amazon-ebs: Found Image ID: ami-0b898040803850657
> ==> amazon-ebs: Creating temporary keypair:
> packer_5d52168d-886b-7207-f14a-79d068c30677
> ==> amazon-ebs: Creating temporary security group for this instance:
> packer_5d52168e-2e7b-01b3-b40a-b3461f6d2e04
> ==> amazon-ebs: Authorizing access to port 22 on the temporary security
> group...
> ==> amazon-ebs: Launching a source AWS instance...
> amazon-ebs: Instance ID: i-080c2485a8759a2c7
> ==> amazon-ebs: Waiting for instance (i-080c2485a8759a2c7) to become
> ready...
> ==> amazon-ebs: Adding tags to source instance
> amazon-ebs: Adding tag: "Name": "Packer Builder"
> ==> amazon-ebs: Waiting for SSH to become available...
> ==> amazon-ebs: Connected to SSH!
> ==> amazon-ebs: Stopping the source instance...
> amazon-ebs: Stopping instance, attempt 1
> ==> amazon-ebs: Waiting for the instance to stop...
> ==> amazon-ebs: Creating the AMI: dmm-packer-example-1565660813
> amazon-ebs: AMI: ami-0b1ff7d63a5da8f06
> ==> amazon-ebs: Waiting for AMI to become ready...
> ==> amazon-ebs: Terminating the source AWS instance...
> ==> amazon-ebs: Cleaning up any extra volumes...
> ==> amazon-ebs: No volumes to clean up, skipping
> ==> amazon-ebs: Deleting temporary security group...
> ==> amazon-ebs: Deleting temporary keypair...
> Build 'amazon-ebs' finished.
>
> ==> Builds finished. The artifacts of successful builds are:
> --> amazon-ebs: AMIs were created:
>
> us-east-1: ami-0b1ff7d63a5da8f06
>
> -- aws ec2 describe-images --region us-east-1
> --image-ids ami-0b1ff7d63a5da8f06
> {
> "Images": []
> }
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/52728485-195c-47af-9576-d6aae04e312c%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_qG_fxcxF2uifLj5PrgbS883tb0o2WUW1568bYe1sccQ%40mail.gmail.com.


Re: [packer] Windows2016 guest on RHEL linux host never ending winrm loop

2019-08-13 Thread Rickard von Essen
Can you run and install windows manually in virtualbox? Seem like you have
problems with that?

On Tue, Aug 13, 2019, 15:49 Automationbuilder360 Builder <
automationbuilder...@gmail.com> wrote:

> Hi Rickard,
>
> To verify the "headless Flase" mode i tried this on windows 2016 host VM
> as well.
> but as soon i attach the iso the VM gets crashed with no updates.
>
> BTW "--on-error=ask" was not of much help. as it never asked for any input.
>
> and the last few lines of output from VBOX.log is here.
>
> 00:00:00.394503 *** End of VT-x features
> 
> 00:00:00.396851 PcBios: ATA LUN#0 LCHS=1024/255/63
> 00:00:00.396924 APIC: fPostedIntrsEnabled=false fVirtApicRegsEnabled=false
> fSupportsTscDeadline=false
> 00:00:00.396933 TMR3UtcNow: nsNow=1 565 703 281 470 031 000 nsPrev=0 ->
> cNsDelta=1 565 703 281 470 031 000 (offLag=0 offVirtualSync=0
> offVirtualSyncGivenUp=0, NowAgain=1 565 703 281 470 031 000)
> 00:00:00.396945 VMEmt: Halt method global1 (5)
> 00:00:00.396986 VMEmt: HaltedGlobal1 config: cNsSpinBlockThresholdCfg=2000
> 00:00:00.397019 Changing the VM state from 'CREATING' to 'CREATED'
> 00:00:00.403717 Changing the VM state from 'CREATED' to 'POWERING_ON'
> 00:00:00.404306 Changing the VM state from 'POWERING_ON' to 'RUNNING'
> 00:00:00.404319 Console: Machine state changed to 'Running'
> 00:00:00.410651 VMMDev: Guest Log: BIOS: VirtualBox 6.0.4
> 00:00:00.410980 PCI: Setting up resources and interrupts
> 00:00:00.411473 PIT: mode=2 count=0x1 (65536) - 18.20 Hz (ch=0)
> 00:00:00.433895 Display::handleDisplayResize: uScreenId=0
> pvVRAM= w=720 h=400 bpp=0 cbLine=0x0 flags=0x0
> 00:00:00.452285 VMMDev: Guest Log: CPUID EDX: 0x178bfbff
> 00:00:00.452554 PIIX3 ATA: Ctl#0: RESET, DevSel=0 AIOIf=0 CmdIf0=0x00 (-1
> usec ago) CmdIf1=0x00 (-1 usec ago)
> 00:00:00.452664 PIIX3 ATA: Ctl#0: finished processing RESET
> 00:00:00.456064 VMMDev: Guest Log: BIOS: ata0-0: PCHS=16383/16/63
> LCHS=1024/255/63
> 00:00:00.460933 PIIX3 ATA: Ctl#0: RESET, DevSel=1 AIOIf=0 CmdIf0=0xec (-1
> usec ago) CmdIf1=0x00 (-1 usec ago)
> 00:00:00.461049 PIIX3 ATA: Ctl#0: finished processing RESET
> 00:00:00.506867 PIT: mode=2 count=0x48d3 (18643) - 64.00 Hz (ch=0)
> 00:00:00.510412 Display::handleDisplayResize: uScreenId=0
> pvVRAM=7f0d4996c000 w=640 h=480 bpp=32 cbLine=0xA00 flags=0x0
> 00:00:02.997497 Display::handleDisplayResize: uScreenId=0
> pvVRAM= w=720 h=400 bpp=0 cbLine=0x0 flags=0x0
> 00:00:03.005835 PIT: mode=2 count=0x1 (65536) - 18.20 Hz (ch=0)
> 00:00:03.008104 VMMDev: Guest Log: BIOS: Boot : bseqnr=1, bootseq=0032
> 00:00:03.010321 VMMDev: Guest Log: BIOS: Boot from Hard Disk 0 failed
> 00:00:03.011968 VMMDev: Guest Log: BIOS: Boot : bseqnr=2, bootseq=0003
> 00:00:03.015036 VMMDev: Guest Log: BIOS: Booting from CD-ROM...
> 00:00:03.450411 Display::handleDisplayResize: uScreenId=0
> pvVRAM=7f0d4996c000 w=1024 h=768 bpp=24 cbLine=0xC00 flags=0x0
> 00:00:07.035679 VMMDev: Guest Log: BIOS: int13_diskette_function:
> unsupported AH=41
> 00:00:09.319618 RTC: period=0x10 (16) 2048 Hz
> 00:00:15.441594 NAT: Old socket recv size: 128KB
> 00:00:15.441620 NAT: Old socket send size: 128KB
> 00:00:22.650511 Display::handleDisplayResize: uScreenId=0
> pvVRAM=7f0d4996c000 w=1024 h=768 bpp=32 cbLine=0x1000 flags=0x0
> 00:00:31.379280 NAT: Link up
> 00:00:31.413775 NAT: resolv.conf: nameserver 10.xXX.XXX.21
> 00:00:31.413797 NAT: resolv.conf: nameserver 10.XX.XXX.21
> 00:00:31.413840 NAT: DNS#0: 10.XXX.XXX.21
> 00:00:31.413847 NAT: DNS#1: 10.XXX.XXX.21
> 00:00:31.413853 NAT: DHCP offered IP address 10.0.2.15
> 00:00:31.415524 NAT: DHCP offered IP address 10.0.2.15
> 00:00:31.447769 NAT: IPv6 not supported
>
>
>
>
> On Tuesday, 13 August 2019 18:24:59 UTC+5:30, Rickard von Essen wrote:
>>
>> Run with headless false, add flag --on-error=ask when this fails use the
>> console and debug the winrm setup from the inside or check the status of
>> the installation.
>>
>> On Tue, Aug 13, 2019, 13:11 Automationbuilder360 Builder <
>> automation...@gmail.com> wrote:
>>
>>> Hi All,
>>>
>>> Am new to Packer, am trying to create a Windows 2016 guest on VBOX
>>> hosted on RHEL VM.
>>> using virtualbox-iso builders and trying to test my windows customized
>>> image.
>>> the idea to create VM and get windows 2016 installed through iso and
>>> then connect with ansible and run couple of test cases. part of my image
>>> building and testing pipeline.
>>>
>>> however after the VM gets created it waits for winrm untill the timeout
>>> and just fails,
>>> i have no

Re: [packer] Windows2016 guest on RHEL linux host never ending winrm loop

2019-08-13 Thread Rickard von Essen
Run with headless false, add flag --on-error=ask when this fails use the
console and debug the winrm setup from the inside or check the status of
the installation.

On Tue, Aug 13, 2019, 13:11 Automationbuilder360 Builder <
automationbuilder...@gmail.com> wrote:

> Hi All,
>
> Am new to Packer, am trying to create a Windows 2016 guest on VBOX hosted
> on RHEL VM.
> using virtualbox-iso builders and trying to test my windows customized
> image.
> the idea to create VM and get windows 2016 installed through iso and then
> connect with ansible and run couple of test cases. part of my image
> building and testing pipeline.
>
> however after the VM gets created it waits for winrm untill the timeout
> and just fails,
> i have no idea to see whats happening on the guest.
> this is a tested iso which works great on vmware. any help is much
> appreciated.
>
>
> Here is the output
>
> ==> virtualbox-iso: Retrieving ISO
> virtualbox-iso: Using file in-place:
> file:///home/myhome/iso/mycustom_windows2016.v1.0.ISO
> ==> virtualbox-iso: Creating floppy disk...
> virtualbox-iso: Copying files flatly from floppy_files
> virtualbox-iso: Copying file: ./Scripts/enable_winrm.ps1
> virtualbox-iso: Done copying files from floppy_files
> virtualbox-iso: Collecting paths from floppy_dirs
> virtualbox-iso: Resulting paths from floppy_dirs : []
> virtualbox-iso: Done copying paths from floppy_dirs
> ==> virtualbox-iso: Creating virtual machine...
> ==> virtualbox-iso: Creating hard drive...
> ==> virtualbox-iso: Attaching floppy disk...
> ==> virtualbox-iso: Creating forwarded port mapping for communicator (SSH,
> WinRM, etc) (host port 3789)
> ==> virtualbox-iso: Executing custom VBoxManage commands...
> virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1565282739
> --natpf1 winrm,tcp,,222585,,5985
> virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1565282739
> --memory 4096
> virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1565282739
> --cpus 2
> ==> virtualbox-iso: Starting the virtual machine...
> virtualbox-iso: The VM will be run headless, without a GUI. If you want to
> virtualbox-iso: view the screen of the VM, connect via VRDP without a
> password to
> virtualbox-iso: rdp://127.0.0.1:5908
> ==> virtualbox-iso: Waiting 10s for boot...
> ==> virtualbox-iso: Typing the boot command...
> ==> virtualbox-iso: Using winrm communicator to connect: 127.0.0.1
> ==> virtualbox-iso: Waiting for WinRM to become available...
> ==> virtualbox-iso: Timeout waiting for WinRM.
> ==> virtualbox-iso: Deregistering and deleting VM...
> ==> virtualbox-iso: Deleting output directory...
> Build 'virtualbox-iso' errored: Timeout waiting for WinRM.
>
> ==> Some builds didn't complete successfully and had errors:
> --> virtualbox-iso: Timeout waiting for WinRM.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/1e83587f-660c-45ed-9caf-1e0acf39786f%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt8bhK3mDAboH00sg1JZmZ2jBKMxZVPwVqtcX%2B%2BhGzKj0g%40mail.gmail.com.


Re: [packer] Unable to SSH to the VM launched.

2019-08-09 Thread Rickard von Essen
Please supply your template, Kickstart file, scripts, and a full debug log
from running Packer with PACKER_LOG=1.

On Fri, Aug 9, 2019, 11:30 Mohammed Majid  wrote:

> Hi All,
>
> I am building a centos image using packer (using builder vmware-iso), the
> VM comes up with the IP (Using DHCP) and able to ping the VM but could not
> ssh into the VM.
>
> Tried to debug the issue by enabling I enabled PACKER_LOG = 1 and -debug
> option could not figure out the exact reason.
>
> The following is the error from the packer log.
>
> 2019/08/09 14:51:54 packer.exe: 2019/08/09 14:51:54 [DEBUG] starting
> remote command: esxcli --formatter csv network vm port list -w 1000744
> 2019/08/09 14:51:58 packer.exe: 2019/08/09 14:51:58 Timeout connecting to
> 10.0.84.195
>
> Could you please let me know any hints or clues what could be the reason.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/6f89adb6-4d48-4e62-84d8-de1edea80db9%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt-5obRj-A2Ccks6JGOsGV%2BuGyW63iV3WO%2BVGjQybe1fMg%40mail.gmail.com.


Re: [packer] * 'temporary_security_group_source_cidrs': source data must be an array or slice, got map

2019-08-08 Thread Rickard von Essen
It's a list of strings (CIDRs) [ "10.0.0.0/16" ].


On Thu, Aug 8, 2019, 09:22 John Roh  wrote:

> Hi there?
> I need to figure out how to define mutiple cidrs while the packer build
> runs.
> Per documentation, temporary_security_group_source_cidrs
> 
>  (list
> of string) - A list of IPv4 CIDR blocks to be authorized access to the
> instance, when packer is creating a temporary security group.".
>
> I must be defined wrong that I'm getting the error message as below.
>  'temporary_security_group_source_cidrs': source data must be an array or
> slice, got map
>
> What might be the appropriate way to define the multiple cdirs?
>
> Thank you in advance,
>
> John.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/250cf400-53cf-4e08-a774-4762c559c2dc%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt90k0XK-CrpVc2sbOWLRmRgbqDzSskmKWcMQf9uWTnFNA%40mail.gmail.com.


Re: [packer] Re: Creating vagrant virtualbox rhel8 box with packer fails to find iso

2019-08-06 Thread Rickard von Essen
Could you explain why you think this shouldn't be happening?

On Tue, Aug 6, 2019, 16:39 Stephen Pliska-Matyshak <
spliskamatys...@almebezbik.com> wrote:

> [image: 09_37_20.jpg]
> That's a total klooge and hassle. What is different between the rhel7 iso
> and the rhel8 iso that packer would need to mount the iso differently to
> use it.  This shouldn't be happening.
>
>
> On Friday, May 24, 2019 at 10:16:50 AM UTC-5, Stephen Pliska-Matyshak
> wrote:
>>
>> Has anyone tried to create a rhel8 vagrant box for virtualbox with packer
>> yet?
>>
>> I've been trying since the beta came out and switched to the released iso
>> when it came out, but the installer can't find the iso the way the DVD gets
>> mounted in virtualbox vm by packer. I'm doing everything the same as have
>> been doing for centos7 and rhel7, which works marvelously. The devices and
>> mounts look the same between the two versions, but rhel8 installer just
>> can't find the iso. If I manually mount the iso as ide dvd and the vdi as
>> sata hd, installer finds the iso just fine.  Packer mounts both as ide (hd
>> & dvd).
>>
>> I have to wonder if something changed in rhel8 that I've missed in the
>> documentation. I'm using the packer 1.4.0 and virtualbox 6.0.8
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/1a6033b7-a0f7-4515-9d95-277ff8767faf%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_QyoX0x-V9JT6Edf3CCBVoWhtNd-VDFzcg3oFz9gYhFg%40mail.gmail.com.


Re: [packer] 16031 Terminated sudo shutdown -r now

2019-08-06 Thread Rickard von Essen
Most of the time it's not necessary to run a reboot during provisioning,
instead just install the updates and disable ipv6 (whatever there can be
any reasons to do that). When you start the image created from this build
it should start with the new kernel and ipv6 disabled.

On Mon, Aug 5, 2019 at 11:05 PM sasha.meltser 
wrote:

> I am disabling IPv6 and running dracut to update kernel and need to reboot
> so VM don't boot with IPv6 enabled after kernel updated
>
> On Monday, August 5, 2019 at 3:02:23 PM UTC-6, Rickard von Essen wrote:
>>
>> Is there any good reason why you need to reboot a GCE instance during
>> provisioning?
>>
>> On Mon, Aug 5, 2019, 22:31 sasha.meltser  wrote:
>>
>>> Thank you  for replying
>>>
>>> this is what i see in logs
>>>
>>> [1;32m==> googlecompute: Provisioning with shell script:
>>> /var/folders/2q/dmvlb7w13fnfh_xlwwrt2ytmgn/T/packer-shell683874453
>>>
>>> [1;31m==> googlecompute: /tmp/script_9664.sh: line 2: 16050 Terminated
>>> sudo reboot
>>>
>>> [1;32m==> googlecompute: Deleting instance...
>>>
>>> [0;32mgooglecompute: Instance has been deleted!
>>>
>>> [1;32m==> googlecompute: Deleting disk...
>>>
>>> [0;32mgooglecompute: Disk has been deleted!
>>>
>>> [1;31mBuild 'googlecompute' errored: Script exited with non-zero exit
>>> status: 143.Allowed exit codes are: [0]
>>>
>>>
>>> and this is snippet from json
>>>
>>> "provisioners": [
>>> {
>>> "type": "shell",
>>> "scripts": [
>>> "./postscripts/common/disable-ipv6.sh"
>>>]
>>>   },
>>> {
>>> "type": "shell",
>>> "inline": ["sudo reboot"],
>>> "expect_disconnect": true
>>> },
>>> {
>>> "type": "shell",
>>> "scripts": [
>>> "./postscripts/common/common.sh",
>>>   "./postscripts/gui/gnome.sh"
>>>]
>>>   }
>>>
>>> its failing after reboot.
>>>
>>> On Monday, August 5, 2019 at 2:20:43 PM UTC-6, Rickard von Essen wrote:
>>>>
>>>> How does it fail? Please provide some more context.
>>>>
>>>> On Mon, Aug 5, 2019, 20:06 sasha.meltser 
>>>> wrote:
>>>>
>>>>> I am trying to provision CIS CentOS 7 image and its failing when I do
>>>>> basic reboot. Any advice please
>>>>>
>>>>> {
>>>>> "type": "shell",
>>>>> "inline": ["sudo shutdown -r now"],
>>>>> "expect_disconnect": true
>>>>> },
>>>>>
>>>>> --
>>>>> 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 packe...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/packer-tool/b6312147-84f7-45de-8ffb-5a28f5836c4b%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/packer-tool/b6312147-84f7-45de-8ffb-5a28f5836c4b%40googlegroups.com?utm_medium=email_source=footer>
>>>>> .
>>>>>
>>>> --
>>> 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 packe..

Re: [packer] 16031 Terminated sudo shutdown -r now

2019-08-05 Thread Rickard von Essen
Is there any good reason why you need to reboot a GCE instance during
provisioning?

On Mon, Aug 5, 2019, 22:31 sasha.meltser  wrote:

> Thank you  for replying
>
> this is what i see in logs
>
> [1;32m==> googlecompute: Provisioning with shell script:
> /var/folders/2q/dmvlb7w13fnfh_xlwwrt2ytmgn/T/packer-shell683874453
>
> [1;31m==> googlecompute: /tmp/script_9664.sh: line 2: 16050 Terminated
>   sudo reboot
>
> [1;32m==> googlecompute: Deleting instance...
>
> [0;32mgooglecompute: Instance has been deleted!
>
> [1;32m==> googlecompute: Deleting disk...
>
> [0;32mgooglecompute: Disk has been deleted!
>
> [1;31mBuild 'googlecompute' errored: Script exited with non-zero exit
> status: 143.Allowed exit codes are: [0]
>
>
> and this is snippet from json
>
> "provisioners": [
> {
> "type": "shell",
> "scripts": [
> "./postscripts/common/disable-ipv6.sh"
>]
>   },
> {
> "type": "shell",
> "inline": ["sudo reboot"],
> "expect_disconnect": true
> },
> {
> "type": "shell",
> "scripts": [
> "./postscripts/common/common.sh",
>   "./postscripts/gui/gnome.sh"
>]
>   }
>
> its failing after reboot.
>
> On Monday, August 5, 2019 at 2:20:43 PM UTC-6, Rickard von Essen wrote:
>>
>> How does it fail? Please provide some more context.
>>
>> On Mon, Aug 5, 2019, 20:06 sasha.meltser  wrote:
>>
>>> I am trying to provision CIS CentOS 7 image and its failing when I do
>>> basic reboot. Any advice please
>>>
>>> {
>>> "type": "shell",
>>> "inline": ["sudo shutdown -r now"],
>>> "expect_disconnect": true
>>> },
>>>
>>> --
>>> 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 packe...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/packer-tool/b6312147-84f7-45de-8ffb-5a28f5836c4b%40googlegroups.com
>>> <https://groups.google.com/d/msgid/packer-tool/b6312147-84f7-45de-8ffb-5a28f5836c4b%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/cd54a1ae-16d6-48ca-9d94-7a02e3c6b1a4%40googlegroups.com
> <https://groups.google.com/d/msgid/packer-tool/cd54a1ae-16d6-48ca-9d94-7a02e3c6b1a4%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt8B11rCih-0upEpPhz-nPjmONxtm5uuiDa_R-9BfA9%2BHA%40mail.gmail.com.


Re: [packer] 16031 Terminated sudo shutdown -r now

2019-08-05 Thread Rickard von Essen
How does it fail? Please provide some more context.

On Mon, Aug 5, 2019, 20:06 sasha.meltser  wrote:

> I am trying to provision CIS CentOS 7 image and its failing when I do
> basic reboot. Any advice please
>
> {
> "type": "shell",
> "inline": ["sudo shutdown -r now"],
> "expect_disconnect": true
> },
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/b6312147-84f7-45de-8ffb-5a28f5836c4b%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9hHxo7bz__cyV4a-E7oev7%2BVjKCn91xwDYTepcq01pOQ%40mail.gmail.com.


Re: [packer] [Ubuntu 18.04.2] Receiving "error: no such device: root" in VirtualBox/ESXi with converted from qcow2 to vmdk on cloud .img, with Packer qemu builder

2019-08-02 Thread Rickard von Essen
Could you provide some more details. I guess this is because the disk is
connected in a different way making it appear as a different device.

Some things to check:
Where is this error comming from, VirtualBox or the Linux kernel trying to
mount the boot dev?

Can you show grub.conf, etc
Kernel arguments

Vmdk configuration, how is the disk configured?

What device is this when running on Qemu and on VirtualBox?

On Fri, Aug 2, 2019, 04:53 Dayman Cash  wrote:

> Is anyone familiar with initial booting issues in Virtual Box/ESXi hosts
> with Ubuntu 18.04 initiated from Packer? We are migrating from 14.04/16.04
> cloud images which have always worked fine end to end. Using qemu version
> 4.0.0, Packer 1.4.2, on Ubuntu 16.04. The image work sequence is: .img read
> into packer, booted and exported to qcow2, then converted to vmdk with
> "qemu-img convert" (qemu-img convert -f qcow2 -O vmdk -o 
> subformat=streamOptimized
> packer_img.qcow2 packer_img.vmdk).
>
> Here's a snippet of the json packer file:
>
>   "builders": [{
>
> "type": "qemu",
>
> "iso_url": "ubuntu-18.04.2-server-cloudimg-amd64.img",
>
> "iso_checksum": "
> aa5bbaf6a3ec34001dc43b10de62d304bb6e956b262e85f554b2fed0e1250714",
>
> "iso_checksum_type": "sha256",
>
> "disk_image": true,
>
> "output_directory": "{{user `output_directory`}}",
>
> "disk_size": 1,
>
> "format": "qcow2",
>
> "disk_compression": false,
>
> "headless": true,
>
> "accelerator": "kvm",
>
> "ssh_username": "{{user `username`}}",
>
> "ssh_password": "{{user `username`}}",
>
> "ssh_port": 22,
>
> "ssh_wait_timeout": "{{user `ssh_timeout`}}",
>
> "vm_name": "{{user `image_name`}}",
>
> "use_default_display": true,
>
> "shutdown_command": "sudo shutdown -h now",
>
> "qemuargs": [
>
>   ["-m", "4096M"],
>
>   ["-smp", "4"],
>
>   ["-cdrom", "cloud.img"],
>
>   ["-smbios", "type=1,serial=ds=nocloud"],
>
>   ["-serial", "mon:stdio"]
>
> ]
>
>   }],
>
>   "provisioners": [{
>
> "type": "shell",
>
> "inline": [
>
>   "while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo
> 'Waiting for cloud-init...'; sleep 1; done",
>
>   "ssh-keyscan github.com >> /home/{{user
> `username`}}/.ssh/known_hosts"
>
> ]
>
>   },
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/d5b0264f-51b3-4c87-8d70-e0f2334c1d1f%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_%2Bq4Qu%2BvKN05FensiQA0YkkTeJUFZUp41-MuT9BUjn9A%40mail.gmail.com.


Re: [packer] Re: Ansible as a Packer provisioner hanging?

2019-08-01 Thread Rickard von Essen
First of all your ansible.sh is broken. It does word spliting of the
arguments. Fix that, see 1) (or just remove it since it doesn't add
anything). Does it help?

1) https://stackoverflow.com/a/4824637/226174

On Thu, Aug 1, 2019, 04:40 Bob Tanner  wrote:

> Adding that I can ssh to the public IP of the Packer AMI and my ssh-agent
> key works fine so I feel the problem is with Packers ssh proxy.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/48887dee-6d1d-43b1-80ce-c8f991861cf5%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt__EEo_%3Dzn9kGx6VewGNF-ViUFekZY-DDBvg9ZYK7M-2g%40mail.gmail.com.


Re: [packer] How to communicate build data back to calling environment?

2019-07-31 Thread Rickard von Essen
You can use -machine-readable 1), but maybe that is not what you need. More
likely you want information about the AMI that was built. For that look
into the manifest post-processor 2) and parse this manifest file with jq
etc.

1)
https://packer.io/docs/commands/index.html#enabling-machine-readable-output
2) https://packer.io/docs/post-processors/manifest.html

On Wed, Jul 31, 2019, 23:45 Vritual Packer  wrote:

> Hello,
> We are using AWS Codebuild to initiate a Packer build of an AMI.
>
> I need to be able to parse the output of the shell scripts that Packer
> runs so we can process what happened during the build and act accordingly.
>
> Digging through the Packer documentation, there doesn't seem to be a
> supported method of communicating information from the build process back
> to the originating process...
>
> What is the best way of getting the output from the build process and
> getting it into a file that can be easily parsed?
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/e3708987-ca76-4cb3-bcbd-ce845cab7f06%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9MUqgexN_KXkxFtQCqWEBY9AHfw1f0R_Uc%2B1k5iWWFOw%40mail.gmail.com.


Re: [packer] Can't add product code to AMI

2019-07-29 Thread Rickard von Essen
I think you can't set a product code on an image unless you are the owner
of that product code (i.e. the seller of the product). What are you trying
to achieve?

On Sun, Jul 28, 2019, 14:25 Roni Dromi  wrote:

> I'm pretty new to packer so it's probabely my fault, but I'm getting this
> error -
> Product code in ami manifest does not have a configured relationship with
> Amazon EC2: aacglxeowvn5hy8sznltowyqe
> Even though I'm specifing a product code in my configuration. Tried to
> pass the product code as list of strings as well, still not working.
>
>- Packer version: v1.4.3-dev
>- Debug log output:
>https://gist.github.com/ronid/a26aee1a8ee6b41b82d2039a5bc9b458
>- json file -
>https://gist.github.com/ronid/01c94e2f909a02f41692bfc3bc49f530
>
>
> Thanks!!!
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/36f0ffa0-2dba-47c6-adbd-e77955935050%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_8kTordD2o1QH-fG0UrQd6dUt%2BesSgzde4EeYrO7c%3D2A%40mail.gmail.com.


Re: [packer] vmware-iso: Waiting for SSH to become available hangs

2019-07-29 Thread Rickard von Essen
Did you enable the GuestIPHack? See
https://packer.io/docs/builders/vmware-iso.html#building-on-a-remote-vsphere-hypervisor

On Mon, Jul 29, 2019, 11:23 Frédéric Cuza  wrote:

> Hi Lynn,
>
> Are you sure that the network is correctly set on your VM ? I guess it is
> a Centos.
> Here you can find a kickstart that we use and that is working with the
> associtate json.
>
> Regards,
>
> Le lun. 29 juil. 2019 à 10:59, Lynn Ben Barouch 
> a écrit :
>
>> Hey!
>> I am using the vmware-iso builder, the VM gets created successfully and
>> the os installation is successful as well.
>> Also, I can successfully connect via SSH to the newly created VM (using
>> the same credentials given to packer). However, I am getting SSH timeouts.
>> All I am seeing in the packer log is:
>>
>> 2019/07/29 08:50:33 packer: 2019/07/29 08:50:33 [DEBUG] Opening new ssh 
>> session
>> packer: 2019/07/29 08:50:33 [DEBUG] starting remote command: esxcli 
>> --formatter csv network vm list
>> 2019/07/29 08:50:34 packer: 2019/07/29 08:50:34 [DEBUG] Error getting SSH 
>> address: EOF
>>
>>
>> : When running this command on the esx
>>
>> [packer@ESX:~] esxcli --formatter csv network vm list
>> Name,Networks,NumPorts,WorldID,
>> centos7-2019-07-29_08-18-22,"Network,",1,3179774,
>> centos7-2019-07-29_07-53-41,"Network,",1,3175792,
>>
>> .Please find attached my builder config
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/packer-tool/83da37f8-80d2-4997-b933-af3da4ae3503%40googlegroups.com
>> 
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/CAKwqh9VDHhe996UjXEU%2B0nG8yeVk%3DLTOr19ar6J5LpbGx1EjkQ%40mail.gmail.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9ZVJvUeHbMadeF6bi_zJM6a0FuuMFK0GVTDAmVcVXB5A%40mail.gmail.com.


Re: [packer] `execute': Failed to execute: 'mount -t xfs /dev/mapper/hda1 /mnt/img-mnt' (FatalError)

2019-07-29 Thread Rickard von Essen
I would say it's best practice to have the ES data on a ephemeral volume if
you need extreme performance. But you loose the ability to snapshot the
volume for backup and autoscaling. Nevertheless you can (and I would
prefer) to still use a instance with EBS boot volume but add an additional
block volume mapping with an ephemeral NVMe device to keep the ES data on.

On Sun, Jul 28, 2019, 09:28 Roni Dromi  wrote:

> I've been told that this is the best practice for elasticsearch servers,
> it's not tested yet but we want to give it a try.
>
> On Saturday, July 27, 2019 at 10:58:49 PM UTC+3, Rickard von Essen wrote:
>>
>> By the way, is there any particular reason you choose instance store EC2
>> over EBS EC2's?
>>
>> On Sat, Jul 27, 2019, 21:51 Rickard von Essen 
>> wrote:
>>
>>> I think that is just because you use the latest generation of instance
>>> which has NVMe attached disks. Try to use a previous generation without
>>> this and it should work.
>>>
>>> It is probably not hard to get this working with NVMe instance either
>>> but it probably needs some adjustments of some arguments.
>>>
>>> On Sat, Jul 27, 2019, 18:13 Roni Dromi  wrote:
>>>
>>>> Goof catch!
>>>> After changing instance type, I'm getting this error - Non-standard
>>>> volume device "/dev/nvme0n1p1" (FatalError),
>>>> Do you have any idea what may cause this? It's not mentioned before but
>>>> I'm using this AMI -
>>>> https://aws.amazon.com/marketplace/pp/Centosorg-CentOS-7-x8664-with-Updates-HVM/B00O7WM7QW
>>>> Thanks again!!
>>>>
>>>> On Thursday, July 25, 2019 at 9:59:58 PM UTC+3, Rickard von Essen wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> It was a couple of years since I last built an instance store AMI, but
>>>>> I would first change to be building it from a instance store instance
>>>>> (which you aren't, since you are using T2 instances which are EBS only).
>>>>>
>>>>> On Thu, Jul 25, 2019, 16:04 Roni Dromi  wrote:
>>>>>
>>>>>> Hey!
>>>>>> Got this error today when I tried ruuning "amazon-instance" builder.
>>>>>> here is the relevant part of the config -
>>>>>>
>>>>>> {
>>>>>>   "variables": {
>>>>>> "aws_access_key": "",
>>>>>> "aws_secret_key": "",
>>>>>> "root_device_name": "/dev/sda1",
>>>>>> "root_volume_size": "10",
>>>>>> "root_volume_type": "gp2",
>>>>>> "root_delete_on_termination": "true",
>>>>>> "data_device_name": "/dev/sdb",
>>>>>> "data_volume_size": "10",
>>>>>> "data_volume_type": "standard",
>>>>>> "data_delete_on_termination": "true"
>>>>>>   },
>>>>>>   "provisioners": [
>>>>>>
>>>>>>   ],
>>>>>>   "builders": [
>>>>>> {
>>>>>>   "type": "amazon-instance",
>>>>>>   "access_key": "{{user `aws_access_key`}}",
>>>>>>   "secret_key": "{{user `aws_secret_key`}}",
>>>>>>   "region": "us-east-1",
>>>>>>   "source_ami": "ami-02eac2c0129f6376b",
>>>>>>   "vpc_id": "",
>>>>>>   "ssh_username": "centos",
>>>>>>   "instance_type": "t2.micro",
>>>>>>   "ami_name": "{timestamp}}",
>>>>>>   "account_id": "",
>>>>>>   "s3_bucket": "",
>>>>>>   "x509_cert_path": "",
>>>>>>   "x509_key_path": "",
>>>>>>   "launch_block_device_mappings": [
>>>>>> {
>>>>>>   "device_name": "{{user `root_device_name`}}",
>>>>>>   "volume_size": "{{user `root_volume_size`}}",
>>>>>>   "

Re: [packer] `execute': Failed to execute: 'mount -t xfs /dev/mapper/hda1 /mnt/img-mnt' (FatalError)

2019-07-29 Thread Rickard von Essen
It's hard to say what goes wrong since you only provide the error message,
not what caused the error. But probably you just need to adjust some
argument to Packer for running with local NVMe.

On Sun, Jul 28, 2019, 10:20 Roni Dromi  wrote:

> Thanks again!
> It's working now!
> The only thing I'm not sure about is that it says in the docs that NVME
> disks are supported in Centos7 -
> https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ssd-instance-store.html
> so I guess I did something wrong to get these errors :\
>
>
> On Saturday, July 27, 2019 at 10:51:32 PM UTC+3, Rickard von Essen wrote:
>>
>> I think that is just because you use the latest generation of instance
>> which has NVMe attached disks. Try to use a previous generation without
>> this and it should work.
>>
>> It is probably not hard to get this working with NVMe instance either but
>> it probably needs some adjustments of some arguments.
>>
>> On Sat, Jul 27, 2019, 18:13 Roni Dromi  wrote:
>>
>>> Goof catch!
>>> After changing instance type, I'm getting this error - Non-standard
>>> volume device "/dev/nvme0n1p1" (FatalError),
>>> Do you have any idea what may cause this? It's not mentioned before but
>>> I'm using this AMI -
>>> https://aws.amazon.com/marketplace/pp/Centosorg-CentOS-7-x8664-with-Updates-HVM/B00O7WM7QW
>>> Thanks again!!
>>>
>>> On Thursday, July 25, 2019 at 9:59:58 PM UTC+3, Rickard von Essen wrote:
>>>>
>>>> Hi,
>>>>
>>>> It was a couple of years since I last built an instance store AMI, but
>>>> I would first change to be building it from a instance store instance
>>>> (which you aren't, since you are using T2 instances which are EBS only).
>>>>
>>>> On Thu, Jul 25, 2019, 16:04 Roni Dromi  wrote:
>>>>
>>>>> Hey!
>>>>> Got this error today when I tried ruuning "amazon-instance" builder.
>>>>> here is the relevant part of the config -
>>>>>
>>>>> {
>>>>>   "variables": {
>>>>> "aws_access_key": "",
>>>>> "aws_secret_key": "",
>>>>> "root_device_name": "/dev/sda1",
>>>>> "root_volume_size": "10",
>>>>> "root_volume_type": "gp2",
>>>>> "root_delete_on_termination": "true",
>>>>> "data_device_name": "/dev/sdb",
>>>>> "data_volume_size": "10",
>>>>> "data_volume_type": "standard",
>>>>> "data_delete_on_termination": "true"
>>>>>   },
>>>>>   "provisioners": [
>>>>>
>>>>>   ],
>>>>>   "builders": [
>>>>> {
>>>>>   "type": "amazon-instance",
>>>>>   "access_key": "{{user `aws_access_key`}}",
>>>>>   "secret_key": "{{user `aws_secret_key`}}",
>>>>>   "region": "us-east-1",
>>>>>   "source_ami": "ami-02eac2c0129f6376b",
>>>>>   "vpc_id": "",
>>>>>   "ssh_username": "centos",
>>>>>   "instance_type": "t2.micro",
>>>>>   "ami_name": "{timestamp}}",
>>>>>   "account_id": "",
>>>>>   "s3_bucket": "",
>>>>>   "x509_cert_path": "",
>>>>>   "x509_key_path": "",
>>>>>   "launch_block_device_mappings": [
>>>>> {
>>>>>   "device_name": "{{user `root_device_name`}}",
>>>>>   "volume_size": "{{user `root_volume_size`}}",
>>>>>   "volume_type": "{{user `root_volume_type`}}",
>>>>>   "delete_on_termination": "{{user `root_delete_on_termination`}}"
>>>>> }
>>>>>   ],
>>>>>   "ami_block_device_mappings": [
>>>>> {
>>>>>   "device_name": "{{user `data_device_name`}}",
>>>>>   "vol

Re: [packer] `execute': Failed to execute: 'mount -t xfs /dev/mapper/hda1 /mnt/img-mnt' (FatalError)

2019-07-27 Thread Rickard von Essen
By the way, is there any particular reason you choose instance store EC2
over EBS EC2's?

On Sat, Jul 27, 2019, 21:51 Rickard von Essen 
wrote:

> I think that is just because you use the latest generation of instance
> which has NVMe attached disks. Try to use a previous generation without
> this and it should work.
>
> It is probably not hard to get this working with NVMe instance either but
> it probably needs some adjustments of some arguments.
>
> On Sat, Jul 27, 2019, 18:13 Roni Dromi  wrote:
>
>> Goof catch!
>> After changing instance type, I'm getting this error - Non-standard
>> volume device "/dev/nvme0n1p1" (FatalError),
>> Do you have any idea what may cause this? It's not mentioned before but
>> I'm using this AMI -
>> https://aws.amazon.com/marketplace/pp/Centosorg-CentOS-7-x8664-with-Updates-HVM/B00O7WM7QW
>> Thanks again!!
>>
>> On Thursday, July 25, 2019 at 9:59:58 PM UTC+3, Rickard von Essen wrote:
>>>
>>> Hi,
>>>
>>> It was a couple of years since I last built an instance store AMI, but I
>>> would first change to be building it from a instance store instance (which
>>> you aren't, since you are using T2 instances which are EBS only).
>>>
>>> On Thu, Jul 25, 2019, 16:04 Roni Dromi  wrote:
>>>
>>>> Hey!
>>>> Got this error today when I tried ruuning "amazon-instance" builder.
>>>> here is the relevant part of the config -
>>>>
>>>> {
>>>>   "variables": {
>>>> "aws_access_key": "",
>>>> "aws_secret_key": "",
>>>> "root_device_name": "/dev/sda1",
>>>> "root_volume_size": "10",
>>>> "root_volume_type": "gp2",
>>>> "root_delete_on_termination": "true",
>>>> "data_device_name": "/dev/sdb",
>>>> "data_volume_size": "10",
>>>> "data_volume_type": "standard",
>>>> "data_delete_on_termination": "true"
>>>>   },
>>>>   "provisioners": [
>>>>
>>>>   ],
>>>>   "builders": [
>>>> {
>>>>   "type": "amazon-instance",
>>>>   "access_key": "{{user `aws_access_key`}}",
>>>>   "secret_key": "{{user `aws_secret_key`}}",
>>>>   "region": "us-east-1",
>>>>   "source_ami": "ami-02eac2c0129f6376b",
>>>>   "vpc_id": "",
>>>>   "ssh_username": "centos",
>>>>   "instance_type": "t2.micro",
>>>>   "ami_name": "{timestamp}}",
>>>>   "account_id": "",
>>>>   "s3_bucket": "",
>>>>   "x509_cert_path": "",
>>>>   "x509_key_path": "",
>>>>   "launch_block_device_mappings": [
>>>> {
>>>>   "device_name": "{{user `root_device_name`}}",
>>>>   "volume_size": "{{user `root_volume_size`}}",
>>>>   "volume_type": "{{user `root_volume_type`}}",
>>>>   "delete_on_termination": "{{user `root_delete_on_termination`}}"
>>>> }
>>>>   ],
>>>>   "ami_block_device_mappings": [
>>>> {
>>>>   "device_name": "{{user `data_device_name`}}",
>>>>   "volume_size": "{{user `data_volume_size`}}",
>>>>   "volume_type": "{{user `data_volume_type`}}",
>>>>   "delete_on_termination": "{{user `data_delete_on_termination`}}"
>>>> }
>>>>   ]
>>>> }
>>>>   ]
>>>> }
>>>>
>>>>
>>>>
>>>>
>>>> And here is the full traceback -
>>>>
>>>> amazon-instance: /mnt/img-mnt
>>>> ==> amazon-instance:
>>>> /usr/local/ec2/ec2-ami-tools-1.5.7/lib/ec2/platform/linux/image.rb:793:in
>>>> `execute': Failed to execute: 'mount -t xfs /dev/mapper/hda1 /mnt/img-mnt'
&g

Re: [packer] `execute': Failed to execute: 'mount -t xfs /dev/mapper/hda1 /mnt/img-mnt' (FatalError)

2019-07-27 Thread Rickard von Essen
I think that is just because you use the latest generation of instance
which has NVMe attached disks. Try to use a previous generation without
this and it should work.

It is probably not hard to get this working with NVMe instance either but
it probably needs some adjustments of some arguments.

On Sat, Jul 27, 2019, 18:13 Roni Dromi  wrote:

> Goof catch!
> After changing instance type, I'm getting this error - Non-standard volume
> device "/dev/nvme0n1p1" (FatalError),
> Do you have any idea what may cause this? It's not mentioned before but
> I'm using this AMI -
> https://aws.amazon.com/marketplace/pp/Centosorg-CentOS-7-x8664-with-Updates-HVM/B00O7WM7QW
> Thanks again!!
>
> On Thursday, July 25, 2019 at 9:59:58 PM UTC+3, Rickard von Essen wrote:
>>
>> Hi,
>>
>> It was a couple of years since I last built an instance store AMI, but I
>> would first change to be building it from a instance store instance (which
>> you aren't, since you are using T2 instances which are EBS only).
>>
>> On Thu, Jul 25, 2019, 16:04 Roni Dromi  wrote:
>>
>>> Hey!
>>> Got this error today when I tried ruuning "amazon-instance" builder.
>>> here is the relevant part of the config -
>>>
>>> {
>>>   "variables": {
>>> "aws_access_key": "",
>>> "aws_secret_key": "",
>>> "root_device_name": "/dev/sda1",
>>> "root_volume_size": "10",
>>> "root_volume_type": "gp2",
>>> "root_delete_on_termination": "true",
>>> "data_device_name": "/dev/sdb",
>>> "data_volume_size": "10",
>>> "data_volume_type": "standard",
>>> "data_delete_on_termination": "true"
>>>   },
>>>   "provisioners": [
>>>
>>>   ],
>>>   "builders": [
>>> {
>>>   "type": "amazon-instance",
>>>   "access_key": "{{user `aws_access_key`}}",
>>>   "secret_key": "{{user `aws_secret_key`}}",
>>>   "region": "us-east-1",
>>>   "source_ami": "ami-02eac2c0129f6376b",
>>>   "vpc_id": "",
>>>   "ssh_username": "centos",
>>>   "instance_type": "t2.micro",
>>>   "ami_name": "{timestamp}}",
>>>   "account_id": "",
>>>   "s3_bucket": "",
>>>   "x509_cert_path": "",
>>>   "x509_key_path": "",
>>>   "launch_block_device_mappings": [
>>> {
>>>   "device_name": "{{user `root_device_name`}}",
>>>   "volume_size": "{{user `root_volume_size`}}",
>>>   "volume_type": "{{user `root_volume_type`}}",
>>>   "delete_on_termination": "{{user `root_delete_on_termination`}}"
>>> }
>>>   ],
>>>   "ami_block_device_mappings": [
>>> {
>>>   "device_name": "{{user `data_device_name`}}",
>>>   "volume_size": "{{user `data_volume_size`}}",
>>>   "volume_type": "{{user `data_volume_type`}}",
>>>   "delete_on_termination": "{{user `data_delete_on_termination`}}"
>>> }
>>>   ]
>>> }
>>>   ]
>>> }
>>>
>>>
>>>
>>>
>>> And here is the full traceback -
>>>
>>> amazon-instance: /mnt/img-mnt
>>> ==> amazon-instance:
>>> /usr/local/ec2/ec2-ami-tools-1.5.7/lib/ec2/platform/linux/image.rb:793:in
>>> `execute': Failed to execute: 'mount -t xfs /dev/mapper/hda1 /mnt/img-mnt'
>>> (FatalError)
>>> ==> amazon-instance: from
>>> /usr/local/ec2/ec2-ami-tools-1.5.7/lib/ec2/platform/linux/image.rb:670:in
>>> `mount_image'
>>> ==> amazon-instance: from
>>> /usr/local/ec2/ec2-ami-tools-1.5.7/lib/ec2/platform/linux/image.rb:174:in
>>> `make'
>>> ==> amazon-instance: from
>>> /usr/local/ec2/ec2-ami-tools-1.5.7/lib/ec2/amitools/bundlevol.rb:184:in
>>> `bundle_vol'
>>> ==> amazon-instanc

Re: [packer] Packer qemu image on hypervisor.

2019-07-25 Thread Rickard von Essen
Yes but you have to enable nested virtualization on the VM instance.

On Thu, Jul 25, 2019, 11:42 Toan Huynh Van 
wrote:

> Hi,
>
> I have a VM on Openstack, I wan to build qemu image on this VM. So, Can I
> build qemu image like that ?
>
> I tried but failed as below:
>
> [image: Capture.PNG]
>
>
>
>
>
>
>
>
> Thanks
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/523be1cf-0ece-4eff-ab1f-9fe085c129f7%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_6cTwPd2QNh8s8QABPqpgK%2B9OAySW%2BLswnswBgG1xxYQ%40mail.gmail.com.


Re: [packer] How to use gcloud util to wait for the end of gcloud compute instances create script action

2019-07-25 Thread Rickard von Essen
Packer writes the state of the startup script to this instance metadata
key, see
https://github.com/hashicorp/packer/blob/master/builder/googlecompute/startup.go#L8

On Thu, Jul 25, 2019, 03:06 zhiyu zeng  wrote:

> I want to wait for script action finished and I have tried searching but
> could not find it.
>
> thanks.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/66f007c9-5f0b-4b48-97f6-4b87457afbe9%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt8RUrOaBV-_zVy2KZR0sD3hkfX0%3DKCgMRZkbnSox5tukw%40mail.gmail.com.


Re: [packer] virtualbox-iso: sudo: no tty present and no askpass program specified

2019-07-24 Thread Rickard von Essen
Ok, and you need passwordless sudo. If you need to pass a password see
examples in the docs for howto do that or check the bento repo.

And I see you already got a hand with this in the other thread.

On Wed, Jul 24, 2019, 18:19 Rickard von Essen 
wrote:

> Set ssh_pty to true.
>
> https://packer.io/docs/templates/communicator.html#ssh_pty
>
> On Wed, Jul 24, 2019, 08:48 Tekchand Dagar 
> wrote:
>
>> Hello Team,
>>
>> I am creating Virtualbox image for Ubuntu18.04. VM is registering but its
>> end with error at provisoners part.
>>
>> Below is the error:
>>
>> {==> virtualbox-iso: Typing the boot command...
>> ==> virtualbox-iso: Using ssh communicator to connect: 127.0.0.1
>> ==> virtualbox-iso: Waiting for SSH to become available...
>> ==> virtualbox-iso: Connected to SSH!
>> ==> virtualbox-iso: Uploading VirtualBox version info (5.2.26)
>> ==> virtualbox-iso: Uploading VirtualBox guest additions ISO...
>> ==> virtualbox-iso: Provisioning with shell script:
>> /tmp/packer-shell922774385
>> virtualbox-iso: sudo: no tty present and no askpass program specified
>> ==> virtualbox-iso: Deregistering and deleting VM...
>> }
>>
>> I have attached my build file also.
>>
>> Please help me.
>>
>> Thanks.
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/packer-tool/b38c2043-45d3-4302-a17e-adccc7623a71%40googlegroups.com
>> <https://groups.google.com/d/msgid/packer-tool/b38c2043-45d3-4302-a17e-adccc7623a71%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9K0-JZ7dKaEUM7JwAGLxGJjCujMv%3DaiQPPbBtERXFasQ%40mail.gmail.com.


Re: [packer] virtualbox-iso: sudo: no tty present and no askpass program specified

2019-07-24 Thread Rickard von Essen
Set ssh_pty to true.

https://packer.io/docs/templates/communicator.html#ssh_pty

On Wed, Jul 24, 2019, 08:48 Tekchand Dagar  wrote:

> Hello Team,
>
> I am creating Virtualbox image for Ubuntu18.04. VM is registering but its
> end with error at provisoners part.
>
> Below is the error:
>
> {==> virtualbox-iso: Typing the boot command...
> ==> virtualbox-iso: Using ssh communicator to connect: 127.0.0.1
> ==> virtualbox-iso: Waiting for SSH to become available...
> ==> virtualbox-iso: Connected to SSH!
> ==> virtualbox-iso: Uploading VirtualBox version info (5.2.26)
> ==> virtualbox-iso: Uploading VirtualBox guest additions ISO...
> ==> virtualbox-iso: Provisioning with shell script:
> /tmp/packer-shell922774385
> virtualbox-iso: sudo: no tty present and no askpass program specified
> ==> virtualbox-iso: Deregistering and deleting VM...
> }
>
> I have attached my build file also.
>
> Please help me.
>
> Thanks.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/b38c2043-45d3-4302-a17e-adccc7623a71%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt-tyYK95FWRjiqk-65QZdveWb1G76zQ9HG6cVY7goQ8DA%40mail.gmail.com.


Re: [packer] Issues installing vmware tools - using packer and vsphere-iso builder

2019-07-23 Thread Rickard von Essen
iso_paths is for specifying multiple alternative urls for the same iso.
Instead put the tools iso in the http_directory or somewhere else where you
can reach it and download it to the VM. Then use the procedure used here *)
to install it.

*) https://github.com/boxcutter/windows/blob/master/script/vmtool.bat

On Tue, Jul 23, 2019 at 1:12 AM MTorres  wrote:

> Hi all,
>
> Having some issues using Packer and the vsphere-iso builder to create a
> Windows VM in vSphere.
> VM to be created: Windows 2019 STD
> vSphere version: 6.5 (vCenter and ESXi)
> Packer version: 1.3.5
> vSphere-iso version: 2.3
>
> The problem is, I need to load two ISO files:  One for the Windows install
> and one for the VMWare tools install.
> If I load both from a datatore using "iso_paths" it works great, the first
> CD drive mounts the Windows iso and the second one mounts the VMware Tools
> iso and I get the VM created.
>
> If I load the Windows iso from a url using "iso_urls" and the VMware tools
> from the datastore using "iso_paths" then I get the VMware Tools loaded in
> the first CD drive and the Windows iso on the second CD drive and of course
> this doesn't work since the VM is trying to boot using the first drive.
>
> Is there a way to force the CDs to load in the correct order?  or what
> other way can I install the VMware tools?  If I don't install VMware tools
> the build never finishes because it either never gets an IP address (when
> using vmxnet3 adapter) or gets an IP but somehow doesn't report it back to
> Packer (when using e1000 adapter).
>
> Any help is appreciated, thanks
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/e5d4148a-7c8a-4c36-85d0-fa470c341bbe%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt8LTnr5EzfXNr86T91k4nNoDzpKMFsNbJbM13vH8Vg9uw%40mail.gmail.com.


  1   2   3   4   5   6   7   8   9   >