Bug 1272010 - openshift does not use the "region" defined in the pv file to get the volume attached to the node for aws ebs volume
openshift does not use the "region" defined in the pv file to get the volume...
Status: CLOSED NOTABUG
Product: OpenShift Origin
Classification: Red Hat
Component: Storage (Show other bugs)
3.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Mark Turansky
Liang Xia
: NeedsTestCase
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-15 05:33 EDT by chaoyang
Modified: 2015-10-28 21:36 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-10-28 13:52:12 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description chaoyang 2015-10-15 05:33:16 EDT
Description of problem:
openshift does not check the region in the pv json file for aws ebs volume 

Version-Release number of selected component (if applicable):
oc v1.0.6-328-gdf1f19e
kubernetes v1.1.0-alpha.1-653-g86b4e77

How reproducible:
always

Steps to Reproduce:
1.create an instance in region "us-east-1d"
2.create a volume in region "us-east-1d"
3.create a pv with wrong region 
kind: PersistentVolume
apiVersion: v1
metadata:
  name: pv-ebs-readonly
  labels:
    type: local
spec:
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  awsElasticBlockStore:
    volumeID: "aws://xxx/vol-812e4e7b"
    fstype: ext3
    readOnly: true
4. create a pvc
{
    "apiVersion": "v1",
    "kind": "PersistentVolumeClaim",
    "metadata": {
        "name": "ebs-readonly"
    },
    "spec": {
        "accessModes": [ "ReadWriteOnce" ],
        "resources": {
            "requests": {
                "storage": "5Gi"
            }
        }
   }
}
~ 
5.
[root@ip-172-18-0-100 ~]# oc get pv
NAME              LABELS       CAPACITY   ACCESSMODES   STATUS    CLAIM                  REASON    AGE
pv-ebs-readonly   type=local   10Gi       RWO           Bound     default/ebs-readonly             6m

6. create a pod using the pvc, the pod is running
kind: Pod
apiVersion: v1
metadata:
  name: mypod2-readonly
  labels:
    name: frontendhttp
spec:
  containers:
    - name: myfrontend
      image: jhou/hello-openshift
      ports:
        - containerPort: 80
          name: "http-server"
      volumeMounts:
      - mountPath: "/tmp"
        name: aws2
  volumes:
    - name: aws2
      persistentVolumeClaim:
        claimName: ebs-readonly
7.[root@ip-172-18-0-100 ~]# mount | grep xxx
/dev/xvdg on /root/openshift.local.volumes/plugins/kubernetes.io/aws-ebs/mounts/aws/xxx/vol-812e4e7b type ext3 (rw,relatime,seclabel,data=ordered)
Actual results:
openshift does not verify the region in the pv file 

Expected results:
openshift should using the region defined in the pv file to get the volume attached to the node

Additional info:
Comment 1 Mark Turansky 2015-10-28 13:52:12 EDT
The current requirement is that EBS volumes and the host VM run in the same region.  A PV does not define a region for a volume.

Closing this issue as "not a bug".
Comment 2 Sami Wagiaalla 2015-10-28 14:01:04 EDT
Actually the ebs does not need the region all together and volumes in a different region cannot be mounted. So there is not much point in using the format "aws://<region>/<vol-id>"

In fact if you specify just <vol-id> it will work. I tried to remove the other format here: https://github.com/kubernetes/kubernetes/pull/10181 but it was kept so as not to invalidate existing examples.

Note You need to log in before you can comment on or make changes to this bug.