Foreman with vmware template

I can deploy vm from foreman using template only when the template in
vmware is using the static ip and the ip mtches the one that I'm going to
create. I want to able to deploy the vm using vmware template, where I can
specify which IP to use, which Network Interface to go, and all. How's that
possible? Any Ideas?? Thanks in Advance

I thought all those options could be filled out on the "new host" page.
configured, and select it when you create a new host.

··· From my experience, you need to have the vmware compute resource

On Wednesday, September 17, 2014 9:37:10 AM UTC-7, huhm4n wrote:

I can deploy vm from foreman using template only when the template in
vmware is using the static ip and the ip mtches the one that I’m going to
create. I want to able to deploy the vm using vmware template, where I can
specify which IP to use, which Network Interface to go, and all. How’s that
possible? Any Ideas?? Thanks in Advance

I have this configured. I have the template as image. But the template I
have in vmware has the static ip, and when the vm is up, it will have the
same hostname and ip as the template. What should I do in foreman to change
that?

··· On Wednesday, September 17, 2014 10:47:21 AM UTC-7, Jordan Lin wrote: > > I thought all those options could be filled out on the "new host" page. > From my experience, you need to have the vmware compute resource > configured, and select it when you create a new host. > > On Wednesday, September 17, 2014 9:37:10 AM UTC-7, huhm4n wrote: >> >> I can deploy vm from foreman using template only when the template in >> vmware is using the static ip and the ip mtches the one that I'm going to >> create. I want to able to deploy the vm using vmware template, where I can >> specify which IP to use, which Network Interface to go, and all. How's that >> possible? Any Ideas?? Thanks in Advance >> >

Hello Huhm4n

Were you able to fix this issue ? I am also getting same problem , New host
comes up with IP/hostname specified in template.

Regards
Anirudh

··· On Thursday, September 18, 2014 at 9:26:59 PM UTC+5:30, huhm4n wrote: > > I have this configured. I have the template as image. But the template I > have in vmware has the static ip, and when the vm is up, it will have the > same hostname and ip as the template. What should I do in foreman to change > that? > > On Wednesday, September 17, 2014 10:47:21 AM UTC-7, Jordan Lin wrote: >> >> I thought all those options could be filled out on the "new host" page. >> From my experience, you need to have the vmware compute resource >> configured, and select it when you create a new host. >> >> On Wednesday, September 17, 2014 9:37:10 AM UTC-7, huhm4n wrote: >>> >>> I can deploy vm from foreman using template only when the template in >>> vmware is using the static ip and the ip mtches the one that I'm going to >>> create. I want to able to deploy the vm using vmware template, where I can >>> specify which IP to use, which Network Interface to go, and all. How's that >>> possible? Any Ideas?? Thanks in Advance >>> >>

You need to configure

In VMWARE

  • the template, i assume you have it

in the template you need to have

  • open-vm-tools install
  • ssh host keys cleaned out
  • keys and certs for puppet clean out

in foreman you need to have

  • the compute resource
  • the image
  • the compute profile
  • the subnet
  • the provisioinng profile

a provisioning template must include something like this

··· ---- identity: LinuxPrep: domain: <%= @host.domain %> hostName: <%= @host.shortname %> hwClockUTC: true timeZone: Europe/Berlin

globalIPSettings:
dnsSuffixList:
- <%= @host.domain %>
dnsServerList:
- <%= @host.subnet.dns_primary %>

nicSettingMap:
<% @host.interfaces.each do |interface| %>

  • adapter:
    dnsDomain: <%= interface.domain %>
    dnsServerList:
    - <%= interface.subnet.dns_primary %>
    ip: <%= interface.ip %>
    subnetMask: <%= interface.subnet.mask %>
    gateway:
    - <%= interface.subnet.gateway %>

fqdn: <%= @host %>
manage_etc_hosts: true


then the foreman provides the IP address to VMWare and using the
open-vm-tools, the IP is injected into the machine similar to cloud-init
behaviour

We have that running with CentOS and Ubuntu - but not with Debian ( look at
my post “Debian GNU/Linux 8 missing”)

Cheers
Soeren

The host attributes in Foreman are applied via a customization spec.
Have a look at the support matrix to see if you are using a supported Guest
OS + vCenter
combination: http://partnerweb.vmware.com/programs/guestOS/guest-os-customization-matrix.pdf

··· On Wednesday, August 31, 2016 at 5:02:25 PM UTC+10, Anirudh T wrote: > > Hello Huhm4n > > Were you able to fix this issue ? I am also getting same problem , New > host comes up with IP/hostname specified in template. > > Regards > Anirudh > > On Thursday, September 18, 2014 at 9:26:59 PM UTC+5:30, huhm4n wrote: >> >> I have this configured. I have the template as image. But the template I >> have in vmware has the static ip, and when the vm is up, it will have the >> same hostname and ip as the template. What should I do in foreman to change >> that? >> >> On Wednesday, September 17, 2014 10:47:21 AM UTC-7, Jordan Lin wrote: >>> >>> I thought all those options could be filled out on the "new host" page. >>> From my experience, you need to have the vmware compute resource >>> configured, and select it when you create a new host. >>> >>> On Wednesday, September 17, 2014 9:37:10 AM UTC-7, huhm4n wrote: >>>> >>>> I can deploy vm from foreman using template only when the template in >>>> vmware is using the static ip and the ip mtches the one that I'm going to >>>> create. I want to able to deploy the vm using vmware template, where I can >>>> specify which IP to use, which Network Interface to go, and all. How's that >>>> possible? Any Ideas?? Thanks in Advance >>>> >>>

Thank you very much guys, i created Userdata template as mentioned and it
worked. Initially i tried with finish scripts + SSH but it use to hang.
But now i am using userdata template without ssh and its working.

··· On Wednesday, August 31, 2016 at 5:21:17 PM UTC+5:30, mso wrote: > > You need to configure > > In VMWARE > > - the template, i assume you have it > > in the template you need to have > > - open-vm-tools install > - ssh host keys cleaned out > - keys and certs for puppet clean out > > in foreman you need to have > > - the compute resource > - the image > - the compute profile > - the subnet > - the provisioinng profile > > a provisioning template must include something like this > > ---- > identity: > LinuxPrep: > domain: <%= @host.domain %> > hostName: <%= @host.shortname %> > hwClockUTC: true > timeZone: Europe/Berlin > > globalIPSettings: > dnsSuffixList: > - <%= @host.domain %> > dnsServerList: > - <%= @host.subnet.dns_primary %> > > nicSettingMap: > <% @host.interfaces.each do |interface| %> > - adapter: > dnsDomain: <%= interface.domain %> > dnsServerList: > - <%= interface.subnet.dns_primary %> > ip: <%= interface.ip %> > subnetMask: <%= interface.subnet.mask %> > gateway: > - <%= interface.subnet.gateway %> > > fqdn: <%= @host %> > manage_etc_hosts: true > > ---- > > then the foreman provides the IP address to VMWare and using the > open-vm-tools, the IP is injected into the machine similar to cloud-init > behaviour > > We have that running with CentOS and Ubuntu - but not with Debian ( look > at my post "Debian GNU/Linux 8 missing") > > > Cheers > Soeren > > > >