# How can predefined PV and PVC assigned to

**URL:** <https://forums.percona.com/t/how-can-predefined-pv-and-pvc-assigned-to/30860>\
**Category:** Percona Operator for MongoDB\
**Created:** [June 7, 2024, 3:47am UTC](https://forums.percona.com/t/how-can-predefined-pv-and-pvc-assigned-to/30860 "2024-06-07T03:47:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamoser](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@jamoser](https://forums.percona.com/u/jamoser)\
**Post date:** [June 7, 2024, 3:47am UTC](https://forums.percona.com/t/how-can-predefined-pv-and-pvc-assigned-to/30860/1 "2024-06-07T03:47:41Z")

</div>

Hello

Currently at the cluster creation the PVs and PVCs are created. Is it possible to create the PVs and PVCs beforehand and assign them to the rs’s and cfg’s ?

---

<div class="post-metadata">

**Author:** ![Ege\_Gunes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ege_gunes/32/4595_2.png) [@Ege\_Gunes](https://forums.percona.com/u/Ege_Gunes)\
**Post date:** [June 7, 2024, 1:54pm UTC](https://forums.percona.com/t/how-can-predefined-pv-and-pvc-assigned-to/30860/2 "2024-06-07T13:54:16Z")

</div>

This can be done if you create PVCs by adhering the naming rules. For example if you have a cluster named `cluster1`, you can create PVCs to be used by `rs0` pods like:

`pvc/mongod-data-cluster1-rs0-0`  
`pvc/mongod-data-cluster1-rs0-1`  
`pvc/mongod-data-cluster1-rs0-2`

But I’m curious, what do you want to achieve by creating PVCs yourself?

---

<div class="post-metadata">

**Author:** ![jamoser](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@jamoser](https://forums.percona.com/u/jamoser)\
**Post date:** [June 7, 2024, 2:31pm UTC](https://forums.percona.com/t/how-can-predefined-pv-and-pvc-assigned-to/30860/3 "2024-06-07T14:31:39Z")

</div>

Thanks - let me try that !

Well … sometimes ppl do funny stuff - like deleting the wrong GKE cluster. And in that case the PV and PVC and the disks are getting deleted.

If I can create them myself, I can make sure that the disks get not deleted and afterwards I can reassign them.
