Failed to provision volume: invalid AccessModes [ReadWriteMany]
Environment
- Red Hat AMQ (AMQ)
- 6.3
- Red Hat OpenShift Container Platform (OpenShift)
- 3.11
Issue
- Failed to provision volume: invalid AccessModes [ReadWriteMany]
- How to provision JBoss AMQ 6.3 persistent template on OpenShift
Resolution
Full procedure to deploy AMQ 6 persistent templates with ReadWriteOnce access mode:
PROJECT_NAME="demo"
IMAGE_STREAM="https://raw.githubusercontent.com/jboss-openshift/application-templates/ose-v1.4.15/amq/amq63-image-stream.json"
TEMPLATE_NAME="https://raw.githubusercontent.com/jboss-openshift/application-templates/ose-v1.4.15/amq/amq63-persistent.json"
oc login -u developer -p x
oc new-project $PROJECT_NAME
oc replace --force -f $IMAGE_STREAM
echo '{"kind": "ServiceAccount", "apiVersion": "v1", "metadata": {"name": "amq63"}}' | oc create -f -
curl -o my-broker.json $TEMPLATE_NAME
sed -i -e "s/ReadWriteMany/ReadWriteOnce/g" my-broker.json
oc process -f my-broker.json \
-p IMAGE_STREAM_NAMESPACE=$PROJECT_NAME \
-p MQ_USERNAME=admin \
-p MQ_PASSWORD=admin \
| oc create -f -
Root Cause
In AMQ 6, the access mode is not one of the expected input parameters, so it must be manually changed before applying the template.
Diagnostic Steps
A similar error can be observed while provisioning:
Failed to provision volume with StorageClass "xxxx": invalid AccessModes [ReadWriteMany]: only AccessModes [ReadWriteOnce] are supported
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments