cloud profile agents AWS EC2- disk size issue

Answered

Hi

I am running TeamCity Server 2017.1.2 and my cloud profile agents are already configured. However I have run into problems with agents which are EC2 instances on AWS and they have 8GB of space. I need to provide more disk space for my agents so the question is;

How can I increase the disk size that is used for each cloud agent when agent is created?

I couldn't find an references of how to do it and also the interface does not provide an option of disk space allocation.

Thanks

2
4 comments

Hi, in order to have more disk space you need to create a new AMI with larger disk.

-2
Avatar
Permanently deleted user

Nice one, just to provide a solution for other guys. When you use packer to build an ami, you can use the following block to allocate extra disk space for your ami;

"builders": [
  {
    "name": "agent",
    "type": "amazon-ebs",
    "instance_type": "t2.medium",
    "ami_name": "cps-build-agent-{{timestamp}}",
    "ami_block_device_mappings": [
      {
        "device_name": "/dev/sda1",
        "volume_type": "gp2",
        "volume_size": "30"
      }
   ]
 }]

With the above solution you will have an ami launched with 30GB of disk.

thanks

1

Hello Marcin, 

Thank you for sharing the solution.

0

Creating large AMI is not a good solution as you pay for storing larger AMI. It would be better to use

withBlockDeviceMappings (https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/index.html?com/amazonaws/services/ec2/model/RunInstancesRequest.html) 

when you creating instances (I assume you use Java API) and  allow users to specify advanced settings: device name, disk size and type, e.g. 

.withBlockDeviceMappings(
new BlockDeviceMapping().withDeviceName("/dev/sda1").withEbs(new EbsBlockDevice().withVolumeSize(30).withVolumeType('standard'))

in boto3 Python use:

BlockDeviceMappings=[dict(DeviceName='/dev/sda1', Ebs=dict(VolumeSize=vsize, VolumeType='standard'))],

 

0

Please sign in to leave a comment.