Rubén M.
Rubén M.

Reputation: 23

Openshift: Error creating container in migration to Onlive V3

I'm trying to migrate my app from Openshift Online V2 to Openshift Online V3 and I'm experiencing an issue creating a container.

My app is a Java application created in V2 with two cartriges and 2 gears: Wildfly and PostgreSQL. I have followed the instructions to migrate them to V3. I had no problem to create the PostgreSLQ deployment and I have 1 POD running.

Regarding the Wildfly deployment, seems to be right, I have linked it to my github repository, builded it, and added the persistent storage (the PostgreSQL deployment). The problem appears when I try to scale Wildfly to 1 POD. In the Events tab I can find this:

enter image description here

1:13:36 PM Warning Failed mount (combined from similar events): Failed to attach volume "pvc-6647a164-a308-11e7-9eb0-122631632f42" on node "ip-172-31-50-178.ec2.internal" with: Error attaching EBS volume "vol-0fd5df0548360269a" to instance "i-05aae55ef4783d5a7": VolumeInUse: vol-0fd5df0548360269a is already attached to an instance status code: 400, request id: acd5900f-bd0f-4776-aa76-a33506f25eaf. The volume is currently attached to instance "i-0905fd62b34870511" 60 times in the last 2 hours

1:10:09 PM Warning Failed mount Unable to mount volumes for pod "dentool-5-7s6nk_dentool(b490db8b-accf-11e7-99b4-1250f17a13c8)": timeout expired waiting for volumes to attach/mount for pod "dentool"/"dentool-5-7s6nk". list of unattached/unmounted volumes=[volume-ts28r] 17 times in the last 2 hours

1:10:09 PM Warning Failed sync Error syncing pod 17 times in the last 2 hours

The POD isn't created so I can't run my app. Please note that this is my first approach to Openshift V3 so perhaps I haven't provided the best info. Please let me know what other information could help.

Upvotes: 0

Views: 189

Answers (1)

Graham Dumpleton
Graham Dumpleton

Reputation: 58523

EBS volume type can only be mounted on one node at a time in an OpenShift cluster. When you have Java and MySQL as separate applications that can land on different nodes and as a result, you can't mount the persistent volume against both. The error is warning you of this.

The only way you can use a single EBS volume against Java and MySQL at the same time is for them to be running in separate containers of the same pod. You also need to ensure that the deployment strategy is set to Recreate and not Rolling, as rolling results in a new instance being created when the old still exists, with same issue arising as the new and old could be on different nodes.

In short, OpenShift Online Starter doesn't provide you with enough persistent volumes for you to do what you are trying to do.

Upvotes: 1

Related Questions