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.

  1. Create a persistent volume (PV) yaml file.
    Before creating, note the following:
    • 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_UID
        lsvdisk vol0 | grep vdisk_UID
        vdisk_UID 600507640082000B08000000000004FF
        
      • Through command line (for FlashSystem A9000 and A9000R):
        vol_list_extended vol=<volume_name>
        For example, for vol1:
        A9000>> vol_list_extended vol=vol1
        Name   WWN                                Product Serial Number     
        vol1   6001738CFC9035E8000000000091F0C0   60035E8000000000091F0C0 
      • Through the Spectrum Virtualize management GUI:
        1. Select Volumes > Volumes from the side bar.

          The Volumes page appears.

        2. Browse to the volume that the port is on and right-click > Properties.

          The Properties window appears. Use the UID number.

        For more information about Spectrum Virtualize see IBM Spectrum Virtualize as Software Only on Knowledge Center or your specific product page.
      • Through the IBM Hyper-Scale Manager user interface for FlashSystem A9000 and A90000R storage systems:
        1. Select Systems and Domains Views > Systems Ports Connectivity from the side bar.

          The Systems Ports panel is displayed.

        2. Select the Ports widget.
        3. 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 .
    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
  2. Create a PersistentVolumeClaim (PVC) yaml file.
    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