<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Srinivasarao Mogallapu on Medium]]></title>
        <description><![CDATA[Stories by Srinivasarao Mogallapu on Medium]]></description>
        <link>https://medium.com/@cnu4cloud?source=rss-1bd86e5718d7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*essOC0snWD71cghTvz35Cg.jpeg</url>
            <title>Stories by Srinivasarao Mogallapu on Medium</title>
            <link>https://medium.com/@cnu4cloud?source=rss-1bd86e5718d7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 04:53:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cnu4cloud/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Expanding persistent volumes for vSphere Volume]]></title>
            <link>https://medium.com/@cnu4cloud/expanding-persistent-volumes-for-vsphere-volume-4a9b8c825954?source=rss-1bd86e5718d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a9b8c825954</guid>
            <dc:creator><![CDATA[Srinivasarao Mogallapu]]></dc:creator>
            <pubDate>Fri, 11 Sep 2020 07:08:20 GMT</pubDate>
            <atom:updated>2020-09-11T14:46:41.703Z</atom:updated>
            <content:encoded><![CDATA[<p>As we know that we need to create and configure persistent volumes for few components in k8s/OCP by using either static or dynamic provisioning with certain size assigned. However, sometimes PVC size that we assigned initially may get full and causes corresponding pods/deployments failed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*-DDdzHvydGJ0rHu--Gh48g.png" /></figure><p>In this case we need to expand the volume claims to make more space available. we can opt for dynamic expansion solution for few storage classes.To allow expansion of persistent volume claims (PVC), we must create or update a StorageClass with ‘allowVolumeExpansion’ set to true. Only PVCs created from that class are allowed to expand.</p><p>BUT When we are using vsphere-standard storage class for persistent volume, it is not possible to expand PVs. Only option left out is creation of new PVC with more size followed by migrating the data from old PVC and then reconfigure deployment to get claim name pointing to new PVC with below steps.</p><h3><strong>Create New PVC and migrate the data between PVs:</strong></h3><p>Note: here, I am taking an example of elastic search PVC in openshift 3.11</p><p><strong>a) Creating new PVC for logging-es-*</strong></p><ol><li>Get into Openshift-logging project and check existing PVC’s.</li></ol><p><em>$oc project openshift-logging<br>$oc get pvc</em></p><p>2. Create new PVC with size of 1 TB(lets assume current pvc size is 500GB). PV will get created automatically as dynamic provisioning is enabled.</p><p>New PVC names could be of your choice, example: logging-es-00</p><p>pvc_new_file.yaml</p><p><em>kind: PersistentVolumeClaim<br>apiVersion: v1<br>metadata:<br>name: logging-es-00<br>annotations:<br>volume.beta.kubernetes.io/storage-class: vsphere-standard<br>spec:<br>accessModes:<br>- ReadWriteOnce<br>resources:<br>requests:<br>storage: 1000Gi</em></p><p><em>$ oc create -f pvc_new_file.yaml</em></p><p><strong>b) Migrating the data between PV’s:</strong></p><ol><li>Get into Openshift-logging project and check the DC for logging elastic search.</li></ol><p>$oc project openshift-logging<br>$oc get dc<br>logging-es-data-master-i39qcxev</p><p>2. Confirm old PVC name and volume name (in this case logging-es-0 and elasticsearch-storage)</p><p><em>$oc get pvc<br>$oc describe dc logging-es-data-master-i39qcxev</em></p><p>3. Make sure to stop logging-es-data-master-i39qcxev DC and no write during migration.</p><p><em>$oc scale dc logging-es-data-master-i39qcxev — replicas=0</em></p><p>4. Spawn no-op container for the storage maintenance</p><p><em>$oc run sleep — image=registry.access.redhat.com/rhel7/rhel-tools — tail -f /dev/null</em></p><p>5. Mount old PVC to that container</p><p><em>$oc set volume dc/sleep — add -t pvc — name=elasticsearch-storage — claim-name= logging-es-0 — mount-path=/old-registry</em></p><p>6. Create and mount new PV/PVC to that container. If you have already created new PVC’s in above section a). the the flags — claim-mode and –claim-size are not required in below command.</p><p><em>$oc set volume dc/sleep — add -t pvc — name=new-registry — claim-name=logging-es-00 — mount-path=/new-registry — claim-mode=ReadWriteMany — claim-size=1000Gi</em></p><p>7. rsh into the container</p><p><em>$oc rsh sleep-X-XXXXX</em></p><p>8. Migrate data to the new storage</p><p><em>$rsync -avxHAX — progress /old-registry/* /new-registry</em></p><p>9. The last step, you need to switch to the new storage volume in DC logging-es-data-master-i39qcxev.</p><p><em>$oc set volume dc/logging-es-data-master-i39qcxev — remove — name= elasticsearch-storage</em></p><p><em>$oc set volume dc/logging-es-data-master-i39qcxev — add -t pvc — name= elasticsearch-storage — claim-name= logging-es-00 — mount-path=/elasticsearch/persistent</em></p><p>10. Rollout the changes and restart DC logging-es-data-master-i39qcxev.</p><p><em>$oc rollout latest logging-es-data-master-i39qcxev<br>$oc scale dc logging-es-data-master-i39qcxev — replicas=1</em></p><p>11. Remove maintenance pod</p><p><em>$oc delete dc sleep</em></p><p><strong>Glossary:</strong></p><p>· PV — Persistent Volume</p><p>· PVC — PersistentVolumeClaim</p><p>· DC — DeploymentConfig</p><p>· ES — Elastic Search</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a9b8c825954" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>