How to increase storage and assign hostname to instance using scalr api v2?

80 views
Skip to first unread message

Sankalp Kale

unread,
Aug 5, 2016, 2:07:39 AM8/5/16
to scalr-discuss
Hi, 
We want to automate create farm , add farm role and all related things for setting in up ec2 instances on AWS using scalr apis v2.


We are able to create farm, add farm role. 
Two things we didnt found in scalr api v2 , 
1. How to increase storage of ec2 instance
2. How to provide hostname to instance.

Are there any scalr api`s for the same or any way we can automate above things after adding farm-role , before launching the farm.


From Scalr Webportal , we can change the hostname form
Farms --> Role--> Advance --> Server hostname 













For changing storage space .
Farms --> Role --> Storage --> Storage Configuration

Please let us know ,if we can automate this or a manual step is required for changing above parameters.

Thanks,
Sankalp

Marc O'Brien

unread,
Aug 8, 2016, 1:38:19 PM8/8/16
to scalr-discuss
Hi Sankalp,

We are planning to add additional improvements to APIv2 including storage, health, and usage.  We do not presently have a public ETA for this as of now, but keep an eye on our APIv2 documentation for future enhancements. 

For the Server Hostname, you will notice the {X} symbol next to the setting.  This indicates that the setting supports Global Variable Interpolation.  You should be able to use APIv2 to edit a Farm Role GV and automate the hostname setting. This can also be managed with a governance policy for scalr.server.hostname_format.

Many thanks,
Wm. Marc O'Brien
Scalr Technical Support

Sankalp Kale

unread,
Aug 10, 2016, 3:08:03 AM8/10/16
to scalr-discuss
Thanks Marc. 

Vinod Pattel

unread,
Aug 10, 2016, 3:44:00 AM8/10/16
to scalr-discuss
Hi Marc,

With reference to setting custom host name to instances, I see a problem.
I set Server Hostname Format as: {SCALR_FARM_NAME}-{SCALR_FARM_ROLE_ALIAS}-{SCALR_INSTANCE_INDEX}
When a VM instance gets created, instance name & hostname are set properly as expected. But, DNS resolution fails inside the VM:

[root@DevOps-InternalInfrastructureServices-New-Host-1 ~]# hostname

DevOps-InternalInfrastructureServices-New-Host-1

[root@DevOps-InternalInfrastructureServices-New-Host-1 ~]# hostname -f

hostname: Name or service not known

[root@DevOps-InternalInfrastructureServices-New-Host-1 ~]# cat /etc/hosts

None    DevOps-InternalInfrastructureServices-New-Host-1

127.0.0.1 localhost

Looking at the log, it appears like DNS entries are getting created for default hostname (instead of custom host name):

2016-07-20 10:55:07,313 - helpers.py[DEBUG]: Running config-set_hostname using lock (<FileLock using file '/var/lib/cloud/instances/i-3bb093bd/sem/config_set_hostname'>)

2016-07-20 10:55:07,317 - cc_set_hostname.py[DEBUG]: Setting the hostname to ip-100-122-203-40.us-east-1.ec2.aws.net (ip-100-122-203-40)

2016-07-20 10:55:07,317 - util.py[DEBUG]: Running command ['hostnamectl', 'set-hostname', 'ip-100-122-203-40.us-east-1.ec2.aws.net'] with allowed return codes [0] (shell=False, capture=True)

2016-07-20 10:55:07,886 - __init__.py[DEBUG]: Non-persistently setting the system hostname to ip-100-122-203-40

2016-07-20 10:55:07,886 - util.py[DEBUG]: Running command ['hostname', 'ip-100-122-203-40'] with allowed return codes [0] (shell=False, capture=True)

2016-07-20 10:55:07,893 - helpers.py[DEBUG]: Running config-update_etc_hosts using lock (<cloudinit.helpers.DummyLock object at 0x190a910>)

2016-07-20 10:55:07,895 - util.py[DEBUG]: Reading from /etc/cloud/templates/hosts.redhat.tmpl (quiet=False)

2016-07-20 10:55:07,897 - util.py[DEBUG]: Read 20 bytes from /etc/cloud/templates/hosts.redhat.tmpl

2016-07-20 10:55:07,899 - util.py[DEBUG]: Writing to /etc/hosts - wb: [420] 20 bytes

Am i missing any configuration ??

Appreciate your help !!

Marc O'Brien

unread,
Aug 10, 2016, 5:11:54 PM8/10/16
to scalr-discuss
Hi Vinod,

Can you confirm the agent version you are using?  If you are not on latest, can you verify if this behavior persists on latest agent version?


Many thanks,
Wm. Marc O'Brien
Scalr Technical Support


Vinod Pattel

unread,
Aug 12, 2016, 6:43:19 AM8/12/16
to scalr-discuss
Hi Marc,

Agent version is 4.7.3.
What is the latest agent available ??
I will try updating to the latest & check.

Regards,
Vinod


Marc O'Brien

unread,
Aug 12, 2016, 1:07:37 PM8/12/16
to scalr-discuss
Hi Vinod,

Latest agent version is 4.9.9 and latest stable version is 4.8.1.  Additional agent release details are available in our Agent Changelog.


Many thanks,
Wm. Marc O'Brien
Scalr Technical Support

Reply all
Reply to author
Forward
0 new messages