Skip to Content

Change Hostname on SUSE SLES for SAP Installations on AWS

SAP systems require hostnames which aren't longer than 13 characters. The default AWS naming schema is to use the IP address separated with dashes to create hostnames. This naming schema can lead to host names with are to long for SAP installations.

The fix is based on the following assumptions:

  • The SAP system is being operated in a VPC with it's network interface
  • The IP address is a private one.
  • No DNS or NIS naming in the clients have to be used

The following procedure renames a system to node1

SLES 11

  1. Change the content of file /etc/HOSTNAME to node1. This entry will be used to set the host name in future reboots
  2. Edit the file /etc/cloud/cloud.cfg
    1. Modify the line preserve_hostname: false to preserve_hostname: true . This entry will be used in the next reboot to determine whether the hostname should be left as it is.
  3. Edit the file /etc/hosts
    1. Add node1 to the primary IP address like in this example "10.79.7.92 ip-10-79-7-92 node1"
  4. Set the host name with the command "# hostname node1". This command performs a dynamic change. It's effect will not last beyond a reboot.
  5. Configure the DHCP client not to configure the hostname
    1. Enter the command yast
    2. Move in selection list to Network Devices and select it
    3. Move in selection list to Network Settings and select it
    4. Move to entry Hostname/DNS and select it
    5. set hostname to node1 in the host name field
    6. deselect (remove x) from the entry set hostname dynamically
    7. Save all settings and leave yast

SLES 12

  1. Change the content of file /etc/HOSTNAME to node1. This entry will be used to set the host name in future reboots
  2. Edit the file /etc/cloud/cloud.cfg
    1. Modify the line preserve_hostname: false to preserve_hostname: true . This entry will be used in the next reboot to determine whether the hostname should be left as it is.
  3. Edit the file /etc/hosts
    1. Add node1 to the primary IP address like in this example "10.79.7.92 ip-10-79-7-92 node1"
  4. Set the host name with the command "# hostname node1". This command performs a dynamic change. It's effect will not last beyond a reboot.
  5. Configure the DHCP client not to configure the hostname
    1. Enter the command yast
    2. Move in selection list to System and select it
    3. Move in selection list to Network Settings and select it
    4. Move to entry Hostname/DNS and select it
    5. set hostname to node1 in the host name field
    6. deselect (remove x) from the entry change hostname via DHCP
    7. Use the Run option to execute the command
    8. Save all settings and leave yast

 



book | by Dr. Radut