Migrate Persistent Disk to Hyperdisk for SAP HANA

This document describes how you can migrate the Persistent Disk volumes used by your SAP HANA databases to Google Cloud Hyperdisk volumes.

Hyperdisk, especially, Hyperdisk Extreme, provides better performance for SAP HANA than the SSD-based Persistent Disk types.

To migrate the Persistent Disk volumes used by your SAP HANA database to Hyperdisk volumes, you use Google Cloud's disk snapshots and the SAP HANA Fast Restart Option.

Review migration considerations

  • Migration data: The SAP HANA Fast Restart option is used as a helper. It reduces downtime while grating the disks by eliminating the need to wait for your database tables to load. However, make sure to take into account the time needed to reload row store and Binary Large Object (BLOB) data types.
  • Downtime: Although the migration process requires minimal downtime, the actual duration of the downtime depends on the time taken to complete the following tasks:

    • Creating disk snapshots.

      To reduce downtime while taking disk snapshots, you can take snapshots of the disks before the planned migration activity, and then take some additional snapshots closer to the activity, which results in a smaller difference between the snapshots.

    • Creating Hyperdisk volumes by using the snapshots of your Persistent Disk volumes.

    • Reloading the SAP HANA tables into SAP HANA memory.

  • Reverting to existing disks: In the event of any problem during the migration, you can revert to the existing disks because they are unaffected by this procedure, and are available till you delete them yourself. For more information, see Fall back to existing disks.

Before you begin

Before you migrate the Persistent Disk volumes used by your SAP HANA database to Hyperdisk volumes, make sure the following conditions are met:

  • SAP HANA is running on SAP-certified Compute Engine instances that support Hyperdisk.
  • The /hana/data and /hana/log volumes are hosted on separate disks.
  • Linux logical volume management is used for SAP HANA storage persistence. While direct storage can be used, it would require explicit device remapping through the /etc/fstab table.
  • The SAP HANA Fast Restart Option is enabled for your SAP HANA system.

    For information about how to enable this, see Enabling SAP HANA Fast Restart.

  • A valid backup of the SAP HANA database is available. This backup can be used to restore the database, if required.

  • If the target Compute Engine instance is part of a high-availability (HA) cluster, then make sure that the cluster is in maintenance mode.

  • If your SAP HANA database uses a scale-out deployment, then repeat the procedure in this guide for each SAP HANA instance.

  • The SAP HANA database is up and running.

  • The tmpfs file system is fully loaded with the content of the MAIN data fragments. To view the file system utilization, run the following command:

    df -Th

    The output is similar to the following example:

    # df -Th
    FilesystemTypeSizeUsedAvailUse%Mountedon
    ...
    /dev/mapper/vg_hana_shared-sharedxfs1.0T56G968G6%/hana/shared
    /dev/mapper/vg_hana_data-dataxfs14T5.7T8.2T41%/hana/data
    /dev/mapper/vg_hana_log-logxfs512G7.2G505G2%/hana/log
    /dev/mapper/vg_hana_usrsap-usrsapxfs32G276M32G1%/usr/sap
    tmpfsDB10tmpfs5.7T800G4.9T14%/hana/tmpfs0/DB1
    tmpfsDB11tmpfs5.7T796G4.9T14%/hana/tmpfs1/DB1
    tmpfsDB12tmpfs5.7T783G4.9T14%/hana/tmpfs2/DB1
    tmpfsDB13tmpfs5.7T780G4.9T14%/hana/tmpfs3/DB1
    tmpfsDB14tmpfs5.7T816G4.9T15%/hana/tmpfs4/DB1
    tmpfsDB15tmpfs5.7T780G4.9T14%/hana/tmpfs5/DB1
    tmpfsDB16tmpfs5.7T816G4.9T15%/hana/tmpfs6/DB1
    tmpfsDB17tmpfs5.7T780G4.9T14%/hana/tmpfs7/DB1
    

Migrate Persistent Disk volumes to Hyperdisk volumes

This section describes how you migrate the /hana/data and /hana/logvolumes from Persistent Disk volumes to Hyperdisk volumes.

