mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
41 lines
1.1 KiB
Plaintext
41 lines
1.1 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * storage/persistent_storage/persistent-storage-vsphere.adoc
|
|
|
|
[id="vsphere-dynamic-provisioning-cli_{context}"]
|
|
= Dynamically provisioning VMware vSphere volumes using the CLI
|
|
|
|
{product-title} installs a default StorageClass, named `thin`, that uses the `thin` disk format for provisioning volumes.
|
|
|
|
.Prerequisites
|
|
|
|
* Storage must exist in the underlying infrastructure before it can be mounted as a volume in {product-title}.
|
|
|
|
.Procedure (CLI)
|
|
|
|
. You can define a VMware vSphere PersistentVolumeClaim by creating a file, `pvc.yaml`, with the following contents:
|
|
+
|
|
[source,yaml]
|
|
----
|
|
kind: PersistentVolumeClaim
|
|
apiVersion: v1
|
|
metadata:
|
|
name: pvc <1>
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce <2>
|
|
resources:
|
|
requests:
|
|
storage: 1Gi <3>
|
|
----
|
|
<1> A unique name that represents the persistent volume claim.
|
|
<2> The access mode of the persistent volume claim. With `ReadWriteOnce`, the volume can be mounted with read and write permissions by a single node.
|
|
<3> The size of the persistent volume claim.
|
|
|
|
. Create the `PersistentVolumeClaim` object from the file:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc create -f pvc.yaml
|
|
----
|