lago icon indicating copy to clipboard operation
lago copied to clipboard

Add only predefined dns records to exported init file

Open gbenhaim opened this issue 7 years ago • 4 comments

Currently we add all the records that a network has to the exported init file. This set of records might be incorrect in environment using DHCP. We need to add to the exported init file only the records that was manually added by the user (in the original init file).

gbenhaim avatar Apr 27 '17 14:04 gbenhaim

for example:

  lago-demo-suite-4-1-net-management:
    dhcp: {end: 254, start: 100}
    dns_domain_name: lago.local
    dns_records: {lago-demo-suite-4-1-engine: 192.168.220.2, lago-demo-suite-4-1-engine-eth0: 192.168.220.2,
      lago-demo-suite-4-1-engine-eth1: 192.168.222.2, lago-demo-suite-4-1-engine-lago-demo-suite-4-1-net-management: 192.168.220.2,
      lago-demo-suite-4-1-engine-lago-demo-suite-4-1-net-management-0: 192.168.220.2,
      lago-demo-suite-4-1-engine-lago-demo-suite-4-1-net-storage: 192.168.222.2, lago-demo-suite-4-1-engine-lago-demo-suite-4-1-net-storage-0: 192.168.222.2,
      lago-demo-suite-4-1-host0: 192.168.220.3, lago-demo-suite-4-1-host0-eth0: 192.168.220.3,
      lago-demo-suite-4-1-host0-eth1: 192.168.222.3, lago-demo-suite-4-1-host0-eth2: 192.168.221.4,
      lago-demo-suite-4-1-host0-eth3: 192.168.221.5, lago-demo-suite-4-1-host0-lago-demo-suite-4-1-net-bonding: 192.168.221.4,
      lago-demo-suite-4-1-host0-lago-demo-suite-4-1-net-bonding-0: 192.168.221.4,
      lago-demo-suite-4-1-host0-lago-demo-suite-4-1-net-bonding-1: 192.168.221.5,
      lago-demo-suite-4-1-host0-lago-demo-suite-4-1-net-management: 192.168.220.3,
      lago-demo-suite-4-1-host0-lago-demo-suite-4-1-net-management-0: 192.168.220.3,
      lago-demo-suite-4-1-host0-lago-demo-suite-4-1-net-storage: 192.168.222.3, lago-demo-suite-4-1-host0-lago-demo-suite-4-1-net-storage-0: 192.168.222.3,
      lago-demo-suite-4-1-host1: 192.168.220.4, lago-demo-suite-4-1-host1-eth0: 192.168.220.4,
      lago-demo-suite-4-1-host1-eth1: 192.168.222.4, lago-demo-suite-4-1-host1-eth2: 192.168.221.6,
      lago-demo-suite-4-1-host1-eth3: 192.168.221.7, lago-demo-suite-4-1-host1-lago-demo-suite-4-1-net-bonding: 192.168.221.6,
      lago-demo-suite-4-1-host1-lago-demo-suite-4-1-net-bonding-0: 192.168.221.6,
      lago-demo-suite-4-1-host1-lago-demo-suite-4-1-net-bonding-1: 192.168.221.7,
      lago-demo-suite-4-1-host1-lago-demo-suite-4-1-net-management: 192.168.220.4,
      lago-demo-suite-4-1-host1-lago-demo-suite-4-1-net-management-0: 192.168.220.4,
      lago-demo-suite-4-1-host1-lago-demo-suite-4-1-net-storage: 192.168.222.4, lago-demo-suite-4-1-host1-lago-demo-suite-4-1-net-storage-0: 192.168.222.4}
    gw: 192.168.220.1

gbenhaim avatar Apr 27 '17 16:04 gbenhaim

Thanks for the fix. Do you remember why did we filter mapping when exporting the init file? I mean it should make sense to keep the exact same DHCP/IPs allocation configuration when exporting the environment(and then the DNS records should be the same also), though I might be missing something.

nvgoldin avatar Apr 27 '17 19:04 nvgoldin

We removed the mapping from the exported init file in order to be consistent with user generated init file. Currently, If we want to reserve an ip address for a domain, we should do it in the domain definition, not in the network definition.

gbenhaim avatar Apr 30 '17 07:04 gbenhaim

Right, thanks. I guess the two "layers" collide here. When a user creates an environment and relays on the DNS records generated in the network, if he used hostnames only - theoretically it should work also in the exported environment. If he used the hostnames to deduce IPs, then it might fail in the exported environment. We could say it is "at your own risk" if you don't put fixed IPs.

Regarding user defined 'dns_records' in the init file - will need to fix.

nvgoldin avatar Apr 30 '17 07:04 nvgoldin