To illustrate the migration process, the following example configuration is used:

  • Machine type: m2-ultramem-416 (12 TB memory, 416 vCPUs)
  • SAP HANA scale-up system deployed by using the Google Cloud document Terraform: SAP HANA scale-up deployment guide.
    • OS: SLES for SAP 15 SP1
    • SAP HANA: HANA 2 SPS06, Patch 63
    • Default disk type: SSD Persistent Disk (pd-ssd)
    • /hana/data and /hana/log volumes are mounted on separate disks and are built using LVM and XFS
    • The SAP HANA Fast Restart Option is enabled and 6 TB of data is loaded into the database. For information about how to do this, see Enabling SAP HANA Fast Restart.

To migrate Persistent Disk volumes to Hyperdisk volumes, perform the following steps:

  1. Stop the SAP HANA database by running the HDB stop command:

    HDBstop
    

    Alternatively, you can run the sapcontrol command:

    sapcontrol-nrINSTANCE_NUMBER-functionStopSystemHDB
    

    Replace INSTANCE_NUMBER with the instance number for your SAP HANA system.

    For more information, see the SAP document Starting and Stopping SAP HANA Systems.

  2. Unmount the /hana/data and /hana/log volumes from the file system:

    umount/hana/data
    umount/hana/log
    
  3. Determine the names disks hosting the /hana/data and /hana/log volumes by using any of the following methods:

    • Run the ls command:

      ls-l/dev/disk/by-id/
      

      The output shows the mapping of disk names to devices, similar to the following example:

      ...
      lrwxrwxrwx1rootroot9May1820:14google-hana-vm-data00001->../../sdb
      lrwxrwxrwx1rootroot9May1820:14google-hana-vm-log00001->../../sdc
      ...
      
    • Run the gcloud compute instances describe command:

      gcloudcomputeinstancesdescribeINSTANCE_NAME
      --zone=ZONE
      

      Replace the following:

      • INSTANCE_NAME: the name of the compute instance.
      • ZONE: the zone of the compute instance.

      The output shows details about the compute instance, including the disks attached to it. For example:

      gcloudcomputeinstancesdescribehana-vm--zoneeurope-west4-a
      ...
      disks:
      -autoDelete:false
      deviceName:hana-vm-shared00001
      diskSizeGb:'1024'
      -autoDelete:false
      deviceName:hana-vm-usrsap00001
      diskSizeGb:'32'
      -autoDelete:false
      deviceName:hana-vm-data00001
      diskSizeGb:'14093'
      -autoDelete:false
      deviceName:hana-vm-log00001
      diskSizeGb:'512'
      
    • In the Google Cloud console, go to the Compute Engine VM instances page, and click the compute instance name. The Storage section displays the associated disk information.

  4. Create snapshots of the disks hosting the /hana/data and /hana/log volumes:

    gcloudcomputesnapshotscreateDATA_DISK-snapshot\
    --project=PROJECT_ID\
    --source-disk-zone=SOURCE_DISK_ZONE\
    --source-disk=DATA_DISK\
    gcloudcomputesnapshotscreateLOG_DISK-snapshot\
    --project=PROJECT_ID\
    --source-disk-zone=SOURCE_DISK_ZONE\
    --source-disk=LOG_DISK
    

    Replace the following:

    • DATA_DISK: the name of the disk that hosts the /hana/data volume, which is set as a prefix for the data disk's snapshot
    • LOG_DISK: the name of the disk that hosts the /hana/log volume, which is set as a prefix for the log disk's snapshot
    • PROJECT_ID: the ID of the Google Cloud project where the disk is deployed
    • SOURCE_DISK_ZONE: the Compute Engine zone where the disk is deployed

    For more information about creating snapshots, see Create and manage disk snapshots.

  5. By using the disk snapshots that you created, create Hyperdisk volumes for the /hana/data and /hana/log volumes:

    gcloudcomputediskscreateDATA_DISK-hd\
    --project=PROJECT_ID\
    --zone=ZONE\
    --type=HYPERDISK_TYPE\
    --provisioned-iops=IOPS_DATA_DISK\
    --source-snapshot=DATA_DISK-snapshot\
    gcloudcomputediskscreateLOG_DISK-hd\
    --project=PROJECT_ID\
    --zone=ZONE\
    --type=HYPERDISK_TYPE\
    --provisioned-iops=IOPS_LOG_DISK\
    --source-snapshot=LOG_DISK-snapshot
    

    Replace the following:

    • DATA_DISK: the name of the Persistent Disk volume that hosts the /hana/data volume, which is set as a prefix to the name of the Hyperdisk volume that you create
    • LOG_DISK: the name of the Persistent Disk volume that hosts the /hana/log volume, which is is set as a prefix to the name of the Hyperdisk volume that you create
    • PROJECT_ID: the ID of the Google Cloud project
    • HYPERDISK_TYPE: the type of Hyperdisk that you want to create, such as hyperdisk-extreme.
    • ZONE: the Compute Engine zone where you need to deploy the Hyperdisk volumes
    • IOPS_DATA_DISK: the IOPS that you want to set for the Hyperdisk you're creating to host /hana/data. You set the IOPS according to your performance requirements.
    • IOPS_LOG_DISK: the IOPS that you want to set for the Hyperdisk you're creating to host /hana/log. You set the IOPS according to your performance requirements.

    If you're creating Hyperdisk Balanced (hyperdisk-balanced) volumes, then you can also set its throughput.

    For information about the minimum size, IOPS, and throughput that you need to set for using Hyperdisk volumes with SAP HANA, see the row corresponding to your Compute Engine machine type in Minimum sizes for SSD-based Persistent Disk and Hyperdisk volumes.

    For more information about restoring a disk from a snapshot, see Restore from a snapshot.

  6. From the Compute Engine instance hosting your SAP HANA database, detach the Persistent Disk volumes that are hosting your /hana/data and /hana/log volumes:

    gcloudcomputeinstancesdetach-diskINSTANCE_NAME\
    --disk=DATA_DISK\
    --zone=ZONE
    gcloudcomputeinstancesdetach-diskINSTANCE_NAME\
    --disk=LOG_DISK\
    --zone=ZONE
    

    Replace the following:

    • INSTANCE_NAME: the name of your Compute Engine instance
    • DATA_DISK: the name of the Persistent Disk volume hosting your /hana/data volume, which you want to detach
    • LOG_DISK: the name of the Persistent Disk volume hosting your /hana/log volume, which you want to detach
    • ZONE: the Compute Engine zone where the disk is deployed
  7. Attach the Hyperdisk volumes that you created to the Compute Engine instance hosting your SAP HANA database:

    gcloudcomputeinstancesattach-diskINSTANCE_NAME\
    --disk=DATA_DISK-hd\
    --zone=ZONE
    gcloudcomputeinstancesattach-diskINSTANCE_NAME\
    --disk=LOG_DISK-hd\
    --zone=ZONE
    

    Replace the following:

    • INSTANCE_NAME: the name of the Compute Engine instance
    • DATA_DISK: the name of the Hyperdisk volume that you want to use to host the /hana/data volume
    • LOG_DISK: the name of the Hyperdisk volume that you want to use to host the /hana/log volume
    • ZONE: the Compute Engine zone where the Hyperdisk is deployed
  8. To mount the Hyperdisk volumes, perform the following steps as root or a user having sudo access:

    1. Remove all device mapping definitions to avoid LVM device mapping conflicts:

      dmsetupremove_all
      
    2. Scan all disks for volume groups, rebuild caches, and create missing volumes, including LVM:

      vgscan-v--mknodes
      

      The output is similar to the following:

      Scanningalldevicestoinitializelvmetad.
      Readingvolumegroupsfromcache.
      Foundvolumegroup"vg_hana_data"usingmetadatatypelvm2
      Foundvolumegroup"vg_hana_shared"usingmetadatatypelvm2
      Foundvolumegroup"vg_hana_log"usingmetadatatypelvm2
      Foundvolumegroup"vg_hana_usrsap"usingmetadatatypelvm2
      
    3. Activate the volume groups:

      vgchange-ay
      

      The output is similar to the following:

      1logicalvolume(s)involumegroup"vg_hana_data"nowactive
      1logicalvolume(s)involumegroup"vg_hana_shared"nowactive
      1logicalvolume(s)involumegroup"vg_hana_log"nowactive
      1logicalvolume(s)involumegroup"vg_hana_usrsap"nowactive
      
    4. Scan for logical volumes:

      lvscan
      

      The output is similar to the following:

      ACTIVE'/dev/vg_hana_data/data'[13.76TiB]inherit
      ACTIVE'/dev/vg_hana_shared/shared'[1024.00GiB]inherit
      ACTIVE'/dev/vg_hana_log/log'[512.00GiB]inherit
      ACTIVE'/dev/vg_hana_usrsap/usrsap'[32.00GiB]inherit
      
    5. Mount the disks:

      mount-av
      

      The output is similar to the following:

      /:ignored
      /boot/efi:alreadymounted
      /hana/shared:alreadymounted
      /hana/data:alreadymounted
      /hana/log:alreadymounted
      /usr/sap:alreadymounted
      swap:ignored
      /hana/tmpfs0/DB1:alreadymounted
      /hana/tmpfs1/DB1:alreadymounted
      /hana/tmpfs2/DB1:alreadymounted
      /hana/tmpfs3/DB1:alreadymounted
      /hana/tmpfs4/DB1:alreadymounted
      /hana/tmpfs5/DB1:alreadymounted
      /hana/tmpfs6/DB1:alreadymounted
      /hana/tmpfs7/DB1:alreadymounted
      
  9. Verify the new volumes:

    • Verify the file system utilization:

      df-Th
      

      The output is similar to the following:

      FilesystemTypeSizeUsedAvailUse%Mountedon
      ...
      /dev/mapper/vg_hana_shared-sharedxfs1.0T56G968G6%/hana/shared
      /dev/mapper/vg_hana_usrsap-usrsapxfs32G277M32G1%/usr/sap
      tmpfsDB10tmpfs5.7T784G4.9T14%/hana/tmpfs0/DB1
      tmpfsDB11tmpfs5.7T783G4.9T14%/hana/tmpfs1/DB1
      tmpfsDB12tmpfs5.7T783G4.9T14%/hana/tmpfs2/DB1
      tmpfsDB13tmpfs5.7T782G4.9T14%/hana/tmpfs3/DB1
      tmpfsDB14tmpfs5.7T783G4.9T14%/hana/tmpfs4/DB1
      tmpfsDB15tmpfs5.7T783G4.9T14%/hana/tmpfs5/DB1
      tmpfsDB16tmpfs5.7T783G4.9T14%/hana/tmpfs6/DB1
      tmpfsDB17tmpfs5.7T782G4.9T14%/hana/tmpfs7/DB1
      /dev/mapper/vg_hana_log-logxfs512G7.2G505G2%/hana/log
      /dev/mapper/vg_hana_data-dataxfs14T5.7T8.2T41%/hana/data
      
    • Verify that the devices are linked to the new volumes:

      lsblk
      

      The output is similar to the following:

      NAMEMAJ:MINRMSIZEROTYPEMOUNTPOINT
      ...
      sdd8:4801T0disk
      └─vg_hana_shared-shared254:001024G0lvm/hana/shared
      sde8:64032G0disk
      └─vg_hana_usrsap-usrsap254:3032G0lvm/usr/sap
      sdf8:80013.8T0disk
      └─vg_hana_data-data254:1013.8T0lvm/hana/data
      sdg8:960512G0disk
      └─vg_hana_log-log254:20512G0lvm/hana/log
      
  10. Start your SAP HANA database by using one of the following commands:

    • Run the HDB start command:

      HDBstart
      
    • Run the sapcontrol command:

      sapcontrol-nrINSTANCE_NUMBER-functionStartSystemHDB
      

      Replace INSTANCE_NUMBER with the instance number for your SAP HANA database.

      For more information, see Starting and Stopping SAP HANA Systems.

Fall back to existing disks

If the disk migration fails, then you can fall back to using the existing Persistent Disk volumes because they contain the data as it existed before the migration procedure began.

To restore your SAP HANA database to its original state, perform the following steps:

  1. Stop the Compute Engine instance that hosts your SAP HANA database.
  2. Detach the Hyperdisk volumes that you created.
  3. Reattach the existing Persistent Disk volumes to the compute instance.
  4. Start the compute instance.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月04日 UTC.