Manually importing and exporting volumes

You can manually import and export a volumes in PowerVC when using SSP storage or when you just have a volume and not an image to upload or download.

About this task

Manually export or import a SAN-backed volume

Follow these steps to export or import a SAN-backed volume:

  1. Map the volume to a host that is connected to the SAN storage device over Fibre Channel.
  2. Rescan the devices on the host so a disk device is identified for the volume.
  3. Run the dd command to copy the volume data to or from the disk device.
  4. Detach the volume from the host.

Example of the steps to export a volume from the SAN utilizing a virtual IO server (VIOS) and a Storwize provider:

  1. On the storage device, use the following command to get the disk UID. It is used later in this procedure. In this example, the UID is in bold:
    lsvdisk -delim :
    15:aix7:0:io_grp0:online:8:example_disk_grp:10.00GB:striped:::::60050768028180EE3800000000004467:0:1:empty:0:no:0
  2. On the storage device, attach the new LUN to the VIOS. Optionally use lshost to see all available hosts.
    mkvdiskhostmap -host example_disk_grp aix7
  3. On the VIOS, rescan the devices to pick up the new image. Below, the new image has been added to hdisk1. This can be determined by finding the correct UID.
    # oem_setup_env 
    # cfgmgr
    # for i in `lsdev -c disk -F name`; do  echo $i \\c; lsattr -E -l $i -a unique_id; done
    hdisk0 unique_id 2D113500000E1169D39C009MBD2300RC08IBM-ESXSsas Unique device identifier False
    hdisk1 unique_id 3321360050768028180EE380000000000446704214503IBMfcp Unique device identifier False
    hdisk2 unique_id 3321360050768028180EE380000000000445004214503IBMfcp Unique device identifier False
  4. On the VIOS, copy the uncompressed volume to or from the SAN volume. In this case, it was in /tmp.
    Notes:
    • In this example, <hdisk#> is used instead of hdisk1. This avoids someone copying and pasting the command and accidentally destroying the contents of hdisk1 on their system.
    • In this example, rhdisk is used instead of hdisk. This provides superior write performance.

    To export the volume from the storage provider, run this command:

    # dd  if=/dev/rhdisk<hdisk#> of=/tmp/aix7_img bs=4M

    To import the volume from the storage provider, run this command:

    # dd  of=/dev/rhdisk<hdisk#> if=/tmp/aix7_img bs=4M
  5. On the VIOS, remove the hdisk:
    rmdev -dl hdisk<hdisk#>
  6. Unmap the volume from the VIOS. On the SAN Volume Controller, run the following command:
    svc>rmvdiskhostmap -host example_disk_grp aix7
Exporting or importing a shared storage pool volume

Follow these steps to export and import a shared storage pool volume:

In this example, the image is copied to the volume named New-SSP-Image. All of the following commands must be run on the VIOS:

  1. Log in to a VIOS that is hosting the shared storage pool.
  2. Find the cluster name that this VIOS belongs to.
     $ cluster -list
        CLUSTER_NAME:    powervc_demo_cluster
        CLUSTER_ID:      608580b2086711e4a00d00006cae8b02
  3. Find the shared storage pool name for the cluster.
     $ lssp -clustername powervc_demo_cluster
        POOL_NAME:       powervc_demo_ssp
        POOL_SIZE:       511872
        MIRROR_STATE:    NOT_MIRRORED
        FREE_SPACE:      496337
        TOTAL_LU_SIZE:   61440
        OVERCOMMIT_SIZE: 0
        TOTAL_LUS:       1
        POOL_TYPE:       CLPOOL
        POOL_ID:         000000000972FBB30000000053BEE7C6
  4. List the shared storage pool logical units and find the volume on Volume Details page. Make note of the Lu Udid
      $ lssp -clustername powervc_demo_cluster -sp powervc_demo_ssp -bd
        Lu Name                      Size(mb)    ProvisionType       %Used Unused(mb)  Lu Udid
        volume-New-SSP-Image-Volume  20480       THIN                  0%  20481       7e2e5b5738d7adf4be3b64b9b731c2ff

    The remaining steps must be run as root.

  5. Run # oem_setup_env.
  6. Find the mount for the shared storage pool:
    #  df | grep powervc_demo_cluster
        /var/vio/SSP/powervc_demo_cluster/D_E_F_A_U_L_T_061310 1048313856 1016480712    4%        -     -  /var/vio/SSP/powervc_demo_cluster/D_E_F_A_U_L_T_061310
  7. Change to the shared storage pool directory:
    cd /var/vio/SSP/powervc_demo_cluster/D_E_F_A_U_L_T_061310 
  8. List the directories in the shared storage pool. The volume-New-SSP-Image-Volume is in a directory with a name that starts with VOL.
     # ls
        IM       VIOSCFG  VOL1
  9. Find the volume by logical unit Udid in the VOL1 directory:
    # ls VOL1
        .volume-New-SSP-Image-Volume.7e2e5b5738d7adf4be3b64b9b731c2ff
        volume-New-SSP-Image-Volume.7e2e5b5738d7adf4be3b64b9b731c2ff
  10. Copy the uncompressed volume to or from the shared storage pool volume file volume-New-SSP-Image-Volume.7e2e5b5738d7adf4be3b64b9b731c2ff. In this example, the uncompressed volume is copied to or from /tmp.

    To export the volume to a file from the shared storage pool, run this command:

      # dd if=VOL1/volume-New-SSP-Image-Volume.7e2e5b5738d7adf4be3b64b9b731c2ff of=/tmp/aix7_img bs=1M

    To import the volume from a file to the shared storage pool, run this command:

    # dd if=/tmp/aix7_img of=VOL1/volume-New-SSP-Image-Volume.7e2e5b5738d7adf4be3b64b9b731c2ff bs=1M