Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

AWS Hostname Not Preserved

Discussion in 'General Discussion' started by ContinuIT, Mar 19, 2019.

Tags:
  1. ContinuIT

    ContinuIT Member

    Joined:
    Mar 9, 2019
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ijamsville, MD
    cPanel Access Level:
    Root Administrator
    Hello
    I've been trying to start a subscription in AWS using at t3.xlarge configuration, but when I get to configure this software it always shows t3.xsmall. It doesn't matter what I select.
    After creating the VM, I have no way to increase its resources (not a cpanel problem obviously), and after the machine is created I cannot change the host name of the server regardless the procedure I follow (I have read all documentation I was able to find in this regard). Has anyone else had this sort of problem? Anyone that has successfully started a hosting environment in AWS that can share his/her experience?
    Thanks!!!

    Martin
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,528
    Likes Received:
    2,180
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello Martin,

    Here's what I see for Step 9 of our Launch an AWS AMI Instance document:

    instance-type1.png instance-type2.png

    As you can see, multiple instance types are available (including t3.xlarge). Can you share a screenshot of what appears when you reach this step?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. ContinuIT

    ContinuIT Member

    Joined:
    Mar 9, 2019
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ijamsville, MD
    cPanel Access Level:
    Root Administrator
    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.
     

    Attached Files:

  4. ContinuIT

    ContinuIT Member

    Joined:
    Mar 9, 2019
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ijamsville, MD
    cPanel Access Level:
    Root Administrator
    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!
     
  5. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,528
    Likes Received:
    2,180
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello Martin,

    I ran the same command on a test system and it successfully populated the file:

    Code:
    # 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:

    Code:
    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):

    Code:
    preserve_hostname: true
    manage_etc_hosts: false
    Let me know if this helps.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. ContinuIT

    ContinuIT Member

    Joined:
    Mar 9, 2019
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ijamsville, MD
    cPanel Access Level:
    Root Administrator
    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?
     
  7. ContinuIT

    ContinuIT Member

    Joined:
    Mar 9, 2019
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ijamsville, MD
    cPanel Access Level:
    Root Administrator
    Well, that didn't work. After editing /network and rebooting, hostname still the ec2 assigned hostname
     
  8. ContinuIT

    ContinuIT Member

    Joined:
    Mar 9, 2019
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ijamsville, MD
    cPanel Access Level:
    Root Administrator
  9. ContinuIT

    ContinuIT Member

    Joined:
    Mar 9, 2019
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ijamsville, MD
    cPanel Access Level:
    Root Administrator
    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.
     
  10. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,528
    Likes Received:
    2,180
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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:

    Code:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. ContinuIT

    ContinuIT Member

    Joined:
    Mar 9, 2019
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ijamsville, MD
    cPanel Access Level:
    Root Administrator
    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
     
  12. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,528
    Likes Received:
    2,180
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Can you open a support ticket and reference case number NO-1573? One of our Technical Analysts will access the affected system and take a closer look to see what's happening. You can post the ticket number here once it's opened and I'll link this thread to it.

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. ContinuIT

    ContinuIT Member

    Joined:
    Mar 9, 2019
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ijamsville, MD
    cPanel Access Level:
    Root Administrator
    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.
     
  14. ContinuIT

    ContinuIT Member

    Joined:
    Mar 9, 2019
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ijamsville, MD
    cPanel Access Level:
    Root Administrator
    I managed, but couldn't provide access to the server
    Here is the support case
    Your Support Request ID is: 11716513
     
  15. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,528
    Likes Received:
    2,180
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice