Dhcp proxy seems to be working however no IP is being suggested

After selecting subnet an IP is NOT suggested.

If I enter an IP from the DHCP range the host builds properly.

If I enter ... as an IP a host builds properly.

That * method defaults to 0.0.0.0

If I then try to build a host with that IP it says its already taken. So
there must be something being communicated to the foreman-proxy

I have checked my permissions regarding foreman-proxy as well as group
rights for dhcpd.conf and lease file.

HOSTNAME: xxxxxxxx
OS: redhat
RELEASE: CentOS release 6.4 (Final)
FOREMAN: 1.3.1
RUBY: ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
PUPPET: 2.7.23

Are you sure that dhcpd.conf contains a subnet definition corresponding to
the subnet you configured in Foreman?

Any useful info from dhcpd or foreman logs?

Marco

··· On Wednesday, December 4, 2013 4:29:24 PM UTC+1, Dan Girard wrote:

After selecting subnet an IP is NOT suggested.

Hey Marco,

######DHCP.conf##########

subnet 192.168.39.0 netmask 255.255.255.0 {

— default gateway

range 192.168.39.3 192.168.39.254;
option routers 192.168.39.1;
option subnet-mask 255.255.255.0;

option domain-name "XXXXXXX";
option domain-name-servers 192.168.17.172;
option ntp-servers ntp;
filename "/pxelinux.0";
next-server 192.168.39.2;

default-lease-time 21600;
max-lease-time 43200

··· ################ As you can see there is a defined subnet definition.

Let me see if I can generate some log data to help see this through.

-DG

On Wednesday, December 4, 2013 6:12:03 PM UTC-5, zerozer...@gmail.com wrote:

On Wednesday, December 4, 2013 4:29:24 PM UTC+1, Dan Girard wrote:

After selecting subnet an IP is NOT suggested.

Are you sure that dhcpd.conf contains a subnet definition corresponding to
the subnet you configured in Foreman?

Any useful info from dhcpd or foreman logs?

Marco

> As you can see there is a defined subnet definition.
>

Yes, but my question (maybe useless, just a blind guess) was: are you sure
this subnet is the same subnet you defined in Foreman GUI (More ->
Provisioning -> Subnets)?

Also, AFAIK the "range" directive in dhcpd.conf is not required because
Foreman assigns static IPs on its own, it doesn't need to ask for a dynamic
IP from the DHCP server. I would not expect this to conflict with the
process… but I'd try removing the "range" line just to be sure ;).

> Let me see if I can generate some log data to help see this through.
>

You should have a look (or let us have a look) at dhcpd lines in
/var/log/messages and related stuff in /var/log/foreman/production.log.

Marco

··· On Friday, December 6, 2013 6:14:37 PM UTC+1, Dan Girard wrote:

Removed the range. Also made sure items in the (more -> provisioning ->
subnets) menu seem to be correct.

Same outcome… no ip is suggested. :frowning: Something is wrong here.

######## /var/log/messages
Dec 6 12:49:47 foremanbeta dhcpd: Internet Systems Consortium DHCP Server
4.1.1-P1 ###restarting dhcp after the change I also restarted foreman
and proxy
Dec 6 12:49:47 foremanbeta dhcpd: Copyright 2004-2010 Internet Systems
Consortium.
Dec 6 12:49:47 foremanbeta dhcpd: All rights reserved.
Dec 6 12:49:47 foremanbeta dhcpd: For info, please visit

Dec 6 12:49:47 foremanbeta dhcpd: Not searching LDAP since ldap-server,
ldap-port and ldap-base-dn were not specified in the config file
Dec 6 12:49:47 foremanbeta dhcpd: lease 192.168.39.4: no subnet.
Dec 6 12:49:47 foremanbeta dhcpd: lease 192.168.39.3: no subnet.
Dec 6 12:49:47 foremanbeta dhcpd: lease 192.168.39.5: no subnet.
Dec 6 12:49:47 foremanbeta dhcpd: lease 192.168.39.6: no subnet.
Dec 6 12:49:47 foremanbeta dhcpd: lease 192.168.39.7: no subnet.
Dec 6 12:49:47 foremanbeta dhcpd: lease 192.168.39.8: no subnet.
Dec 6 12:49:47 foremanbeta dhcpd: Wrote 0 leases to leases file.
Dec 6 12:49:47 foremanbeta dhcpd:
Dec 6 12:49:47 foremanbeta dhcpd: No subnet declaration for virbr0
(192.168.122.1).
Dec 6 12:49:47 foremanbeta dhcpd: ** Ignoring requests on virbr0. If this
is not what
Dec 6 12:49:47 foremanbeta dhcpd: you want, please write a subnet
declaration
Dec 6 12:49:47 foremanbeta dhcpd: in your dhcpd.conf file for the
network segment
Dec 6 12:49:47 foremanbeta dhcpd: to which interface virbr0 is
attached. **
Dec 6 12:49:47 foremanbeta dhcpd:
Dec 6 12:49:47 foremanbeta dhcpd: Listening on LPF/eth0/00:50:56:ac:01:8c/
192.168.39.0/24
Dec 6 12:49:47 foremanbeta dhcpd: Sending on LPF/eth0/00:50:56:ac:01:8c/
192.168.39.0/24
Dec 6 12:49:47 foremanbeta dhcpd: Sending on Socket/fallback/fallback-net

############snippet of production.log
Started GET "/hosts" for 192.168.17.139 at 2013-12-06 12:53:10 -0500
Processing by HostsController#index as HTML
Rendered hosts/_list.html.erb (546.4ms)
Rendered hosts/index.html.erb within layouts/application (628.0ms)
Rendered home/_user_dropdown.html.erb (4.4ms)
Read fragment views/tabs_and_title_records-2 (0.1ms)
Rendered home/_org_switcher.html.erb (0.4ms)
Rendered home/_settings.html.erb (7.5ms)
Write fragment views/tabs_and_title_records-2 (0.8ms)
Rendered home/_topbar.html.erb (14.9ms)
Rendered common/_searchbar.html.erb (17.1ms)
Completed 200 OK in 1281ms (Views: 749.4ms | ActiveRecord: 18.7ms)

Started GET "/hosts/new" for 192.168.17.139 at 2013-12-06 12:53:35 -0500
Processing by HostsController#new as HTML
Rendered hosts/_progress.html.erb (0.5ms)
Rendered common/_domain.html.erb (2.1ms)
Rendered hosts/_interfaces.html.erb (8.5ms)
Rendered common/os_selection/_architecture.html.erb (2.5ms)
Rendered common/os_selection/_operatingsystem.html.erb (3.7ms)
Rendered hosts/_operating_system.html.erb (98.8ms)
Rendered hosts/_unattended.html.erb (148.8ms)
Rendered puppetclasses/_class_parameters.html.erb (0.0ms)
Rendered puppetclasses/_classes_parameters.html.erb (9.8ms)
Rendered common_parameters/_inherited_parameters.html.erb (0.8ms)
Rendered common_parameters/_puppetclass_parameter.html.erb (3.0ms)
Rendered common_parameters/_puppetclasses_parameters.html.erb (14.4ms)
Rendered common_parameters/_parameter.html.erb (2.1ms)
Rendered common_parameters/_parameters.html.erb (27.3ms)
Rendered hosts/_form.html.erb (342.1ms)
Rendered hosts/new.html.erb within layouts/application (343.2ms)
Rendered home/_user_dropdown.html.erb (1.1ms)
Read fragment views/tabs_and_title_records-2 (0.1ms)
Rendered home/_topbar.html.erb (1.4ms)
Completed 200 OK in 354ms (Views: 332.0ms | ActiveRecord: 16.8ms)

Started POST "/hosts/process_hostgroup" for 192.168.17.139 at 2013-12-06
12:53:41 -0500
Processing by HostsController#process_hostgroup as /
Parameters: {"utf8"=>"✓",
"authenticity_token"=>"B2GmE/SeG5HnuhkFniKvdmB4L9PnYQcFDs8MyI3JFQ8=",
"host"=>{"name"=>"testnode", "hostgroup_id"=>"2",
"compute_resource_id"=>"", "environment_id"=>"", "puppet_ca_proxy_id"=>"",
"puppet_proxy_id"=>"", "managed"=>"true",
"progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", "mac"=>"",
"domain_id"=>"", "ip"=>"",
"interfaces_attributes"=>{"new_interfaces"=>{"_destroy"=>"false",
"type"=>"Nic::Managed", "mac"=>"", "name"=>"", "domain_id"=>"", "ip"=>"",
"provider"=>"IPMI"}}, "architecture_id"=>"", "provision_method"=>"build",
"build"=>"1", "disk"=>"", "root_pass"=>"[FILTERED]", "is_owned_by"=>"",
"enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}}
Rendered hosts/_progress.html.erb (0.4ms)
Rendered puppetclasses/_selectedClasses.html.erb (0.0ms)
Rendered puppetclasses/_classes.html.erb (3.3ms)
Rendered puppetclasses/_class_selection.html.erb (16.8ms)
Rendered common/_domain.html.erb (8.7ms)
Rendered hosts/_interfaces.html.erb (7.8ms)
Rendered common/os_selection/_architecture.html.erb (6.0ms)
Rendered common/os_selection/_operatingsystem.html.erb (8.8ms)
Rendered hosts/_operating_system.html.erb (102.4ms)
Rendered hosts/_unattended.html.erb (129.3ms)
Rendered puppetclasses/_class_parameters.html.erb (0.0ms)
Rendered puppetclasses/_classes_parameters.html.erb (5.4ms)
Rendered common_parameters/_inherited_parameters.html.erb (0.8ms)
Rendered common_parameters/_puppetclass_parameter.html.erb (2.8ms)
Rendered common_parameters/_puppetclasses_parameters.html.erb (6.1ms)
Rendered common_parameters/_parameter.html.erb (2.0ms)
Rendered common_parameters/_parameters.html.erb (5.6ms)
Rendered hosts/_form.html.erb (209.9ms)
Completed 200 OK in 291ms (Views: 199.8ms | ActiveRecord: 18.7ms)

Started POST "/subnets/freeip" for 192.168.17.139 at 2013-12-06 12:53:41
-0500
Processing by SubnetsController#freeip as /
Parameters: {"subnet_id"=>"1", "host_mac"=>""}
Failed to fetch a free IP from our proxy: 404 Resource Not Found: Subnet
192.168.39.3 not found
Completed 200 OK in 137ms (ActiveRecord: 1.6ms)

Started POST "/hosts/compute_resource_selected" for 192.168.17.139 at
2013-12-06 12:53:44 -0500
Processing by HostsController#compute_resource_selected as /
Parameters: {"utf8"=>"✓",
"authenticity_token"=>"B2GmE/SeG5HnuhkFniKvdmB4L9PnYQcFDs8MyI3JFQ8=",
"host"=>{"name"=>"testnode", "hostgroup_id"=>"2",
"compute_resource_id"=>"1", "environment_id"=>"1",
"puppet_ca_proxy_id"=>"1", "puppet_proxy_id"=>"1", "puppetclass_ids"=>[""],
"managed"=>"true", "progress_report_id"=>"[FILTERED]",
"type"=>"Host::Managed", "mac"=>"", "domain_id"=>"1", "subnet_id"=>"1",
"ip"=>"", "interfaces_attributes"=>{"new_interfaces"=>{"_destroy"=>"false",
"type"=>"Nic::Managed", "mac"=>"", "name"=>"", "domain_id"=>"", "ip"=>"",
"provider"=>"IPMI"}}, "architecture_id"=>"1", "operatingsystem_id"=>"1",
"provision_method"=>"build", "build"=>"1", "medium_id"=>"1",
"ptable_id"=>"1", "disk"=>"", "root_pass"=>"[FILTERED]", "is_owned_by"=>"",
"enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}}
Rendered compute_resources_vms/form/vmware/_network.html.erb (57.6ms)
Rendered compute_resources_vms/form/vmware/_network.html.erb (55.7ms)
Rendered compute_resources_vms/form/vmware/_volume.html.erb (335.1ms)
Rendered compute_resources_vms/form/vmware/_volume.html.erb (254.9ms)
Rendered compute_resources_vms/form/_vmware.html.erb (1443.6ms)
Rendered hosts/_compute.html.erb (2064.5ms)
Completed 200 OK in 2072ms (Views: 2066.1ms | ActiveRecord: 1.2ms)

Started GET
"/compute_resources/1/images?search=operatingsystem%3D1%20architecture%3D1"
for 192.168.17.139 at 2013-12-06 12:53:46 -0500
Processing by ImagesController#index as JSON
Parameters: {"search"=>"operatingsystem=1 architecture=1",
"compute_resource_id"=>"1"}
Completed 200 OK in 11ms (Views: 2.6ms | ActiveRecord: 1.9ms)

Started POST "/subnets/freeip" for 192.168.17.139 at 2013-12-06 12:53:51
-0500
Processing by SubnetsController#freeip as /
Parameters: {"subnet_id"=>"1", "host_mac"=>""}
Failed to fetch a free IP from our proxy: 404 Resource Not Found: Subnet
192.168.39.3 not found
Completed 200 OK in 116ms (ActiveRecord: 0.8ms)

··· On Fri, Dec 6, 2013 at 12:27 PM, wrote:

On Friday, December 6, 2013 6:14:37 PM UTC+1, Dan Girard wrote:

As you can see there is a defined subnet definition.

Yes, but my question (maybe useless, just a blind guess) was: are you sure
this subnet is the same subnet you defined in Foreman GUI (More →
Provisioning → Subnets)?

Also, AFAIK the “range” directive in dhcpd.conf is not required because
Foreman assigns static IPs on its own, it doesn’t need to ask for a dynamic
IP from the DHCP server. I would not expect this to conflict with the
process… but I’d try removing the “range” line just to be sure ;).

Let me see if I can generate some log data to help see this through.

You should have a look (or let us have a look) at dhcpd lines in
/var/log/messages and related stuff in /var/log/foreman/production.log.

Marco


You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/foreman-users/mDSwmj__l_A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/groups/opt_out.

-DG
<— He works out.

Something is wrong with the proxy, check it's logs and configuration.

··· On 6 December 2013 17:56, Daniel Girard wrote: > > Failed to fetch a free IP from our proxy: 404 Resource Not Found: Subnet > 192.168.39.3 not found >

(smacks head)

E, [2013-12-06T13:40:39.062620 #1735] ERROR – : Subnet 192.168.39.3 not
found
D, [2013-12-06T13:47:52.347420 #1735] DEBUG – : Reading config file
/etc/dhcp/dhcpd.conf

/etc/dhcp/dhcpd.conf had the subnet listed as 192.168.39.0

Fixed that … and we are in business.

Any chance you know how to manually remove a host in foreman from ever
existing?

··· On Fri, Dec 6, 2013 at 2:30 PM, Greg Sutcliffe wrote:

On 6 December 2013 17:56, Daniel Girard shdobxr@gmail.com wrote:

Failed to fetch a free IP from our proxy: 404 Resource Not Found: Subnet
192.168.39.3 not found

Something is wrong with the proxy, check it’s logs and configuration.


You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/foreman-users/mDSwmj__l_A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/groups/opt_out.

-DG
<— He works out.

What do you mean?
When you remove the host in Foreman GUI also the IP reservation in DHCP
config should be automatically deleted.

Marco

··· On Friday, December 6, 2013 8:40:36 PM UTC+1, Dan Girard wrote:

Any chance you know how to manually remove a host in foreman from ever
existing?

So…

The environment on one network works fine. I am able to build and remove
hosts from the VMware cluster. I took the built foreman environment.

Converted it to an OVF/OVA to deploy on another airgapped network. After I
redeployed on that target network, I was unable to remove the hosts simply
due to no comms being able to be made to the vcenter which doesn't exist on
that network. I was wondering if there was a specific method on the foreman
host (probably via linux/postgresql… maybe even hammer-cli) to
effectively remove traces of an old host or compute resources as well.

··· On Mon, Dec 9, 2013 at 4:41 AM, wrote:

On Friday, December 6, 2013 8:40:36 PM UTC+1, Dan Girard wrote:

Any chance you know how to manually remove a host in foreman from ever
existing?

What do you mean?
When you remove the host in Foreman GUI also the IP reservation in DHCP
config should be automatically deleted.

Marco


You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/foreman-users/mDSwmj__l_A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/groups/opt_out.

-DG
<— He works out.