[packer] Re: Deploying a vm with packer with a static IP

2016-09-19 Thread Rjaydee
Can you please help me understand why this is happening? I have been trying 
for a while now, and I am still getting the same results

On Friday, September 16, 2016 at 10:24:44 AM UTC-7, Rjaydee wrote:
>
> I am trying to deploy and set a vm using packer and a kickstart file. This 
> packer code:
>
> {
> "builders": [
> {
> "type": "vmware-iso",
> "format": "ovf",
> "vm_name": "PACKERTEST2",
> "iso_url": 
> "http://ftp.riken.jp/Linux/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1511.iso";,
> "iso_checksum": 
> "907e5755f824c5848b9c8efbb484f3cd945e93faa024bad6ba875226f9683b16",
> "iso_checksum_type": "sha256",
> "disk_size": "10240",
> "disk_type_id": "thin",
> "remote_host": "host",
>   "remote_datastore": "ds",
>   "remote_username": "root",
>   "remote_password": "pw",
>   "remote_type": "esx5",
> "ssh_username": "root",
> "guest_os_type": "centos-64",
> "ssh_password": "ps",
> "ssh_port": 22,
> "ssh_wait_timeout": "800s",
> "shutdown_command": "shutdown -h now",
> "headless": false,
> "floppy_files": [
>   "kickstart/ks.cfg"
> ],
> "boot_command": " linux inst.text inst.ks=hd:fd0:/ks.cfg 
> ",
> "boot_wait": "20s",
> "keep_registered": "true",
> "vmx_data": {
> "config.version": 8,
> "virtualHW.version": 8,
> "ethernet0.virtualDev": "vmxnet3",
> "ethernet0.networkName": "VM Network",
> "ethernet0.addressType": "generated",
> "ethernet0.present": "TRUE",
> "ethernet1.virtualDev": "vmxnet3",
> "ethernet1.networkName": "VLAN100",
> "ethernet1.addressType": "generated",
> "ethernet1.present": "TRUE",
> "ethernet0.pciSlotNumber": "9",
> "ethernet1.pciSlotNumber": "224",
> "memsize": "2048",
> "numvcpus": "2",
> "cpuid.coresPerSocket": "1",
> "RemoteDisplay.vnc.enabled": "TRUE",
> "RemoteDisplay.vnc.port":  "5900"
>
> }
> }
> ]
> }
>
> This is the ks.cfg file I have:
>
>
> # SELinux configuration
> selinux --enforcing
>
> # Installation logging level
> logging --level=info
>
>
> # Run the Setup Agent on first boot
> firstboot --enable
>
>  # Reboot after installation
>  reboot
>
> # System timezone
> timezone --isUtc America/Los_Angeles
> # Network information
> network --activate --bootproto=static --device=eth0 --gateway=8.1.132.254 
> --netmask=255.255.255.0 --ip= 8.1.132.18 —hostname=myhost.com
>
> # System bootloader configuration
> bootloader --append="crashkernel=auto rhgb quiet" --location=mbr 
> --driveorder="sda"
>
> # Partition clearing information
> zerombr
> clearpart --all  --drives=sda
>
> # Disk partitioning information
> part /boot --fstype="ext4" --size=500
> part pv.008002 --grow --size=1
> volgroup vg_centos --pesize=4096 pv.008002
> logvol / --fstype=ext4 --name=lv_root --vgname=vg_centos --grow --size=1024 
> --maxsize=51200
> logvol swap --name=lv_swap --vgname=vg_centos --grow --size=3072 
> --maxsize=3072
>
> %packages --nobase
> @^minimal
> @core
> kexec-tools
>
> %end
>
> I however keep getting this error when I run it.
>
> => vmware-iso: Waiting for SSH to become available...
> ==> vmware-iso: Timeout waiting for SSH.
> ==> vmware-iso: Stopping virtual machine...
> ==> vmware-iso: Destroying virtual machine...
> Build 'vmware-iso' errored: Timeout waiting for SSH.
> Why do I getting this error message? Is it because my code in the ks.cfg file 
> to connect to a static ip address correct? Any thought would be greatly 
> appreciated.
>
>

-- 
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/0ea9dbeb-5baf-4d91-a99d-938c0a550333%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [packer] Re: Deploying a vm with packer with a static IP

2016-09-18 Thread Rjaydee
After doing reseach, and tests. The error seems to be at this part of the 
ks.cfg file. 
#Network Information
network --bootproto=static --device=eno16780032 --gateway=8.1.140.1 
--ip=8.1.142.187 --nameserver=8.1.44.254,8.1.32.254 --netmask=255.255.252.0 
--noipv6 --activate --hostname=myhost.com

I manually created the vm myself and used a static ip address to do it, and 
I was then able to ssh into it. So I am very sure the above credentials 
work. When I get anaconda-ks.cfg file for that, and use it as a template to 
create the vm using packer, it doesn't seem to work. These are the two 
sysconfig files for manual and packer installations. Why is the kickstart 
file not working?  Please help


>>

-- 
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/bcbee819-d9e6-414a-9d55-2a60145fe8a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
IPV6_AUTOCONG=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eno16780032
DEVICE=eno16780032
ONBOOT=yes
IPADDR=8.1.142.187
PREFIX=22
GATEWAY=8.1.140.1
DNS1=8.1.44.254
DNS2=8.1.32.254
DOMAIN=myhost.comTYPE=Ethernet
BOOTPROTO=dhcp
PEERDNS=yes
PEERROUTES=yes
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONG=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eno160
DEVICE=eno160
ONBOOT=no


Re: [packer] Re: Deploying a vm with packer with a static IP

2016-09-17 Thread Rjaydee
Good advice. I will go back and master the foundation first. Thanks.

On Saturday, September 17, 2016 at 4:59:13 AM UTC-7, Alvaro Miranda 
Aguilera wrote:
>
> Hello, 
>
> I will suggest slow down a bit.
>
> You should automate something that you know it words and ideally you have 
> done it properly.
>
> We know packer works so is not a packer issues, is "how I do xxx with 
> packer", but the issue in reality is "how do i xxx"
>
> My suggestion will be do this first without packer, and then give a shot 
> to packer, you will learn about the process and you will able to move 
> faster.
>
>
> 1. Manual install
>
> Create a new VM on vmware, put the iso on it, do a instalattion, end with 
> a VM you can login with user and password you want.
>
> 2. First try with kickstart
> Take /root/anaconda-ks.cfg file as example for an installer, review 
> commented section around disk partition, replace password with a 
> non-scripted one, comment out the current one.
> If there is a line that say shutdown in the ks, replace it with reboot.
>
> put this kickstart in some webserver in your network
>
> Create a new VM
> map the iso
> edit the boot like to add at the end 
>  ks=http:ks.cfg
>
> wait to see if your vm install 100% un-attended, and its waiting for lognin
> login with user/pass
> shutdown the VM
>
> 3. First packer VM
> use this kickstart as IS, no extra changes in packer, get a basic VM that 
> does nothing other than install.
>
> When you have a working paker installation move 1 change at the time. 
>
> Alvaro.
>
>

-- 
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/88c40ae4-1308-4647-8627-f8bea24092b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [packer] Re: Deploying a vm with packer with a static IP

2016-09-17 Thread Rjaydee
Thanks for the advice. I will do that. You've really been helpful. I 
appreciate it.

On Saturday, September 17, 2016 at 4:46:10 AM UTC-7, Rickard von Essen 
wrote:
>
> In the original config you had both ethernet0 and ethernet1. Using only 
> ethernet0 simplifies things. The below settings seems fair but networkName 
> depends on you specific setup. Basically you need to know that these are 
> right or find out. Automation is only in the way if you are unsure how this 
> works. I would recommend to step back a bit. Try to create a VM on ESXi 
> manually and do a manual install, examine all settings and what works and 
> not. Read some documentation and ask ESXi specific question on such a forum 
> where they will be much more qualified to answer you. Also think about if 
> it wouldn't be sufficient to build on local virtualisation VMware 
> Fusion/Workstation or VirtualBox which is much more straight forward and 
> you can revisit building on ESXi when you got a hang on it. ESXi/vSphere is 
> a very complex product and there lots of thing that can go wrong outside of 
> Packers control. 
>
> On Saturday, September 17, 2016 at 11:17:18 AM UTC+2, Rjaydee wrote:
>>
>> Thanks again for the reply. You mean this code here might be in correct? 
>>  "vmx_data": {
>> "ethernet0.startConnected":"TRUE",
>> "ethernet0.virtualDev": "vmxnet3",
>> "ethernet0.networkName": "VM Network",
>> "ethernet0.addressType": "generated",
>> "ethernet0.present": "TRUE",
>> "memsize": "2048",
>> "numvcpus": "2" }
>>
>> I used a template I found online. How would you do it? Just started doing 
>> this a few days ago, so I am still learning.
>>
>> On Friday, September 16, 2016 at 11:50:04 PM UTC-7, Rickard von Essen 
>> wrote:
>>>
>>> Ok then you need to get a console and login and troubleshoot your 
>>> network. Most likely your network is not properly setup. Is it necessary to 
>>> have two different nic's?
>>>
>>> On Saturday, September 17, 2016 at 7:20:02 AM UTC+2, Rjaydee wrote:

 So I did what you suggested. You can see attached files. I however keep 
 getting the ssh timeout error. This from the packer log:


 2016/09/16 21:48:44 packer: 2016/09/16 21:48:44 opening new ssh session

 2016/09/16 21:48:45 packer: 2016/09/16 21:48:45 starting remote 
 command: esxcli --formatter csv network vm list

 2016/09/16 21:48:45 packer: 2016/09/16 21:48:45 remote command exited 
 with '0': esxcli --formatter csv network vm list

 2016/09/16 21:48:45 packer: 2016/09/16 21:48:45 opening new ssh session

 2016/09/16 21:48:45 packer: 2016/09/16 21:48:45 starting remote 
 command: esxcli --formatter csv network vm port list -w 28501321

 2016/09/16 21:48:46 packer: 2016/09/16 21:48:46 remote command exited 
 with '0': esxcli --formatter csv network vm port list -w 28501321

 2016/09/16 21:48:46 packer: 2016/09/16 21:48:46 [DEBUG] Error getting 
 SSH address: VM network port found, but no IP address

  I just configured a centos vm manually using the same ipaddress, dns, 
 gateway etc..  and it worked. Any thoughts on why this is not working? 
 Thanks

 On Friday, September 16, 2016 at 5:15:28 PM UTC-7, Rickard von Essen 
 wrote:
