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

-- 
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
>>> .
>>> 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
>>> 
>>> .
>>>
>>
> 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/a52e6a99-9b9e-430e-b3f3-f57ca12bd259%40googlegroups.com
> 
> .
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://w

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 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 packe...@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
 
 .

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

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

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


[packer] Re: Sharing encrypted AMI's across accounts with Packer

2019-09-04 Thread Justin Metz
Ok, now I think I get it.. :)  Thank you for the clarification..

On Thursday, August 29, 2019 at 11:49:45 AM UTC-4, Justin Metz wrote:
>
> Hi,
>
> In Packer 1.4.2 there was a feature added that will share encrypted Amazon 
> AMI's across accounts.  I cannot find any mention of how to use this 
> feature in the online documentation (Amazon EBS Builder), so I'm wondering 
> if I'm missing something or maybe the documentation wasn't updated.  If 
> anyone could please shed some light I would greatly appreciate it.
>
> 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/ad14ae76-b7c3-4cfc-a5fd-542787853470%40googlegroups.com.