Importing an existing volume
Volumes not created by the IBM block storage CSI driver can be imported by using a persistent volume (PV) yaml file.
About this task
Procedure
Volumes created externally from the CSI driver can be imported using the CSI driver. Use this procedure to help build a PV yaml file for your volumes.
|
Note: These steps are setup for importing volumes from a Storwize system. Change
parameters, as needed.
|
-
Create a persistent volume (PV) yaml file. Before creating, note the following:Important: Be sure to include the storageClassName and controllerPublishSecretRef parameters or errors will occur.
- The volumeAttributes entries are for informational purposes only.The following examples are attributes that can be included:
- pool_name: <Name of Pool where volume is located>
- storage_type: <SVC | A9K>
- volume_name:<Volume name>
- To find the volumeHandle, use one of the following:
- Through command line (for
Storwize):
lsvdisk <volume name> | grep vdisk_UIDlsvdisk vol0 | grep vdisk_UID vdisk_UID 600507640082000B08000000000004FF - Through command line (for FlashSystem A9000 and
A9000R):
For example, for vol1:vol_list_extended vol=<volume_name>A9000>> vol_list_extended vol=vol1 Name WWN Product Serial Number vol1 6001738CFC9035E8000000000091F0C0 60035E8000000000091F0C0 - Through the Spectrum Virtualize management GUI:
- Select Volumes > Volumes
from the side bar.
The Volumes page appears.
- Browse to the volume that the port is on and right-click >
Properties.
The Properties window appears. Use the UID number.
- Select Volumes > Volumes
from the side bar.
- Through the IBM Hyper-Scale Manager user interface for FlashSystem A9000 and A90000R storage
systems:
- Select Systems and Domains Views > Systems Ports
Connectivity from the side bar.
The Systems Ports panel is displayed.
- Select the Ports widget.
- From the Actions menu on the FC port, click View/Edit FC
Port.
Use the WWPN number.
For more information about the IBM Hyper-Scale Manager see IBM Hyper-Scale Manager on Knowledge Center .
- Select Systems and Domains Views > Systems Ports
Connectivity from the side bar.
- Through command line (for
Storwize):
apiVersion: v1 kind: PersistentVolume metadata: #annotations: #pv.kubernetes.io/provisioned-by: block.csi.ibm.com name: vol1-pv spec: accessModes: - ReadWriteOnce capacity: storage: 5Gi csi: controllerPublishSecretRef: name: flashv7k-1 namespace: kube-system driver: block.csi.ibm.com # volumeAttributes: # pool_name: ibmc-block-gold # storage_type: SVC # volume_name: vol1 volumeHandle: SVC:600507640082000B08000000000004FF persistentVolumeReclaimPolicy: Retain storageClassName: ibmc-block-gold # volumeMode: Filesystem - The volumeAttributes entries are for informational purposes only.
-
Create a PersistentVolumeClaim (PVC) yaml file. Note: To include specific a 5Gi PV, be sure to include the storageClassName.
apiVersion: v1 kind: PersistentVolumeClaim metadata: volume.beta.kubernetes.io/storage-provisioner: block.csi.ibm.com name: vol1-pvc spec: accessModes: - ReadWriteOnce resources: requests: storage: 5Gi storageClassName: ibmc-block-gold volumeName: vol1-pv