ContinuIT

Member
Mar 9, 2019
15
0
1
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
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.
 

ContinuIT

Member
Mar 9, 2019
15
0
1
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!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
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:

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.
 

ContinuIT

Member
Mar 9, 2019
15
0
1
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?
 

ContinuIT

Member
Mar 9, 2019
15
0
1
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
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.
 

ContinuIT

Member
Mar 9, 2019
15
0
1
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
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!
 

ContinuIT

Member
Mar 9, 2019
15
0
1
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
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.