cloud profile agents AWS EC2- disk size issue



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.



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


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.



Hello Marcin, 

Thank you for sharing the solution.


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

withBlockDeviceMappings ( 

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. 

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'))],



Please sign in to leave a comment.