Skip to main content

AWS Hostname Not Preserved

Comments

14 comments

  • cPanelMichael
    Hello Martin, Here's what I see for Step 9 of our
    0
  • ContinuIT
    This is what I see. It lets me select xlarge from the dropdown, but on the top it says small. After I launched last time, it created an small instance.
    0
  • ContinuIT
    Well, I will be dammed. It created an xlarge this time! Now it is time to set a hostname and make sure it doesn't change on reboot. I have already connected with Putty and changed the root password I run the command printf 'preserve_hostname: true\nmanage_etc_hosts: false\n' > /etc/cloud/cloud.cfg.d/99-preserve-hostname.cfg and it creates the file 99-preserve-hostname.cfg as an empty file I found about 3 different methods of setting the hostname and making it stick, none of them worked on the previous instance. Can you send me to a resource that you know it works so I can follow? Right now, the hostname is in the form or ip-999-999-999-999.ec2.internal thanks!
    0
  • cPanelMichael
    Now it is time to set a hostname and make sure it doesn't change on reboot. I have already connected with Putty and changed the root password I run the command printf 'preserve_hostname: true\nmanage_etc_hosts: false\n' > /etc/cloud/cloud.cfg.d/99-preserve-hostname.cfg and it creates the file 99-preserve-hostname.cfg as an empty file

    Hello Martin, I ran the same command on a test system and it successfully populated the file: # printf 'preserve_hostname: true\nmanage_etc_hosts: false\n' > /etc/cloud/cloud.cfg.d/99-preserve-hostname.cfg # cat /etc/cloud/cloud.cfg.d/99-preserve-hostname.cfg preserve_hostname: true manage_etc_hosts: false
    Can you verify that you are running that command while logged in via SSH as the root user? If so, try adding those two lines to the empty file using a command-line text editor such as vi. For example, open the file with the command below: vi /etc/cloud/cloud.cfg.d/99-preserve-hostname.cfg
    Then, paste the following two lines (type "i" and paste the lines below) to this file and save (type :x and press enter): preserve_hostname: true manage_etc_hosts: false
    Let me know if this helps. Thank you.
    0
  • ContinuIT
    Ok, that worked. Again, this didn't work before (same command), but I am not understanding why yet. So, now edit /etc/sysconfig/network and change hostname to the public dns name of the server. reboot. verify hostname still the same. Correct?
    0
  • ContinuIT
    Well, that didn't work. After editing /network and rebooting, hostname still the ec2 assigned hostname
    0
  • ContinuIT
    I am following this information Changing the Hostname of Your Linux Instance - Amazon Elastic Compute Cloud for the Linux AMI. I have not started whm yet (accessed it).
    0
  • ContinuIT
    I executed # hostname host.domain.com # hostname host.domain.com # nano /etc/sysconfig/network networking=yes hostname=host.domain.com domainname=domain.com saved and exit reboot hostname is back to xxxxxx.ec2.internal confirmed that values on 99-preserve-hostname.cfg are still there, they are.
    0
  • cPanelMichael
    Hello Martin, Thanks for sharing the additional details. It looks there's an issue where our /usr/local/bin/cpanel-cloud-prepare script is unable to exit cleanly. This results in a reset to the default Amazon hostname upon a reboot (despite the use of the recommended /etc/cloud/cloud.cfg.d/99-preserve-hostname.cfg file). We are planning to publish an updated AMI on the AWS marketplace to address this issue within the next week. I'll update this thread as soon as it's published. In the meantime, the temporary workaround is to run the following command after customizing the hostname: touch /usr/local/cpanel/.cloud-ready
    This will ensure the /usr/local/bin/cpanel-cloud-prepare script does not run each time the server boots. Thank you.
    0
  • ContinuIT
    That didn't work. I executed # hostname host.domain.com # hostname host.domain.com # nano /etc/sysconfig/network networking=yes hostname=host.domain.com domainname=domain.com saved and exit # touch /usr/local/cpanel/.cloud-ready # reboot hostname is back to xxxxxx.ec2.internal
    0
  • cPanelMichael
    Can you open a
    0
  • ContinuIT
    Hum, I don't have access to the system yet to get the support id code. How do we do this? From what I read, if I open the whm system then I have to go through the setup wizard, changing the host is a problem later and the license may get screwed up.
    0
  • ContinuIT
    I managed, but couldn't provide access to the server Here is the support case Your Support Request ID is: 11716513
    0
  • cPanelMichael
    Hello Martin, I see your ticket is still open at this time as we continue to diagnose issues related to the use of cPanel & WHM on AWS. I just wanted to follow-up to let you know I'm still monitoring the support ticket and I'll follow-up again once it's closed to make sure everything is working as it should (or a case is opened to address an issue if something isn't working the way it should). Reports like yours are very helpful in helping us improve the experience for server administrators setting up cPanel & WHM instances on AWS. Thank you.
    0

Please sign in to leave a comment.