# PV not attaching to Elasticsearch pod

**URL:** <https://discuss.elastic.co/t/pv-not-attaching-to-elasticsearch-pod/295919>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [February 1, 2022, 8:44am UTC](https://discuss.elastic.co/t/pv-not-attaching-to-elasticsearch-pod/295919 "2022-02-01T08:44:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Purushotham\_Reddy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/purushotham_reddy/32/100267_2.png) [@Purushotham\_Reddy](https://discuss.elastic.co/u/Purushotham_Reddy)\
**Post date:** [February 1, 2022, 8:44am UTC](https://discuss.elastic.co/t/pv-not-attaching-to-elasticsearch-pod/295919/1 "2022-02-01T08:44:59Z")

</div>

Hi All,

I am facing an issue i.e PV is not getting attached/mounted to Elasticsearch pod.

**Background:**

I have setup Elasticsearch cluster using eck operator. Details are as follows. Cluster is setup in OKE(Oracle kubernetes engine).

**ES Version:** 6.8.21  
**Master Nodes:** 3  
**Data nodes** 9

Each data node Volume is 500GB.

Everynow and then we are facing issues with storage. Hence I decided to update the storage from 500GB to 750GB.

So I updated the size of PVC of **data-0** which updated its respective PV. Then I restarted the data-0 pod however the pod is not going into running state. Then I had manually updated the Block Volume from 500GB to 750 GB and then tried. Same error. Error is follows.

**Error**

MountVolume.MountDevice failed while expanding volume for volume "\<ocid id\>" : MountVolume.NodeExpandVolume failed : expandfs command failed, status: Failure, reason: Invalid command; got [/usr/libexec/kubernetes/kubelet-plugins/volume/exec/oracle~oci/oci expandfs {"[kubernetes.io/fsType":"ext4","kubernetes.io/pvOrVolumeName":"](http://kubernetes.io/fsType%22:%22ext4%22,%22kubernetes.io/pvOrVolumeName%22:%22)\<ocid id\>","[kubernetes.io/readwrite":"rw](http://kubernetes.io/readwrite%22:%22rw)"} /dev/disk/by-path/\<redacted\> /var/lib/kubelet/plugins/kubernetes.io/flexvolume/oracle/oci/mounts/\<ocid-id\>]

\<ocid-id\> -\> Oracle cloud identifier similar to ARN in Amazon.

I know this is something related OCI stuff. I just want to know if anyone run into this issue before. Any guidance or help on this?

---

<div class="post-metadata">

**Author:** ![Purushotham\_Reddy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/purushotham_reddy/32/100267_2.png) [@Purushotham\_Reddy](https://discuss.elastic.co/u/Purushotham_Reddy)\
**Post date:** [February 15, 2022, 5:55am UTC](https://discuss.elastic.co/t/pv-not-attaching-to-elasticsearch-pod/295919/2 "2022-02-15T05:55:33Z")

</div>

Hi Elastic team,

Could you please provide your suggestions on this?

I think this init container "elastic-internal-init-filesystem" is trying to prepare the file system and not able to pick up the changes done manually(PVC, PV, Underlying block volume). even after replacing this init container **command** content with something else(i.e echo "hello") it is not working. Kindly do the needful.

---

<div class="post-metadata">

**Author:** ![Michael\_Montgomery](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_montgomery/32/82242_2.png) [@Michael\_Montgomery](https://discuss.elastic.co/u/Michael_Montgomery)\
**Post date:** [February 22, 2022, 3:13pm UTC](https://discuss.elastic.co/t/pv-not-attaching-to-elasticsearch-pod/295919/3 "2022-02-22T15:13:45Z")

</div>

> <https://github.com/oracle/oci-cloud-controller-manager/issues/354>
>
> \## Is this a BUG REPORT or FEATURE REQUEST?
> 
> Choose one: BUG REPORT or FEATURE… REQUEST
> 
> \<!--
> If this is a BUG REPORT, please:
> - Fill in as much of the template below as you can. If you leave out information, we can't help you as well.
> 
> If this is a FEATURE REQUEST, please:
> - Describe \*in detail\* the feature/behaviour/change you'd like to see.
> 
> If we can't reproduce a bug or think a feature already exists, we
> might close your issue. If we're wrong, PLEASE feel free to reopen it and
> explain why.
> \--\>
> 
> \## Versions
> 
> \*\*CCM Version\*\*:
> v 0.9
> 
> \*\*Environment\*\*:
> \- \*\*Kubernetes version\*\* (use \`kubectl version\`):
> \`\`\`
> ubeadm version
> kubeadm version: &version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.0", GitCommit:"e19964183377d0ec2052d1f1fa930c4d7575bd50", GitTreeState:"clean", BuildDate:"2020-08-26T14:28:32Z", GoVersion:"go1.15", Compiler:"gc", Platform:"linux/amd64"}
> \`\`\`
> 
> \- \*\*OS\*\* (e.g. from /etc/os-release):
> \`\`\`
> DISTRIB\_ID=Ubuntu
> DISTRIB\_RELEASE=18.04
> DISTRIB\_CODENAME=bionic
> DISTRIB\_DESCRIPTION="Ubuntu 18.04.5 LTS"
> \`\`\`
> \- \*\*Kernel\*\* (e.g. \`uname -a\`):
> \`\`\`
> Linux inst-tnknj-dev-kube-instgrp-master-infpools-org 5.4.0-1035-oracle #38~18.04.1-Ubuntu SMP Wed Jan 6 21:03:06 UTC 2021 x86\_64 x86\_64 x86\_64 GNU/Linux
> \`\`\`
> \- \*\*Others\*\*:
> 
> \## What happened?
> I have installed the OCI CSI plugin ,and set the allowVolumeExpansion: true on the StorageClass, but it cannot resize the pvc
> 
> \`\`\`
> kubectl describe sc oci-bv
> 
> Name: oci-bv
> IsDefaultClass: No
> Annotations: kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"storage.k8s.io/v1","kind":"StorageClass","metadata":{"annotations":{},"name":"oci-bv"},"provisioner":"blockvolume.csi.oraclecloud.com","reclaimPolicy":"Delete","volumeBindingMode":"WaitForFirstConsumer"}
> 
> Provisioner: blockvolume.csi.oraclecloud.com
> Parameters: \<none\>
> AllowVolumeExpansion: True
> MountOptions: \<none\>
> ReclaimPolicy: Delete
> VolumeBindingMode: WaitForFirstConsumer
> Events: \<none\>
> \`\`\`
> \## What you expected to happen?
> We are expecting that the pvc can be resized with "oci-bv" with AllowVolumeExpansion: True
> 
> \## How to reproduce it (as minimally and precisely as possible)?
> 1. Set the allowVolumeExpansion: true on the storageClass
> \`\`\`
> allowVolumeExpansion: true
> apiVersion: storage.k8s.io/v1
> kind: StorageClass
> metadata:
> annotations:
> kubectl.kubernetes.io/last-applied-configuration: |
> {"apiVersion":"storage.k8s.io/v1","kind":"StorageClass","metadata":{"annotations":{},"name":"oci-bv"},"provisioner":"blockvolume.csi.oraclecloud.com","reclaimPolicy":"Delete","volumeBindingMode":"WaitForFirstConsumer"}
> creationTimestamp: "2021-06-16T05:39:38Z"
> name: oci-bv
> resourceVersion: "4461"
> selfLink: /apis/storage.k8s.io/v1/storageclasses/oci-bv
> uid: 9a257ec6-c8d1-428e-9797-c2a7fb3f350a
> provisioner: blockvolume.csi.oraclecloud.com
> reclaimPolicy: Delete
> volumeBindingMode: WaitForFirstConsumer
> allowVolumeExpansion: true
> 
> kubectl get sc
> NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
> oci-bv blockvolume.csi.oraclecloud.com Delete WaitForFirstConsumer true 60m
> 
> \`\`\`
> 2. Request a change in volume capacity by editing the PersistentVolumeClaim's spec.resources.requests.storage field. For example, change the following PVC from having a 50 gibibyte (GiB) disk to having a 104 GiB disk.
> 
> \`\`\`
> # pvc-demo.yaml
> apiVersion: v1
> kind: PersistentVolumeClaim
> metadata:
> name: pvc-demo
> spec:
> accessModes:
> - ReadWriteOnce
> resources:
> requests:
> storage: 50Gi
> \`\`\`
> After editing:
> 
> \`\`\`
> # pvc-demo.yaml
> apiVersion: v1
> kind: PersistentVolumeClaim
> metadata:
> name: pvc-demo
> spec:
> accessModes:
> - ReadWriteOnce
> resources:
> requests:
> storage: 104Gi
> \`\`\`
> 
> 3. After that, should see the new volume in the status.capacity field get updated, but it still show the same
> \`\`\`spec:
> accessModes:
> - ReadWriteOnce
> resources:
> requests:
> storage: 104Gi
> storageClassName: oci-bv
> volumeMode: Filesystem
> volumeName: csi-ef97ef8e-1a3a-4b47-95e1-b17d42a0a183
> status:
> accessModes:
> - ReadWriteOnce
> capacity:
> storage: 50Gi
> phase: Bound
> \`\`\`
> 4.The storage capacity is still 50Gi, did not get changed
> 
> \## Anything else we need to know?

From what I'm reading, volume expansion isn't supported within Oracle's CSI.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 22, 2022, 3:13pm UTC](https://discuss.elastic.co/t/pv-not-attaching-to-elasticsearch-pod/295919/4 "2022-03-22T15:13:57Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