>
> 1) rootpw "testing" in your ks.cfg must match your "ssh_password": 
> “saint” in packertest.json .
> 2) You kickstart file must enable root ssh login in 
> /etc/ssh/sshd_config by setting PermitRootLogin yes
> The simplest way to do this is probably adding this to your ks.cfg 
> before %end
>
> %post
> sed -i 's/.*PermitRootLogin .*/PermitRootLogin yes/' 
> /etc/ssh/sshd_config
>
>
> On 17 September 2016 at 01:49, Rjaydee  wrote:
>
>> Hello Richard, I am sorry if this question seems dumb, but I just 
>> started learning/uisng a packer a couple of days ago. How do I modify 
>> the 
>> etc/sshd_config file you're talking about. What is it supposed to 
>> contain?
>>
>>
>> On Friday, September 16, 2016 at 4:00:33 PM UTC-7, Rickard von Essen 
>> wrote:
>>>
>>> I don't see that you modify /etc/sshd_config in your kickstart file 
>>> to allow root login neither that you set roots password.
>>>
>>> If that doesn't help run with PACKER_LOG=1 packer build 
>>> template.json and gist the output and link here. Or if you have a 
>>> console 
>>> access (VMRC/vSphere/ESXi Embedded Host Client) login there and check 
>>> if 
>>> the network is up in the VM, you can access the outside world and check 
>>> if 
>>> you get any messages in the logs about auth fail etc.
>>>
>>> On Friday, September 16, 2016 at 7:24:44 PM UTC+2, Rjaydee wrote:

 I am trying to deploy and set a vm using packer and a kickstart 
 file. This packer code:
>>>

Re: [packer] Re: Deploying a vm with packer with a static IP

2016-09-17 Thread Alvaro Miranda Aguilera
Hello,

I will suggest slow down a bit.

You should automate something that you know it words and ideally you have
done it properly.

We know packer works so is not a packer issues, is "how I do xxx with
packer", but the issue in reality is "how do i xxx"

My suggestion will be do this first without packer, and then give a shot to
packer, you will learn about the process and you will able to move faster.


1. Manual install

Create a new VM on vmware, put the iso on it, do a instalattion, end with a
VM you can login with user and password you want.

2. First try with kickstart
Take /root/anaconda-ks.cfg file as example for an installer, review
commented section around disk partition, replace password with a
non-scripted one, comment out the current one.
If there is a line that say shutdown in the ks, replace it with reboot.

put this kickstart in some webserver in your network

Create a new VM
map the iso
edit the boot like to add at the end  ks=http://
//ks.cfg

wait to see if your vm install 100% un-attended, and its waiting for lognin
login with user/pass
shutdown the VM

3. First packer VM
use this kickstart as IS, no extra changes in packer, get a basic VM that
does nothing other than install.

When you have a working paker installation move 1 change at the time.

Alvaro.

-- 
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/CAHqq0ez_sK%3DaFw2tJUTAnU%3DyaxPM2rTJTLUaexqa4NGSgTNi6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [packer] Re: Deploying a vm with packer with a static IP

2016-09-17 Thread Rickard von Essen
In the original config you had both ethernet0 and ethernet1. Using only 
ethernet0 simplifies things. The below settings seems fair but networkName 
depends on you specific setup. Basically you need to know that these are 
right or find out. Automation is only in the way if you are unsure how this 
works. I would recommend to step back a bit. Try to create a VM on ESXi 
manually and do a manual install, examine all settings and what works and 
not. Read some documentation and ask ESXi specific question on such a forum 
where they will be much more qualified to answer you. Also think about if 
it wouldn't be sufficient to build on local virtualisation VMware 
Fusion/Workstation or VirtualBox which is much more straight forward and 
you can revisit building on ESXi when you got a hang on it. ESXi/vSphere is 
a very complex product and there lots of thing that can go wrong outside of 
Packers control. 

On Saturday, September 17, 2016 at 11:17:18 AM UTC+2, Rjaydee wrote:
>
> Thanks again for the reply. You mean this code here might be in correct? 
>  "vmx_data": {
> "ethernet0.startConnected":"TRUE",
> "ethernet0.virtualDev": "vmxnet3",
> "ethernet0.networkName": "VM Network",
> "ethernet0.addressType": "generated",
> "ethernet0.present": "TRUE",
> "memsize": "2048",
> "numvcpus": "2" }
>
> I used a template I found online. How would you do it? Just started doing 
> this a few days ago, so I am still learning.
>
> On Friday, September 16, 2016 at 11:50:04 PM UTC-7, Rickard von Essen 
> wrote:
>>
>> Ok then you need to get a console and login and troubleshoot your 
>> network. Most likely your network is not properly setup. Is it necessary to 
>> have two different nic's?
>>
>> On Saturday, September 17, 2016 at 7:20:02 AM UTC+2, Rjaydee wrote:
>>>
>>> So I did what you suggested. You can see attached files. I however keep 
>>> getting the ssh timeout error. This from the packer log:
>>>
>>>
>>> 2016/09/16 21:48:44 packer: 2016/09/16 21:48:44 opening new ssh session
>>>
>>> 2016/09/16 21:48:45 packer: 2016/09/16 21:48:45 starting remote command: 
>>> esxcli --formatter csv network vm list
>>>
>>> 2016/09/16 21:48:45 packer: 2016/09/16 21:48:45 remote command exited 
>>> with '0': esxcli --formatter csv network vm list
>>>
>>> 2016/09/16 21:48:45 packer: 2016/09/16 21:48:45 opening new ssh session
>>>
>>> 2016/09/16 21:48:45 packer: 2016/09/16 21:48:45 starting remote command: 
>>> esxcli --formatter csv network vm port list -w 28501321
>>>
>>> 2016/09/16 21:48:46 packer: 2016/09/16 21:48:46 remote command exited 
>>> with '0': esxcli --formatter csv network vm port list -w 28501321
>>>
>>> 2016/09/16 21:48:46 packer: 2016/09/16 21:48:46 [DEBUG] Error getting 
>>> SSH address: VM network port found, but no IP address
>>>
>>>  I just configured a centos vm manually using the same ipaddress, dns, 
>>> gateway etc..  and it worked. Any thoughts on why this is not working? 
>>> Thanks
>>>
>>> On Friday, September 16, 2016 at 5:15:28 PM UTC-7, Rickard von Essen 
>>> wrote:

 1) rootpw "testing" in your ks.cfg must match your "ssh_password": 
 “saint” in packertest.json .
 2) You kickstart file must enable root ssh login in 
 /etc/ssh/sshd_config by setting PermitRootLogin yes
 The simplest way to do this is probably adding this to your ks.cfg 
 before %end

 %post
 sed -i 's/.*PermitRootLogin .*/PermitRootLogin yes/' 
 /etc/ssh/sshd_config


 On 17 September 2016 at 01:49, Rjaydee  wrote:

