Uploaded image for project: 'CloudStack'
  1. CloudStack
  2. CLOUDSTACK-3186

Duplicate entries in /etc/hosts file on VR after reboot

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 4.2.0
    • 4.4.3
    • Management Server
    • Security Level: Public (Anyone can view this level - this is the default.)
    • None
    • Latest build from master6-17-statble branch

    Description

      /etc/hosts file on VR contains the IP address to Host Name mappings.
      In 4.2 we have introduced a new entry called "data-server" and mapped to Router VMs eth0 interface ip address. This is for the guest vms to access user-data and ssh-keys from the Router VM.
      Please refer to bug https://issues.apache.org/jira/browse/CLOUDSTACK-2644 for more info.
      Making this entry in the hosts file is part of cloud-early-config file and every time a router is rebooted new entry would be made to the hosts file.
      If the router reboots multiple times for some reason, we see lot of duplicate entries in the hosts file.

      Following is the contents from /etc/hosts file from VR which was rebooted for multiple times:
      127.0.0.1 localhost

      1. The following lines are desirable for IPv6 capable hosts
        ::1 localhost ip6-localhost ip6-loopback
        ff02::1 ip6-allnodes
        ff02::2 ip6-allrouters
        10.147.43.6 data-server
        10.147.43.6 r-4-VM
        10.147.43.6 data-server
        10.147.43.6 r-4-VM
        10.147.43.6 data-server
        10.147.43.6 r-4-VM
        10.147.43.5 s1
        10.147.43.7 s1-passwd
        10.147.43.10 addaf9b0-bdbc-4c4a-80ed-67664ad781e0
        10.147.43.8 3b2804dd-225d-4cf3-bcdc-fed468c61192
        10.147.43.130 s2
        10.147.43.132 0e0df8e6-2c0f-455b-8571-b5f6a0dbd44e
        10.147.43.133 s2-passwd
        10.147.43.134 bf2e0e55-a2c9-4d26-a489-b8d8aa596350

      It would be good to check for the entries present in the file before appending to it and avoid duplicate entries.

      Attachments

        Activity

          People

            yasker Sheng Yang
            sanjeevn Sanjeev N
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: