# Rancher EBS - Amazon EBS storage

**URL:** <https://forums.suse.com/t/rancher-ebs-amazon-ebs-storage/5184>\
**Category:** Rancher 1.x\
**Created:** [January 12, 2017, 11:53am UTC](https://forums.suse.com/t/rancher-ebs-amazon-ebs-storage/5184 "2017-01-12T11:53:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![obierlaire](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/obierlaire/32/1249_2.png) [@obierlaire](https://forums.suse.com/u/obierlaire)\
**Post date:** [January 12, 2017, 11:53am UTC](https://forums.suse.com/t/rancher-ebs-amazon-ebs-storage/5184/1 "2017-01-12T11:53:47Z")

</div>

Hello,

There is a new entry in the catalog named “Rancher EBS - Docker volume plugin for Amazon EBS”. I deployed it with my Amazon Credentials, I tried to use it as Volume of a rancher service. Nothing happened. I cannot find any documentation of how to use it? How this Rancher EBS is working? Any doc?

---

<div class="post-metadata">

**Author:** ![V.DGM59](https://avatars.discourse-cdn.com/v4/letter/v/ea5d25/32.png) [@V.DGM59](https://forums.suse.com/u/V.DGM59)\
**Post date:** [January 15, 2017, 10:22pm UTC](https://forums.suse.com/t/rancher-ebs-amazon-ebs-storage/5184/2 "2017-01-15T22:22:34Z")

</div>

This is what I do

1. I create the ebs storage via aws console and get the volume id “vol-xxxxxxxxxx”
2. docker exec -it #{rancher\_ebs\_container\_id} rancher-ebs attach ‘{“volumeID”:“vol-xxxxxxxxxx”}’  
stdout output: {“status”:“Success”,“device”:"/dev/xvdf"}
3. On Rancher web ui, the volume status will be inactive until you mount it to containers  
 ![](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/9/995e50f909085f510d7958f100619891bbeb743f.png)

P.S. The volumes’ name is from  
AWS tags: Name: ebs1

---

<div class="post-metadata">

**Author:** ![sra](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/sra/32/1514_2.png) [@sra](https://forums.suse.com/u/sra)\
**Post date:** [January 18, 2017, 1:27pm UTC](https://forums.suse.com/t/rancher-ebs-amazon-ebs-storage/5184/3 "2017-01-18T13:27:18Z")

</div>

I create my volumes at the environment level under Infrastructure-Storage. Adding a new volume under the rancher-ebs driver with 2 driver option pairs “volumeType gp2” and “size 100” (for 100 Gig).

Then using this inside of a service map the volume name you gave it to a path in the container.

The tricky bit is that the volume will be created in the AZ of the first host that runs the service. The rancher-ebs volume thing is not smart about re-scheduling these to hosts in the same AZ as the desired volume so I added host labels with the AZs and make sure that there are scheduling rules that make the service only get scheduled into the AZ where I want the volume data.

Alternatively you can add volumeId for an existing volume created externally. (I’ve not tried this)

I also use IAM roles on the VMs that are hosts in rancher and you must make sure a policy equivalent to this is attached to their role.

```auto
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Stmt1482260254000",
            "Effect": "Allow",
            "Action": [
                "ec2:CreateSnapshot",
                "ec2:CreateTags",
                "ec2:CreateVolume",
                "ec2:DeleteVolume",
                "ec2:AttachVolume",
                "ec2:DetachVolume",
                "ec2:DescribeSnapshots",
                "ec2:DescribeTags",
                "ec2:DescribeVolumes"
            ],
            "Resource": [
                "*"
            ]
        }
    ]
}

```

---

<div class="post-metadata">

**Author:** ![oroc95](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/oroc95/32/4069_2.png) [@oroc95](https://forums.suse.com/u/oroc95)\
**Post date:** [January 31, 2017, 6:44pm UTC](https://forums.suse.com/t/rancher-ebs-amazon-ebs-storage/5184/4 "2017-01-31T18:44:32Z")

</div>

Hi all  
I was able to use it. Like said “sra”, you need to déclare the volume name under Infrastructure / storage and add a minimum the key “size”

I have some questions about rancher-ebs:

- What is the purpose of IAM profile if a use an IAM user that have the AWSadmin profile ?

- did you successfully tested snapshot ?

---

<div class="post-metadata">

**Author:** ![cpoole](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/cpoole/32/2774_2.png) [@cpoole](https://forums.suse.com/u/cpoole)\
**Post date:** [March 7, 2017, 6:52am UTC](https://forums.suse.com/t/rancher-ebs-amazon-ebs-storage/5184/5 "2017-03-07T06:52:21Z")

</div>

Is there no way to do this through the docker compose?

–EDIT–

I figured it out

my docker compose is as follows

```auto
version: '2'

services:
    nginx:
        image: nginx:latest
        labels:
            io.rancher.container.pull_image: 'always'
        volumes:
            - test-volume:/var/lib/storage
volumes:
    test-volume:
        driver: rancher-ebs
        driver_opts:
            name: test-volume
            size: 40
            volumeType: gp2

```

This creates the volume