> Hello Richard, I am sorry if this question seems dumb, but I just 
> started learning/uisng a packer a couple of days ago. How do I modify the 
> etc/sshd_config file you're talking about. What is it supposed to contain?
>
>
> On Friday, September 16, 2016 at 4:00:33 PM UTC-7, Rickard von Essen 
> wrote:
>>
>> I don't see that you modify /etc/sshd_config in your kickstart file 
>> to allow root login neither that you set roots password.
>>
>> If that doesn't help run with PACKER_LOG=1 packer build template.json 
>> and gist the output and link here. Or if you have a console access 
>> (VMRC/vSphere/ESXi Embedded Host Client) login there and check if the 
>> network is up in the VM, you can access the outside world and check if 
>> you 
>> get any messages in the logs about auth fail etc.
>>
>> On Friday, September 16, 2016 at 7:24:44 PM UTC+2, Rjaydee wrote:
>>>
>>> I am trying to deploy and set a vm using packer and a kickstart 
>>> file. This packer code:
>>>
>>> {
>>> "builders": [
>>> {
>>> "type": "vmware-iso",
>>> "format": "ovf",
>>> "vm_name": "PACKERTEST2",
>>> "iso_url": 
>>> "http://ftp.riken.jp/Linux/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1511.iso";,
>>>

Re: [packer] Re: Deploying a vm with packer with a static IP

2016-09-17 Thread Rjaydee
Thanks again for the reply. You mean this code here might be in correct? 
 "vmx_data": {
"ethernet0.startConnected":"TRUE",
"ethernet0.virtualDev": "vmxnet3",
"ethernet0.networkName": "VM Network",
"ethernet0.addressType": "generated",
"ethernet0.present": "TRUE",
"memsize": "2048",
"numvcpus": "2" }

I used a template I found online. How would you do it? Just started doing 
this a few days ago, so I am still learning.

On Friday, September 16, 2016 at 11:50:04 PM UTC-7, Rickard von Essen wrote:
>
> Ok then you need to get a console and login and troubleshoot your network. 
> Most likely your network is not properly setup. Is it necessary to have two 
> different nic's?
>
> On Saturday, September 17, 2016 at 7:20:02 AM UTC+2, Rjaydee wrote:
>>
>> So I did what you suggested. You can see attached files. I however keep 
>> getting the ssh timeout error. This from the packer log:
>>
>>
>> 2016/09/16 21:48:44 packer: 2016/09/16 21:48:44 opening new ssh session
>>
>> 2016/09/16 21:48:45 packer: 2016/09/16 21:48:45 starting remote command: 
>> esxcli --formatter csv network vm list
>>
>> 2016/09/16 21:48:45 packer: 2016/09/16 21:48:45 remote command exited 
>> with '0': esxcli --formatter csv network vm list
>>
>> 2016/09/16 21:48:45 packer: 2016/09/16 21:48:45 opening new ssh session
>>
>> 2016/09/16 21:48:45 packer: 2016/09/16 21:48:45 starting remote command: 
>> esxcli --formatter csv network vm port list -w 28501321
>>
>> 2016/09/16 21:48:46 packer: 2016/09/16 21:48:46 remote command exited 
>> with '0': esxcli --formatter csv network vm port list -w 28501321
>>
>> 2016/09/16 21:48:46 packer: 2016/09/16 21:48:46 [DEBUG] Error getting SSH 
>> address: VM network port found, but no IP address
>>
>>  I just configured a centos vm manually using the same ipaddress, dns, 
>> gateway etc..  and it worked. Any thoughts on why this is not working? 
>> Thanks
>>
>> On Friday, September 16, 2016 at 5:15:28 PM UTC-7, Rickard von Essen 
>> wrote:
>>>
>>> 1) rootpw "testing" in your ks.cfg must match your "ssh_password": 
>>> “saint” in packertest.json .
>>> 2) You kickstart file must enable root ssh login in /etc/ssh/sshd_config 
>>> by setting PermitRootLogin yes
>>> The simplest way to do this is probably adding this to your ks.cfg 
>>> before %end
>>>
>>> %post
>>> sed -i 's/.*PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config
>>>
>>>
>>> On 17 September 2016 at 01:49, Rjaydee  wrote:
>>>
 Hello Richard, I am sorry if this question seems dumb, but I just 
 started learning/uisng a packer a couple of days ago. How do I modify the 
 etc/sshd_config file you're talking about. What is it supposed to contain?


 On Friday, September 16, 2016 at 4:00:33 PM UTC-7, Rickard von Essen 
 wrote:
>
> I don't see that you modify /etc/sshd_config in your kickstart file to 
> allow root login neither that you set roots password.
>
> If that doesn't help run with PACKER_LOG=1 packer build template.json 
> and gist the output and link here. Or if you have a console access 
> (VMRC/vSphere/ESXi Embedded Host Client) login there and check if the 
> network is up in the VM, you can access the outside world and check if 
> you 
> get any messages in the logs about auth fail etc.
>
> On Friday, September 16, 2016 at 7:24:44 PM UTC+2, Rjaydee wrote:
>>
>> I am trying to deploy and set a vm using packer and a kickstart file. 
>> This packer code:
>>
>> {
>> "builders": [
>> {
>> "type": "vmware-iso",
>> "format": "ovf",
>> "vm_name": "PACKERTEST2",
>> "iso_url": 
>> "http://ftp.riken.jp/Linux/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1511.iso";,
>> "iso_checksum": 
>> "907e5755f824c5848b9c8efbb484f3cd945e93faa024bad6ba875226f9683b16",
>> "iso_checksum_type": "sha256",
>> "disk_size": "10240",
>> "disk_type_id": "thin",
>> "remote_host": "host",
>>   "remote_datastore": "ds",
>>   "remote_username": "root",
>>   "remote_password": "pw",
>>   "remote_type": "esx5",
>> "ssh_username": "root",
>> "guest_os_type": "centos-64",
>> "ssh_password": "ps",
>> "ssh_port": 22,
>> "ssh_wait_timeout": "800s",
>> "shutdown_command": "shutdown -h now",
>> "headless": false,
>> "floppy_files": [
>>   "kickstart/ks.cfg"
>> ],
>> "boot_command": " linux inst.text 
>> inst.ks=hd:fd0:/ks.cfg ",
>> "boot_wait": "20s",
>> "keep_registered": "true",
>> "vmx_data": {
>> "c

Re: [packer] Re: Deploying a vm with packer with a static IP

2016-09-16 Thread Rickard von Essen
Ok then you need to get a console and login and troubleshoot your network. 
Most likely your network is not properly setup. Is it necessary to have two 
different nic's?

On Saturday, September 17, 2016 at 7:20:02 AM UTC+2, Rjaydee wrote:
>
> So I did what you suggested. You can see attached files. I however keep 
> getting the ssh timeout error. This from the packer log:
>
>
> 2016/09/16 21:48:44 packer: 2016/09/16 21:48:44 opening new ssh session
>
> 2016/09/16 21:48:45 packer: 2016/09/16 21:48:45 starting remote command: 
> esxcli --formatter csv network vm list
>
> 2016/09/16 21:48:45 packer: 2016/09/16 21:48:45 remote command exited with 
> '0': esxcli --formatter csv network vm list
>
> 2016/09/16 21:48:45 packer: 2016/09/16 21:48:45 opening new ssh session
>
> 2016/09/16 21:48:45 packer: 2016/09/16 21:48:45 starting remote command: 
> esxcli --formatter csv network vm port list -w 28501321
>
> 2016/09/16 21:48:46 packer: 2016/09/16 21:48:46 remote command exited with 
> '0': esxcli --formatter csv network vm port list -w 28501321
>
> 2016/09/16 21:48:46 packer: 2016/09/16 21:48:46 [DEBUG] Error getting SSH 
> address: VM network port found, but no IP address
>
>  I just configured a centos vm manually using the same ipaddress, dns, 
> gateway etc..  and it worked. Any thoughts on why this is not working? 
> Thanks
>
> On Friday, September 16, 2016 at 5:15:28 PM UTC-7, Rickard von Essen wrote:
>>
>> 1) rootpw "testing" in your ks.cfg must match your "ssh_password": 
>> “saint” in packertest.json .
>> 2) You kickstart file must enable root ssh login in /etc/ssh/sshd_config 
>> by setting PermitRootLogin yes
>> The simplest way to do this is probably adding this to your ks.cfg before 
>> %end
>>
>> %post
>> sed -i 's/.*PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config
>>
>>
>> On 17 September 2016 at 01:49, Rjaydee  wrote:
>>
>>> Hello Richard, I am sorry if this question seems dumb, but I just 
>>> started learning/uisng a packer a couple of days ago. How do I modify the 
>>> etc/sshd_config file you're talking about. What is it supposed to contain?
>>>
>>>
>>> On Friday, September 16, 2016 at 4:00:33 PM UTC-7, Rickard von Essen 
>>> wrote:

 I don't see that you modify /etc/sshd_config in your kickstart file to 
 allow root login neither that you set roots password.

 If that doesn't help run with PACKER_LOG=1 packer build template.json 
 and gist the output and link here. Or if you have a console access 
 (VMRC/vSphere/ESXi Embedded Host Client) login there and check if the 
 network is up in the VM, you can access the outside world and check if you 
 get any messages in the logs about auth fail etc.

 On Friday, September 16, 2016 at 7:24:44 PM UTC+2, Rjaydee wrote:
>
> I am trying to deploy and set a vm using packer and a kickstart file. 
> This packer code:
>
> {
> "builders": [
> {
> "type": "vmware-iso",
> "format": "ovf",
> "vm_name": "PACKERTEST2",
> "iso_url": 
> "http://ftp.riken.jp/Linux/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1511.iso";,
> "iso_checksum": 
> "907e5755f824c5848b9c8efbb484f3cd945e93faa024bad6ba875226f9683b16",
> "iso_checksum_type": "sha256",
> "disk_size": "10240",
> "disk_type_id": "thin",
> "remote_host": "host",
>   "remote_datastore": "ds",
>   "remote_username": "root",
>   "remote_password": "pw",
>   "remote_type": "esx5",
> "ssh_username": "root",
> "guest_os_type": "centos-64",
> "ssh_password": "ps",
> "ssh_port": 22,
> "ssh_wait_timeout": "800s",
> "shutdown_command": "shutdown -h now",
> "headless": false,
> "floppy_files": [
>   "kickstart/ks.cfg"
> ],
> "boot_command": " linux inst.text inst.ks=hd:fd0:/ks.cfg 
> ",
> "boot_wait": "20s",
> "keep_registered": "true",
> "vmx_data": {
> "config.version": 8,
> "virtualHW.version": 8,
> "ethernet0.virtualDev": "vmxnet3",
> "ethernet0.networkName": "VM Network",
> "ethernet0.addressType": "generated",
> "ethernet0.present": "TRUE",
> "ethernet1.virtualDev": "vmxnet3",
> "ethernet1.networkName": "VLAN100",
> "ethernet1.addressType": "generated",
> "ethernet1.present": "TRUE",
> "ethernet0.pciSlotNumber": "9",
> "ethernet1.pciSlotNumber": "224",
> "memsize": "2048",
> "numvcpus": "2",
> "c

Re: [packer] Re: Deploying a vm with packer with a static IP

2016-09-16 Thread Rjaydee
Hello Alvaro, hope you're having a great day. Can you please take a look at 
my file, and tell me what's wrong?

Thanks.

On Friday, September 16, 2016 at 4:33:57 PM UTC-7, Alvaro Miranda Aguilera 
wrote:
>
> Hello, 
>
> on top of the password not being set on the kickstart, please check the 
> name of the interface.
>
> your code is enabling eth0, but in centos7 the names will be different.
> ens32 or ens33 usually, check bento as reference.
>
> this:
> https://github.com/chef/bento/blob/master/http/centos-7.2/ks.cfg#L5-L6
>
>
>
> On Sat, Sep 17, 2016 at 1:00 AM, Rickard von Essen  > wrote:
>
>> I don't see that you modify /etc/sshd_config in your kickstart file to 
>> allow root login neither that you set roots password.
>>
>> If that doesn't help run with PACKER_LOG=1 packer build template.json and 
>> gist the output and link here. Or if you have a console access 
>> (VMRC/vSphere/ESXi Embedded Host Client) login there and check if the 
>> network is up in the VM, you can access the outside world and check if you 
>> get any messages in the logs about auth fail etc.
>>
>>
>> On Friday, September 16, 2016 at 7:24:44 PM UTC+2, Rjaydee wrote:
>>>
>>> I am trying to deploy and set a vm using packer and a kickstart file. 
>>> This packer code:
>>>
>>> {
>>> "builders": [
>>> {
>>> "type": "vmware-iso",
>>> "format": "ovf",
>>> "vm_name": "PACKERTEST2",
>>> "iso_url": 
>>> "http://ftp.riken.jp/Linux/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1511.iso";,
>>> "iso_checksum": 
>>> "907e5755f824c5848b9c8efbb484f3cd945e93faa024bad6ba875226f9683b16",
>>> "iso_checksum_type": "sha256",
>>> "disk_size": "10240",
>>> "disk_type_id": "thin",
>>> "remote_host": "host",
>>>   "remote_datastore": "ds",
>>>   "remote_username": "root",
>>>   "remote_password": "pw",
>>>   "remote_type": "esx5",
>>> "ssh_username": "root",
>>> "guest_os_type": "centos-64",
>>> "ssh_password": "ps",
>>> "ssh_port": 22,
>>> "ssh_wait_timeout": "800s",
>>> "shutdown_command": "shutdown -h now",
>>> "headless": false,
>>> "floppy_files": [
>>>   "kickstart/ks.cfg"
>>> ],
>>> "boot_command": " linux inst.text inst.ks=hd:fd0:/ks.cfg 
>>> ",
>>> "boot_wait": "20s",
>>> "keep_registered": "true",
>>> "vmx_data": {
>>> "config.version": 8,
>>> "virtualHW.version": 8,
>>> "ethernet0.virtualDev": "vmxnet3",
>>> "ethernet0.networkName": "VM Network",
>>> "ethernet0.addressType": "generated",
>>> "ethernet0.present": "TRUE",
>>> "ethernet1.virtualDev": "vmxnet3",
>>> "ethernet1.networkName": "VLAN100",
>>> "ethernet1.addressType": "generated",
>>> "ethernet1.present": "TRUE",
>>> "ethernet0.pciSlotNumber": "9",
>>> "ethernet1.pciSlotNumber": "224",
>>> "memsize": "2048",
>>> "numvcpus": "2",
>>> "cpuid.coresPerSocket": "1",
>>> "RemoteDisplay.vnc.enabled": "TRUE",
>>> "RemoteDisplay.vnc.port":  "5900"
>>>
>>> }
>>> }
>>> ]
>>> }
>>>
>>> This is the ks.cfg file I have:
>>>
>>>
>>> # SELinux configuration
>>> selinux --enforcing
>>>
>>> # Installation logging level
>>> logging --level=info
>>>
>>>
>>> # Run the Setup Agent on first boot
>>> firstboot --enable
>>>
>>>  # Reboot after installation
>>>  reboot
>>>
>>> # System timezone
>>> timezone --isUtc America/Los_Angeles
>>> # Network information
>>> network --activate --bootproto=static --device=eth0 --gateway=8.1.132.254 
>>> --netmask=255.255.255.0 --ip= 8.1.132.18 —hostname=myhost.com
>>>
>>> # System bootloader configuration
>>> bootloader --append="crashkernel=auto rhgb quiet" --location=mbr 
>>> --driveorder="sda"
>>>
>>> # Partition clearing information
>>> zerombr
>>> clearpart --all  --drives=sda
>>>
>>> # Disk partitioning information
>>> part /boot --fstype="ext4" --size=500
>>> part pv.008002 --grow --size=1
>>> volgroup vg_centos --pesize=4096 pv.008002
>>> logvol / --fstype=ext4 --name=lv_root --vgname=vg_centos --grow --size=1024 
>>> --maxsize=51200
>>> logvol swap --name=lv_swap --vgname=vg_centos --grow --size=3072 
>>> --maxsize=3072
>>>
>>> %packages --nobase
>>> @^minimal
>>> @core
>>> kexec-tools
>>>
>>> %end
>>>
>>> I however keep getting this error when I run it.
>>>
>>> => vmware-iso: Waiting for SSH to become available...
>>> ==> vmware-iso: Timeout waiting for SSH.
>>> ==> vmware-iso: Stopping virtual machine...
>>> ==> vmware-iso: Destroying virtual machine...
>>> Build 'vmware-iso' errored: Timeout waiting for SSH.
>>> Why do I getting this error mess

Re: [packer] Re: Deploying a vm with packer with a static IP

2016-09-16 Thread Rjaydee
So I did what you suggested. You can see attached files. I however keep 
getting the ssh timeout error. This from the packer log:


2016/09/16 21:48:44 packer: 2016/09/16 21:48:44 opening new ssh session

2016/09/16 21:48:45 packer: 2016/09/16 21:48:45 starting remote command: 
esxcli --formatter csv network vm list

2016/09/16 21:48:45 packer: 2016/09/16 21:48:45 remote command exited with 
'0': esxcli --formatter csv network vm list

2016/09/16 21:48:45 packer: 2016/09/16 21:48:45 opening new ssh session

2016/09/16 21:48:45 packer: 2016/09/16 21:48:45 starting remote command: 
esxcli --formatter csv network vm port list -w 28501321

2016/09/16 21:48:46 packer: 2016/09/16 21:48:46 remote command exited with 
'0': esxcli --formatter csv network vm port list -w 28501321

2016/09/16 21:48:46 packer: 2016/09/16 21:48:46 [DEBUG] Error getting SSH 
address: VM network port found, but no IP address

 I just configured a centos vm manually using the same ipaddress, dns, 
gateway etc..  and it worked. Any thoughts on why this is not working? 
Thanks

On Friday, September 16, 2016 at 5:15:28 PM UTC-7, Rickard von Essen wrote:
>
> 1) rootpw "testing" in your ks.cfg must match your "ssh_password": “saint” 
> in packertest.json .
> 2) You kickstart file must enable root ssh login in /etc/ssh/sshd_config 
> by setting PermitRootLogin yes
> The simplest way to do this is probably adding this to your ks.cfg before 
> %end
>
> %post
> sed -i 's/.*PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config
>
>
> On 17 September 2016 at 01:49, Rjaydee > 
> wrote:
>
>> Hello Richard, I am sorry if this question seems dumb, but I just started 
>> learning/uisng a packer a couple of days ago. How do I modify the 
>> etc/sshd_config file you're talking about. What is it supposed to contain?
>>
>>
>> On Friday, September 16, 2016 at 4:00:33 PM UTC-7, Rickard von Essen 
>> wrote:
>>>
>>> I don't see that you modify /etc/sshd_config in your kickstart file to 
>>> allow root login neither that you set roots password.
>>>
>>> If that doesn't help run with PACKER_LOG=1 packer build template.json 
>>> and gist the output and link here. Or if you have a console access 
>>> (VMRC/vSphere/ESXi Embedded Host Client) login there and check if the 
>>> network is up in the VM, you can access the outside world and check if you 
>>> get any messages in the logs about auth fail etc.
>>>
>>> On Friday, September 16, 2016 at 7:24:44 PM UTC+2, Rjaydee wrote:

 I am trying to deploy and set a vm using packer and a kickstart file. 
 This packer code:

 {
 "builders": [
 {
 "type": "vmware-iso",
 "format": "ovf",
 "vm_name": "PACKERTEST2",
 "iso_url": 
 "http://ftp.riken.jp/Linux/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1511.iso";,
 "iso_checksum": 
 "907e5755f824c5848b9c8efbb484f3cd945e93faa024bad6ba875226f9683b16",
 "iso_checksum_type": "sha256",
 "disk_size": "10240",
 "disk_type_id": "thin",
 "remote_host": "host",
   "remote_datastore": "ds",
   "remote_username": "root",
   "remote_password": "pw",
   "remote_type": "esx5",
 "ssh_username": "root",
 "guest_os_type": "centos-64",
 "ssh_password": "ps",
 "ssh_port": 22,
 "ssh_wait_timeout": "800s",
 "shutdown_command": "shutdown -h now",
 "headless": false,
 "floppy_files": [
   "kickstart/ks.cfg"
 ],
 "boot_command": " linux inst.text inst.ks=hd:fd0:/ks.cfg 
 ",
 "boot_wait": "20s",
 "keep_registered": "true",
 "vmx_data": {
 "config.version": 8,
 "virtualHW.version": 8,
 "ethernet0.virtualDev": "vmxnet3",
 "ethernet0.networkName": "VM Network",
 "ethernet0.addressType": "generated",
 "ethernet0.present": "TRUE",
 "ethernet1.virtualDev": "vmxnet3",
 "ethernet1.networkName": "VLAN100",
 "ethernet1.addressType": "generated",
 "ethernet1.present": "TRUE",
 "ethernet0.pciSlotNumber": "9",
 "ethernet1.pciSlotNumber": "224",
 "memsize": "2048",
 "numvcpus": "2",
 "cpuid.coresPerSocket": "1",
 "RemoteDisplay.vnc.enabled": "TRUE",
 "RemoteDisplay.vnc.port":  "5900"

 }
 }
 ]
 }

 This is the ks.cfg file I have:


 # SELinux configuration
 selinux --enforcing

 # Installation logging level
 logging --level=info

Re: [packer] Re: Deploying a vm with packer with a static IP

2016-09-16 Thread Rjaydee
Thank you so much!! I am gonna try it and see if it works.

On Friday, September 16, 2016 at 5:15:28 PM UTC-7, Rickard von Essen wrote:
>
> 1) rootpw "testing" in your ks.cfg must match your "ssh_password": “saint” 
> in packertest.json .
> 2) You kickstart file must enable root ssh login in /etc/ssh/sshd_config 
> by setting PermitRootLogin yes
> The simplest way to do this is probably adding this to your ks.cfg before 
> %end
>
> %post
> sed -i 's/.*PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config
>
>
> On 17 September 2016 at 01:49, Rjaydee > 
> wrote:
>
>> Hello Richard, I am sorry if this question seems dumb, but I just started 
>> learning/uisng a packer a couple of days ago. How do I modify the 
>> etc/sshd_config file you're talking about. What is it supposed to contain?
>>
>>
>> On Friday, September 16, 2016 at 4:00:33 PM UTC-7, Rickard von Essen 
>> wrote:
>>>
>>> I don't see that you modify /etc/sshd_config in your kickstart file to 
>>> allow root login neither that you set roots password.
>>>
>>> If that doesn't help run with PACKER_LOG=1 packer build template.json 
>>> and gist the output and link here. Or if you have a console access 
>>> (VMRC/vSphere/ESXi Embedded Host Client) login there and check if the 
>>> network is up in the VM, you can access the outside world and check if you 
>>> get any messages in the logs about auth fail etc.
>>>
>>> On Friday, September 16, 2016 at 7:24:44 PM UTC+2, Rjaydee wrote:

 I am trying to deploy and set a vm using packer and a kickstart file. 
 This packer code:

 {
 "builders": [
 {
 "type": "vmware-iso",
 "format": "ovf",
 "vm_name": "PACKERTEST2",
 "iso_url": 
 "http://ftp.riken.jp/Linux/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1511.iso";,
 "iso_checksum": 
 "907e5755f824c5848b9c8efbb484f3cd945e93faa024bad6ba875226f9683b16",
 "iso_checksum_type": "sha256",
 "disk_size": "10240",
 "disk_type_id": "thin",
 "remote_host": "host",
   "remote_datastore": "ds",
   "remote_username": "root",
   "remote_password": "pw",
   "remote_type": "esx5",
 "ssh_username": "root",
 "guest_os_type": "centos-64",
 "ssh_password": "ps",
 "ssh_port": 22,
 "ssh_wait_timeout": "800s",
 "shutdown_command": "shutdown -h now",
 "headless": false,
 "floppy_files": [
   "kickstart/ks.cfg"
 ],
 "boot_command": " linux inst.text inst.ks=hd:fd0:/ks.cfg 
 ",
 "boot_wait": "20s",
 "keep_registered": "true",
 "vmx_data": {
 "config.version": 8,
 "virtualHW.version": 8,
 "ethernet0.virtualDev": "vmxnet3",
 "ethernet0.networkName": "VM Network",
 "ethernet0.addressType": "generated",
 "ethernet0.present": "TRUE",
 "ethernet1.virtualDev": "vmxnet3",
 "ethernet1.networkName": "VLAN100",
 "ethernet1.addressType": "generated",
 "ethernet1.present": "TRUE",
 "ethernet0.pciSlotNumber": "9",
 "ethernet1.pciSlotNumber": "224",
 "memsize": "2048",
 "numvcpus": "2",
 "cpuid.coresPerSocket": "1",
 "RemoteDisplay.vnc.enabled": "TRUE",
 "RemoteDisplay.vnc.port":  "5900"

 }
 }
 ]
 }

 This is the ks.cfg file I have:


 # SELinux configuration
 selinux --enforcing

 # Installation logging level
 logging --level=info


 # Run the Setup Agent on first boot
 firstboot --enable

  # Reboot after installation
  reboot

 # System timezone
 timezone --isUtc America/Los_Angeles
 # Network information
 network --activate --bootproto=static --device=eth0 --gateway=8.1.132.254 
 --netmask=255.255.255.0 --ip= 8.1.132.18 —hostname=myhost.com

 # System bootloader configuration
 bootloader --append="crashkernel=auto rhgb quiet" --location=mbr 
 --driveorder="sda"

 # Partition clearing information
 zerombr
 clearpart --all  --drives=sda

 # Disk partitioning information
 part /boot --fstype="ext4" --size=500
 part pv.008002 --grow --size=1
 volgroup vg_centos --pesize=4096 pv.008002
 logvol / --fstype=ext4 --name=lv_root --vgname=vg_centos --grow 
 --size=1024 --maxsize=51200
 logvol swap --name=lv_swap --vgname=vg_centos --grow --size=3072 
 --maxsize=3072

 %packages --nobase
 @

Re: [packer] Re: Deploying a vm with packer with a static IP

2016-09-16 Thread Rickard von Essen
1) rootpw "testing" in your ks.cfg must match your "ssh_password": “saint”
in packertest.json .
2) You kickstart file must enable root ssh login in /etc/ssh/sshd_config by
setting PermitRootLogin yes
The simplest way to do this is probably adding this to your ks.cfg before
%end

%post
sed -i 's/.*PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config


On 17 September 2016 at 01:49, Rjaydee  wrote:

> Hello Richard, I am sorry if this question seems dumb, but I just started
> learning/uisng a packer a couple of days ago. How do I modify the
> etc/sshd_config file you're talking about. What is it supposed to contain?
>
>
> On Friday, September 16, 2016 at 4:00:33 PM UTC-7, Rickard von Essen wrote:
>>
>> I don't see that you modify /etc/sshd_config in your kickstart file to
>> allow root login neither that you set roots password.
>>
>> If that doesn't help run with PACKER_LOG=1 packer build template.json and
>> gist the output and link here. Or if you have a console access
>> (VMRC/vSphere/ESXi Embedded Host Client) login there and check if the
>> network is up in the VM, you can access the outside world and check if you
>> get any messages in the logs about auth fail etc.
>>
>> On Friday, September 16, 2016 at 7:24:44 PM UTC+2, Rjaydee wrote:
>>>
>>> I am trying to deploy and set a vm using packer and a kickstart file.
>>> This packer code:
>>>
>>> {
>>> "builders": [
>>> {
>>> "type": "vmware-iso",
>>> "format": "ovf",
>>> "vm_name": "PACKERTEST2",
>>> "iso_url": 
>>> "http://ftp.riken.jp/Linux/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1511.iso";,
>>> "iso_checksum": 
>>> "907e5755f824c5848b9c8efbb484f3cd945e93faa024bad6ba875226f9683b16",
>>> "iso_checksum_type": "sha256",
>>> "disk_size": "10240",
>>> "disk_type_id": "thin",
>>> "remote_host": "host",
>>>   "remote_datastore": "ds",
>>>   "remote_username": "root",
>>>   "remote_password": "pw",
>>>   "remote_type": "esx5",
>>> "ssh_username": "root",
>>> "guest_os_type": "centos-64",
>>> "ssh_password": "ps",
>>> "ssh_port": 22,
>>> "ssh_wait_timeout": "800s",
>>> "shutdown_command": "shutdown -h now",
>>> "headless": false,
>>> "floppy_files": [
>>>   "kickstart/ks.cfg"
>>> ],
>>> "boot_command": " linux inst.text inst.ks=hd:fd0:/ks.cfg 
>>> ",
>>> "boot_wait": "20s",
>>> "keep_registered": "true",
>>> "vmx_data": {
>>> "config.version": 8,
>>> "virtualHW.version": 8,
>>> "ethernet0.virtualDev": "vmxnet3",
>>> "ethernet0.networkName": "VM Network",
>>> "ethernet0.addressType": "generated",
>>> "ethernet0.present": "TRUE",
>>> "ethernet1.virtualDev": "vmxnet3",
>>> "ethernet1.networkName": "VLAN100",
>>> "ethernet1.addressType": "generated",
>>> "ethernet1.present": "TRUE",
>>> "ethernet0.pciSlotNumber": "9",
>>> "ethernet1.pciSlotNumber": "224",
>>> "memsize": "2048",
>>> "numvcpus": "2",
>>> "cpuid.coresPerSocket": "1",
>>> "RemoteDisplay.vnc.enabled": "TRUE",
>>> "RemoteDisplay.vnc.port":  "5900"
>>>
>>> }
>>> }
>>> ]
>>> }
>>>
>>> This is the ks.cfg file I have:
>>>
>>>
>>> # SELinux configuration
>>> selinux --enforcing
>>>
>>> # Installation logging level
>>> logging --level=info
>>>
>>>
>>> # Run the Setup Agent on first boot
>>> firstboot --enable
>>>
>>>  # Reboot after installation
>>>  reboot
>>>
>>> # System timezone
>>> timezone --isUtc America/Los_Angeles
>>> # Network information
>>> network --activate --bootproto=static --device=eth0 --gateway=8.1.132.254 
>>> --netmask=255.255.255.0 --ip= 8.1.132.18 —hostname=myhost.com
>>>
>>> # System bootloader configuration
>>> bootloader --append="crashkernel=auto rhgb quiet" --location=mbr 
>>> --driveorder="sda"
>>>
>>> # Partition clearing information
>>> zerombr
>>> clearpart --all  --drives=sda
>>>
>>> # Disk partitioning information
>>> part /boot --fstype="ext4" --size=500
>>> part pv.008002 --grow --size=1
>>> volgroup vg_centos --pesize=4096 pv.008002
>>> logvol / --fstype=ext4 --name=lv_root --vgname=vg_centos --grow --size=1024 
>>> --maxsize=51200
>>> logvol swap --name=lv_swap --vgname=vg_centos --grow --size=3072 
>>> --maxsize=3072
>>>
>>> %packages --nobase
>>> @^minimal
>>> @core
>>> kexec-tools
>>>
>>> %end
>>>
>>> I however keep getting this error when I run it.
>>>
>>> => vmware-iso: Waiting for SSH to become available...
>>> ==> vmware-iso: Timeout waiting for SSH.
>>> ==> vmware-iso: Stopping virtual machine...
>>> ==> vmware-iso: Destroying virtua

[packer] Re: Deploying a vm with packer with a static IP

2016-09-16 Thread Rjaydee

Pleae find attached my modified files

>

-- 
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/3760d4c4-6585-4906-b606-60fe394efc30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


packertest.json
Description: application/json
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512

# Firewall configuration
firewall --disabled --ssh --service=ssh

# USE CDROM installation media
cdrom

#Use graphical install
graphical

#Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda

 # Reboot after installation
 reboot


#Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'

#System language
lang en_US.UTF-8


#Network Information
network --bootproto=static --device=eno16780032 --gateway=*** --ip=*** 
--nameserver= --netmask=255.255.252.0 --noipv6 --activate 
--hostname=host.ibm.com

# Root password
rootpw "testing"

#System timezone
timezone --isUtc America/Los_Angeles

#System bootloader configuration
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda
autopart --type=lvm

#partition clearing information
clearpart --all --initlabel --drives=sda

%packages
@^minimal
@core
%end



[packer] Re: Deploying a vm with packer with a static IP

2016-09-16 Thread Rjaydee
Hello Richard, I am sorry if this question seems dumb, but I just started 
learning/uisng a packer a couple of days ago. How do I modify the 
etc/sshd_config file you're talking about. What is it supposed to contain?

On Friday, September 16, 2016 at 4:00:33 PM UTC-7, Rickard von Essen wrote:
>
> I don't see that you modify /etc/sshd_config in your kickstart file to 
> allow root login neither that you set roots password.
>
> If that doesn't help run with PACKER_LOG=1 packer build template.json and 
> gist the output and link here. Or if you have a console access 
> (VMRC/vSphere/ESXi Embedded Host Client) login there and check if the 
> network is up in the VM, you can access the outside world and check if you 
> get any messages in the logs about auth fail etc.
>
> On Friday, September 16, 2016 at 7:24:44 PM UTC+2, Rjaydee wrote:
>>
>> I am trying to deploy and set a vm using packer and a kickstart file. 
>> This packer code:
>>
>> {
>> "builders": [
>> {
>> "type": "vmware-iso",
>> "format": "ovf",
>> "vm_name": "PACKERTEST2",
>> "iso_url": 
>> "http://ftp.riken.jp/Linux/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1511.iso";,
>> "iso_checksum": 
>> "907e5755f824c5848b9c8efbb484f3cd945e93faa024bad6ba875226f9683b16",
>> "iso_checksum_type": "sha256",
>> "disk_size": "10240",
>> "disk_type_id": "thin",
>> "remote_host": "host",
>>   "remote_datastore": "ds",
>>   "remote_username": "root",
>>   "remote_password": "pw",
>>   "remote_type": "esx5",
>> "ssh_username": "root",
>> "guest_os_type": "centos-64",
>> "ssh_password": "ps",
>> "ssh_port": 22,
>> "ssh_wait_timeout": "800s",
>> "shutdown_command": "shutdown -h now",
>> "headless": false,
>> "floppy_files": [
>>   "kickstart/ks.cfg"
>> ],
>> "boot_command": " linux inst.text inst.ks=hd:fd0:/ks.cfg 
>> ",
>> "boot_wait": "20s",
>> "keep_registered": "true",
>> "vmx_data": {
>> "config.version": 8,
>> "virtualHW.version": 8,
>> "ethernet0.virtualDev": "vmxnet3",
>> "ethernet0.networkName": "VM Network",
>> "ethernet0.addressType": "generated",
>> "ethernet0.present": "TRUE",
>> "ethernet1.virtualDev": "vmxnet3",
>> "ethernet1.networkName": "VLAN100",
>> "ethernet1.addressType": "generated",
>> "ethernet1.present": "TRUE",
>> "ethernet0.pciSlotNumber": "9",
>> "ethernet1.pciSlotNumber": "224",
>> "memsize": "2048",
>> "numvcpus": "2",
>> "cpuid.coresPerSocket": "1",
>> "RemoteDisplay.vnc.enabled": "TRUE",
>> "RemoteDisplay.vnc.port":  "5900"
>>
>> }
>> }
>> ]
>> }
>>
>> This is the ks.cfg file I have:
>>
>>
>> # SELinux configuration
>> selinux --enforcing
>>
>> # Installation logging level
>> logging --level=info
>>
>>
>> # Run the Setup Agent on first boot
>> firstboot --enable
>>
>>  # Reboot after installation
>>  reboot
>>
>> # System timezone
>> timezone --isUtc America/Los_Angeles
>> # Network information
>> network --activate --bootproto=static --device=eth0 --gateway=8.1.132.254 
>> --netmask=255.255.255.0 --ip= 8.1.132.18 —hostname=myhost.com
>>
>> # System bootloader configuration
>> bootloader --append="crashkernel=auto rhgb quiet" --location=mbr 
>> --driveorder="sda"
>>
>> # Partition clearing information
>> zerombr
>> clearpart --all  --drives=sda
>>
>> # Disk partitioning information
>> part /boot --fstype="ext4" --size=500
>> part pv.008002 --grow --size=1
>> volgroup vg_centos --pesize=4096 pv.008002
>> logvol / --fstype=ext4 --name=lv_root --vgname=vg_centos --grow --size=1024 
>> --maxsize=51200
>> logvol swap --name=lv_swap --vgname=vg_centos --grow --size=3072 
>> --maxsize=3072
>>
>> %packages --nobase
>> @^minimal
>> @core
>> kexec-tools
>>
>> %end
>>
>> I however keep getting this error when I run it.
>>
>> => vmware-iso: Waiting for SSH to become available...
>> ==> vmware-iso: Timeout waiting for SSH.
>> ==> vmware-iso: Stopping virtual machine...
>> ==> vmware-iso: Destroying virtual machine...
>> Build 'vmware-iso' errored: Timeout waiting for SSH.
>> Why do I getting this error message? Is it because my code in the ks.cfg 
>> file to connect to a static ip address correct? Any thought would be greatly 
>> appreciated.
>>
>>

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

Re: [packer] Re: Deploying a vm with packer with a static IP

2016-09-16 Thread Rjaydee
Hello Alvaro. Thanks for your reply. eno16780032. this is the device I am 
using. How do I fix it in my code. I am sorry if this questions seem pretty 
obvious. i am very new to all of this. i have also attached my current code 
now. Thanks.

On Friday, September 16, 2016 at 4:33:57 PM UTC-7, Alvaro Miranda Aguilera 
wrote:
>
> Hello, 
>
> on top of the password not being set on the kickstart, please check the 
> name of the interface.
>
> your code is enabling eth0, but in centos7 the names will be different.
> ens32 or ens33 usually, check bento as reference.
>
> this:
> https://github.com/chef/bento/blob/master/http/centos-7.2/ks.cfg#L5-L6
>
>
>
> On Sat, Sep 17, 2016 at 1:00 AM, Rickard von Essen  > wrote:
>
>> I don't see that you modify /etc/sshd_config in your kickstart file to 
>> allow root login neither that you set roots password.
>>
>> If that doesn't help run with PACKER_LOG=1 packer build template.json and 
>> gist the output and link here. Or if you have a console access 
>> (VMRC/vSphere/ESXi Embedded Host Client) login there and check if the 
>> network is up in the VM, you can access the outside world and check if you 
>> get any messages in the logs about auth fail etc.
>>
>>
>> On Friday, September 16, 2016 at 7:24:44 PM UTC+2, Rjaydee wrote:
>>>
>>> I am trying to deploy and set a vm using packer and a kickstart file. 
>>> This packer code:
>>>
>>> {
>>> "builders": [
>>> {
>>> "type": "vmware-iso",
>>> "format": "ovf",
>>> "vm_name": "PACKERTEST2",
>>> "iso_url": 
>>> "http://ftp.riken.jp/Linux/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1511.iso";,
>>> "iso_checksum": 
>>> "907e5755f824c5848b9c8efbb484f3cd945e93faa024bad6ba875226f9683b16",
>>> "iso_checksum_type": "sha256",
>>> "disk_size": "10240",
>>> "disk_type_id": "thin",
>>> "remote_host": "host",
>>>   "remote_datastore": "ds",
>>>   "remote_username": "root",
>>>   "remote_password": "pw",
>>>   "remote_type": "esx5",
>>> "ssh_username": "root",
>>> "guest_os_type": "centos-64",
>>> "ssh_password": "ps",
>>> "ssh_port": 22,
>>> "ssh_wait_timeout": "800s",
>>> "shutdown_command": "shutdown -h now",
>>> "headless": false,
>>> "floppy_files": [
>>>   "kickstart/ks.cfg"
>>> ],
>>> "boot_command": " linux inst.text inst.ks=hd:fd0:/ks.cfg 
>>> ",
>>> "boot_wait": "20s",
>>> "keep_registered": "true",
>>> "vmx_data": {
>>> "config.version": 8,
>>> "virtualHW.version": 8,
>>> "ethernet0.virtualDev": "vmxnet3",
>>> "ethernet0.networkName": "VM Network",
>>> "ethernet0.addressType": "generated",
>>> "ethernet0.present": "TRUE",
>>> "ethernet1.virtualDev": "vmxnet3",
>>> "ethernet1.networkName": "VLAN100",
>>> "ethernet1.addressType": "generated",
>>> "ethernet1.present": "TRUE",
>>> "ethernet0.pciSlotNumber": "9",
>>> "ethernet1.pciSlotNumber": "224",
>>> "memsize": "2048",
>>> "numvcpus": "2",
>>> "cpuid.coresPerSocket": "1",
>>> "RemoteDisplay.vnc.enabled": "TRUE",
>>> "RemoteDisplay.vnc.port":  "5900"
>>>
>>> }
>>> }
>>> ]
>>> }
>>>
>>> This is the ks.cfg file I have:
>>>
>>>
>>> # SELinux configuration
>>> selinux --enforcing
>>>
>>> # Installation logging level
>>> logging --level=info
>>>
>>>
>>> # Run the Setup Agent on first boot
>>> firstboot --enable
>>>
>>>  # Reboot after installation
>>>  reboot
>>>
>>> # System timezone
>>> timezone --isUtc America/Los_Angeles
>>> # Network information
>>> network --activate --bootproto=static --device=eth0 --gateway=8.1.132.254 
>>> --netmask=255.255.255.0 --ip= 8.1.132.18 —hostname=myhost.com
>>>
>>> # System bootloader configuration
>>> bootloader --append="crashkernel=auto rhgb quiet" --location=mbr 
>>> --driveorder="sda"
>>>
>>> # Partition clearing information
>>> zerombr
>>> clearpart --all  --drives=sda
>>>
>>> # Disk partitioning information
>>> part /boot --fstype="ext4" --size=500
>>> part pv.008002 --grow --size=1
>>> volgroup vg_centos --pesize=4096 pv.008002
>>> logvol / --fstype=ext4 --name=lv_root --vgname=vg_centos --grow --size=1024 
>>> --maxsize=51200
>>> logvol swap --name=lv_swap --vgname=vg_centos --grow --size=3072 
>>> --maxsize=3072
>>>
>>> %packages --nobase
>>> @^minimal
>>> @core
>>> kexec-tools
>>>
>>> %end
>>>
>>> I however keep getting this error when I run it.
>>>
>>> => vmware-iso: Waiting for SSH to become available...
>>> ==> vmware-iso: Timeout waiting for SSH.
>>> ==> vmware-iso: Stopping virtual machine...
>>> ==> vmware-iso: De

[packer] Re: Deploying a vm with packer with a static IP

2016-09-16 Thread Rjaydee
Thanks for the reply. I just attached my current files.

On Friday, September 16, 2016 at 10:24:44 AM UTC-7, Rjaydee wrote:
>
> I am trying to deploy and set a vm using packer and a kickstart file. This 
> packer code:
>
> {
> "builders": [
> {
> "type": "vmware-iso",
> "format": "ovf",
> "vm_name": "PACKERTEST2",
> "iso_url": 
> "http://ftp.riken.jp/Linux/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1511.iso";,
> "iso_checksum": 
> "907e5755f824c5848b9c8efbb484f3cd945e93faa024bad6ba875226f9683b16",
> "iso_checksum_type": "sha256",
> "disk_size": "10240",
> "disk_type_id": "thin",
> "remote_host": "host",
>   "remote_datastore": "ds",
>   "remote_username": "root",
>   "remote_password": "pw",
>   "remote_type": "esx5",
> "ssh_username": "root",
> "guest_os_type": "centos-64",
> "ssh_password": "ps",
> "ssh_port": 22,
> "ssh_wait_timeout": "800s",
> "shutdown_command": "shutdown -h now",
> "headless": false,
> "floppy_files": [
>   "kickstart/ks.cfg"
> ],
> "boot_command": " linux inst.text inst.ks=hd:fd0:/ks.cfg 
> ",
> "boot_wait": "20s",
> "keep_registered": "true",
> "vmx_data": {
> "config.version": 8,
> "virtualHW.version": 8,
> "ethernet0.virtualDev": "vmxnet3",
> "ethernet0.networkName": "VM Network",
> "ethernet0.addressType": "generated",
> "ethernet0.present": "TRUE",
> "ethernet1.virtualDev": "vmxnet3",
> "ethernet1.networkName": "VLAN100",
> "ethernet1.addressType": "generated",
> "ethernet1.present": "TRUE",
> "ethernet0.pciSlotNumber": "9",
> "ethernet1.pciSlotNumber": "224",
> "memsize": "2048",
> "numvcpus": "2",
> "cpuid.coresPerSocket": "1",
> "RemoteDisplay.vnc.enabled": "TRUE",
> "RemoteDisplay.vnc.port":  "5900"
>
> }
> }
> ]
> }
>
> This is the ks.cfg file I have:
>
>
> # SELinux configuration
> selinux --enforcing
>
> # Installation logging level
> logging --level=info
>
>
> # Run the Setup Agent on first boot
> firstboot --enable
>
>  # Reboot after installation
>  reboot
>
> # System timezone
> timezone --isUtc America/Los_Angeles
> # Network information
> network --activate --bootproto=static --device=eth0 --gateway=8.1.132.254 
> --netmask=255.255.255.0 --ip= 8.1.132.18 —hostname=myhost.com
>
> # System bootloader configuration
> bootloader --append="crashkernel=auto rhgb quiet" --location=mbr 
> --driveorder="sda"
>
> # Partition clearing information
> zerombr
> clearpart --all  --drives=sda
>
> # Disk partitioning information
> part /boot --fstype="ext4" --size=500
> part pv.008002 --grow --size=1
> volgroup vg_centos --pesize=4096 pv.008002
> logvol / --fstype=ext4 --name=lv_root --vgname=vg_centos --grow --size=1024 
> --maxsize=51200
> logvol swap --name=lv_swap --vgname=vg_centos --grow --size=3072 
> --maxsize=3072
>
> %packages --nobase
> @^minimal
> @core
> kexec-tools
>
> %end
>
> I however keep getting this error when I run it.
>
> => vmware-iso: Waiting for SSH to become available...
> ==> vmware-iso: Timeout waiting for SSH.
> ==> vmware-iso: Stopping virtual machine...
> ==> vmware-iso: Destroying virtual machine...
> Build 'vmware-iso' errored: Timeout waiting for SSH.
> Why do I getting this error message? Is it because my code in the ks.cfg file 
> to connect to a static ip address correct? Any thought would be greatly 
> appreciated.
>
>

-- 
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/f808893a-f777-4123-b2a4-24107f75baad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512

# Firewall configuration
firewall --disabled --ssh --service=ssh

# USE CDROM installation media
cdrom

#Use graphical install
graphical

#Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda

 # Reboot after installation
 reboot


#Keyboard layouts
keyboard --vckeyma

Re: [packer] Re: Deploying a vm with packer with a static IP

2016-09-16 Thread Alvaro Miranda Aguilera
Hello,

on top of the password not being set on the kickstart, please check the
name of the interface.

your code is enabling eth0, but in centos7 the names will be different.
ens32 or ens33 usually, check bento as reference.

this:
https://github.com/chef/bento/blob/master/http/centos-7.2/ks.cfg#L5-L6



On Sat, Sep 17, 2016 at 1:00 AM, Rickard von Essen <
rickard.von.es...@gmail.com> wrote:

> I don't see that you modify /etc/sshd_config in your kickstart file to
> allow root login neither that you set roots password.
>
> If that doesn't help run with PACKER_LOG=1 packer build template.json and
> gist the output and link here. Or if you have a console access
> (VMRC/vSphere/ESXi Embedded Host Client) login there and check if the
> network is up in the VM, you can access the outside world and check if you
> get any messages in the logs about auth fail etc.
>
>
> On Friday, September 16, 2016 at 7:24:44 PM UTC+2, Rjaydee wrote:
>>
>> I am trying to deploy and set a vm using packer and a kickstart file.
>> This packer code:
>>
>> {
>> "builders": [
>> {
>> "type": "vmware-iso",
>> "format": "ovf",
>> "vm_name": "PACKERTEST2",
>> "iso_url": 
>> "http://ftp.riken.jp/Linux/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1511.iso";,
>> "iso_checksum": 
>> "907e5755f824c5848b9c8efbb484f3cd945e93faa024bad6ba875226f9683b16",
>> "iso_checksum_type": "sha256",
>> "disk_size": "10240",
>> "disk_type_id": "thin",
>> "remote_host": "host",
>>   "remote_datastore": "ds",
>>   "remote_username": "root",
>>   "remote_password": "pw",
>>   "remote_type": "esx5",
>> "ssh_username": "root",
>> "guest_os_type": "centos-64",
>> "ssh_password": "ps",
>> "ssh_port": 22,
>> "ssh_wait_timeout": "800s",
>> "shutdown_command": "shutdown -h now",
>> "headless": false,
>> "floppy_files": [
>>   "kickstart/ks.cfg"
>> ],
>> "boot_command": " linux inst.text inst.ks=hd:fd0:/ks.cfg 
>> ",
>> "boot_wait": "20s",
>> "keep_registered": "true",
>> "vmx_data": {
>> "config.version": 8,
>> "virtualHW.version": 8,
>> "ethernet0.virtualDev": "vmxnet3",
>> "ethernet0.networkName": "VM Network",
>> "ethernet0.addressType": "generated",
>> "ethernet0.present": "TRUE",
>> "ethernet1.virtualDev": "vmxnet3",
>> "ethernet1.networkName": "VLAN100",
>> "ethernet1.addressType": "generated",
>> "ethernet1.present": "TRUE",
>> "ethernet0.pciSlotNumber": "9",
>> "ethernet1.pciSlotNumber": "224",
>> "memsize": "2048",
>> "numvcpus": "2",
>> "cpuid.coresPerSocket": "1",
>> "RemoteDisplay.vnc.enabled": "TRUE",
>> "RemoteDisplay.vnc.port":  "5900"
>>
>> }
>> }
>> ]
>> }
>>
>> This is the ks.cfg file I have:
>>
>>
>> # SELinux configuration
>> selinux --enforcing
>>
>> # Installation logging level
>> logging --level=info
>>
>>
>> # Run the Setup Agent on first boot
>> firstboot --enable
>>
>>  # Reboot after installation
>>  reboot
>>
>> # System timezone
>> timezone --isUtc America/Los_Angeles
>> # Network information
>> network --activate --bootproto=static --device=eth0 --gateway=8.1.132.254 
>> --netmask=255.255.255.0 --ip= 8.1.132.18 —hostname=myhost.com
>>
>> # System bootloader configuration
>> bootloader --append="crashkernel=auto rhgb quiet" --location=mbr 
>> --driveorder="sda"
>>
>> # Partition clearing information
>> zerombr
>> clearpart --all  --drives=sda
>>
>> # Disk partitioning information
>> part /boot --fstype="ext4" --size=500
>> part pv.008002 --grow --size=1
>> volgroup vg_centos --pesize=4096 pv.008002
>> logvol / --fstype=ext4 --name=lv_root --vgname=vg_centos --grow --size=1024 
>> --maxsize=51200
>> logvol swap --name=lv_swap --vgname=vg_centos --grow --size=3072 
>> --maxsize=3072
>>
>> %packages --nobase
>> @^minimal
>> @core
>> kexec-tools
>>
>> %end
>>
>> I however keep getting this error when I run it.
>>
>> => vmware-iso: Waiting for SSH to become available...
>> ==> vmware-iso: Timeout waiting for SSH.
>> ==> vmware-iso: Stopping virtual machine...
>> ==> vmware-iso: Destroying virtual machine...
>> Build 'vmware-iso' errored: Timeout waiting for SSH.
>> Why do I getting this error message? Is it because my code in the ks.cfg 
>> file to connect to a static ip address correct? Any thought would be greatly 
>> appreciated.
>>
>> --
> 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

[packer] Re: Deploying a vm with packer with a static IP

2016-09-16 Thread Rickard von Essen
I don't see that you modify /etc/sshd_config in your kickstart file to 
allow root login neither that you set roots password.

If that doesn't help run with PACKER_LOG=1 packer build template.json and 
gist the output and link here. Or if you have a console access 
(VMRC/vSphere/ESXi Embedded Host Client) login there and check if the 
network is up in the VM, you can access the outside world and check if you 
get any messages in the logs about auth fail etc.

On Friday, September 16, 2016 at 7:24:44 PM UTC+2, Rjaydee wrote:
>
> I am trying to deploy and set a vm using packer and a kickstart file. This 
> packer code:
>
> {
> "builders": [
> {
> "type": "vmware-iso",
> "format": "ovf",
> "vm_name": "PACKERTEST2",
> "iso_url": 
> "http://ftp.riken.jp/Linux/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1511.iso";,
> "iso_checksum": 
> "907e5755f824c5848b9c8efbb484f3cd945e93faa024bad6ba875226f9683b16",
> "iso_checksum_type": "sha256",
> "disk_size": "10240",
> "disk_type_id": "thin",
> "remote_host": "host",
>   "remote_datastore": "ds",
>   "remote_username": "root",
>   "remote_password": "pw",
>   "remote_type": "esx5",
> "ssh_username": "root",
> "guest_os_type": "centos-64",
> "ssh_password": "ps",
> "ssh_port": 22,
> "ssh_wait_timeout": "800s",
> "shutdown_command": "shutdown -h now",
> "headless": false,
> "floppy_files": [
>   "kickstart/ks.cfg"
> ],
> "boot_command": " linux inst.text inst.ks=hd:fd0:/ks.cfg 
> ",
> "boot_wait": "20s",
> "keep_registered": "true",
> "vmx_data": {
> "config.version": 8,
> "virtualHW.version": 8,
> "ethernet0.virtualDev": "vmxnet3",
> "ethernet0.networkName": "VM Network",
> "ethernet0.addressType": "generated",
> "ethernet0.present": "TRUE",
> "ethernet1.virtualDev": "vmxnet3",
> "ethernet1.networkName": "VLAN100",
> "ethernet1.addressType": "generated",
> "ethernet1.present": "TRUE",
> "ethernet0.pciSlotNumber": "9",
> "ethernet1.pciSlotNumber": "224",
> "memsize": "2048",
> "numvcpus": "2",
> "cpuid.coresPerSocket": "1",
> "RemoteDisplay.vnc.enabled": "TRUE",
> "RemoteDisplay.vnc.port":  "5900"
>
> }
> }
> ]
> }
>
> This is the ks.cfg file I have:
>
>
> # SELinux configuration
> selinux --enforcing
>
> # Installation logging level
> logging --level=info
>
>
> # Run the Setup Agent on first boot
> firstboot --enable
>
>  # Reboot after installation
>  reboot
>
> # System timezone
> timezone --isUtc America/Los_Angeles
> # Network information
> network --activate --bootproto=static --device=eth0 --gateway=8.1.132.254 
> --netmask=255.255.255.0 --ip= 8.1.132.18 —hostname=myhost.com
>
> # System bootloader configuration
> bootloader --append="crashkernel=auto rhgb quiet" --location=mbr 
> --driveorder="sda"
>
> # Partition clearing information
> zerombr
> clearpart --all  --drives=sda
>
> # Disk partitioning information
> part /boot --fstype="ext4" --size=500
> part pv.008002 --grow --size=1
> volgroup vg_centos --pesize=4096 pv.008002
> logvol / --fstype=ext4 --name=lv_root --vgname=vg_centos --grow --size=1024 
> --maxsize=51200
> logvol swap --name=lv_swap --vgname=vg_centos --grow --size=3072 
> --maxsize=3072
>
> %packages --nobase
> @^minimal
> @core
> kexec-tools
>
> %end
>
> I however keep getting this error when I run it.
>
> => vmware-iso: Waiting for SSH to become available...
> ==> vmware-iso: Timeout waiting for SSH.
> ==> vmware-iso: Stopping virtual machine...
> ==> vmware-iso: Destroying virtual machine...
> Build 'vmware-iso' errored: Timeout waiting for SSH.
> Why do I getting this error message? Is it because my code in the ks.cfg file 
> to connect to a static ip address correct? Any thought would be greatly 
> appreciated.
>
>

-- 
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/ed1bfb6d-466a-40f5-b37b-66440e1b09bf%40googlegroups.com.
For more options, visit https://group