Hi Kyle, It was very good information which you mentioned here regarding dhcp.lease, I have one query for that, Did you automate to migrate the lease information from cobbler to smproxy host? My configuration for smproxy is working fine but not able to migrate the existing host list (dhcp.lease) to smproxy server. Is there any way to migrate the dhcp lease info ? I have tried manually to update the few host info on foreman and it worked but we have 700+ hosts, Let me know if you have any information on it.
On Friday, January 15, 2016 at 10:51:18 PM UTC+5:30, Kyle Flavin wrote: > > > > On Friday, January 15, 2016 at 1:47:10 AM UTC-8, Greg Sutcliffe wrote: >> >> On 14 January 2016 at 18:35, Kyle Flavin <[email protected]> wrote: >> >> I watched your rebuild video yesterday - it's exactly what I need, >>> unfortunately I won't be able to upgrade from 1.9.3 right away. How can I >>> achieve the same result through the rails console? That might be the way >>> to go. I have a large number of hosts I'll be moving over, and none of >>> them will exist in the leases file, initially. >>> >>> I tried changing the IP on the host's NIC, and then flipping it back to >>> the original IP. It worked. So I'm thinking about trying the following as >>> a workaround, until we can get to 1.10: >>> >>> *Initially:* >>> 1) Add a bogus subnet to Foreman. (no DHCP or DNS proxy defined) >>> >>> *When building a host:* >>> 1) change the IP on the host's NIC to an IP on the bogus subnet, and >>> uncheck "managed" box (unchecking the box may not be necessary since there >>> is no DNS proxy on the bogus subnet?) >>> 2) change the IP on the host's NIC back to the original IP, and check >>> "managed" box. >>> >>> I want to update the DHCP record, without changing the DNS. I'll have >>> to document this for our operators who perform regular builds, so I'm >>> trying to make it as simple as possible: >>> >> >> Is the DNS "wrong" then? What's the rationale behind not updating DNS? I >> ask because the easy ways to rebuild the lease file involve triggering all >> the orchestration (DNS/DHCP/TFTP) rather than trying to pick out a single >> pice of it. If that's acceptable, then you can rebuild the leases file for >> all the hosts in pretty much one command on the Rails console. If not, then >> you'll need to do something more complex. >> > >> >> > >> For reference, here's an outdated but still broadly accurate blog post on >> recovering DHCP leases - >> http://theforeman.org/2012/01/recovering-lost-dhcp-reservations.html >> > > >> >> >> Cheers, >> Greg >> > > The DNS is correct. The issue is we're migrating from another > provisioning system to Foreman, so there are no DHCP lease entries at the > moment. I'll have to create them somehow. I can do this by changing the > IP on the host record in Foreman to something bogus, and then back to the > real IP again. This adds the lease, but it also changes DNS (twice - when > I change to the bogus IP, and when I switch it back to the real IP), and > since I'm only trying to get a lease record created, the DNS change is an > unwanted side effect. It looks like it doesn't do this when I uncheck the > "Managed" checkbox on the NIC when switching to the bogus IP. This method > would require a little extra work on the part of the operators when doing a > new build. > > I've also thought about scripting the creation of the leases file. But I > want to avoid running a script in our production environment that will > cause thousands of servers to flip their DNS, however brief that may be. > In the scenario above, where the operator flips the IP to initiate the > lease, a brief DNS change probably isn't a big deal, since the server is > being rebuilt anyway. > > I've also thought about writing a shell script to create the dhcpd.leases > file from scratch, and bypass the Foreman orchestration entirely. If I'm > looking to automate, it seems like this might have the fewest potential > side effects. > -- You received this message because you are subscribed to the Google Groups "Foreman users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/foreman-users. For more options, visit https://groups.google.com/d/optout.
