Migrate Persistent Disk to Hyperdisk for SAP HANA
Stay organized with collections
Save and categorize content based on your preferences.
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/dataand/hana/logvolumes 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/fstabtable. 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
tmpfsfile system is fully loaded with the content of theMAINdata 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/dataand/hana/logvolumes 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:
Stop the SAP HANA database by running the
HDB stopcommand:HDBstopAlternatively, you can run the
sapcontrolcommand:sapcontrol-nrINSTANCE_NUMBER-functionStopSystemHDBReplace
INSTANCE_NUMBERwith the instance number for your SAP HANA system.For more information, see the SAP document Starting and Stopping SAP HANA Systems.
Unmount the
/hana/dataand/hana/logvolumes from the file system:umount/hana/data umount/hana/logDetermine the names disks hosting the
/hana/dataand/hana/logvolumes by using any of the following methods:Run the
lscommand: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 describecommand:gcloudcomputeinstancesdescribeINSTANCE_NAME --zone=ZONEReplace 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.
Create snapshots of the disks hosting the
/hana/dataand/hana/logvolumes: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_DISKReplace the following:
DATA_DISK: the name of the disk that hosts the/hana/datavolume, which is set as a prefix for the data disk's snapshotLOG_DISK: the name of the disk that hosts the/hana/logvolume, which is set as a prefix for the log disk's snapshotPROJECT_ID: the ID of the Google Cloud project where the disk is deployedSOURCE_DISK_ZONE: the Compute Engine zone where the disk is deployed
For more information about creating snapshots, see Create and manage disk snapshots.
By using the disk snapshots that you created, create Hyperdisk volumes for the
/hana/dataand/hana/logvolumes: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-snapshotReplace the following:
DATA_DISK: the name of the Persistent Disk volume that hosts the/hana/datavolume, which is set as a prefix to the name of the Hyperdisk volume that you createLOG_DISK: the name of the Persistent Disk volume that hosts the/hana/logvolume, which is is set as a prefix to the name of the Hyperdisk volume that you createPROJECT_ID: the ID of the Google Cloud projectHYPERDISK_TYPE: the type of Hyperdisk that you want to create, such ashyperdisk-extreme.ZONE: the Compute Engine zone where you need to deploy the Hyperdisk volumesIOPS_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.
From the Compute Engine instance hosting your SAP HANA database, detach the Persistent Disk volumes that are hosting your
/hana/dataand/hana/logvolumes:gcloudcomputeinstancesdetach-diskINSTANCE_NAME\ --disk=DATA_DISK\ --zone=ZONE gcloudcomputeinstancesdetach-diskINSTANCE_NAME\ --disk=LOG_DISK\ --zone=ZONEReplace the following:
INSTANCE_NAME: the name of your Compute Engine instanceDATA_DISK: the name of the Persistent Disk volume hosting your/hana/datavolume, which you want to detachLOG_DISK: the name of the Persistent Disk volume hosting your/hana/logvolume, which you want to detachZONE: the Compute Engine zone where the disk is deployed
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=ZONEReplace the following:
INSTANCE_NAME: the name of the Compute Engine instanceDATA_DISK: the name of the Hyperdisk volume that you want to use to host the/hana/datavolumeLOG_DISK: the name of the Hyperdisk volume that you want to use to host the/hana/logvolumeZONE: the Compute Engine zone where the Hyperdisk is deployed
To mount the Hyperdisk volumes, perform the following steps as
rootor a user havingsudoaccess:Remove all device mapping definitions to avoid LVM device mapping conflicts:
dmsetupremove_allScan all disks for volume groups, rebuild caches, and create missing volumes, including LVM:
vgscan-v--mknodesThe 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"usingmetadatatypelvm2Activate the volume groups:
vgchange-ayThe 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"nowactiveScan for logical volumes:
lvscanThe 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]inheritMount the disks:
mount-avThe 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
Verify the new volumes:
Verify the file system utilization:
df-ThThe 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/dataVerify that the devices are linked to the new volumes:
lsblkThe 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
Start your SAP HANA database by using one of the following commands:
Run the
HDB startcommand:HDBstartRun the
sapcontrolcommand:sapcontrol-nrINSTANCE_NUMBER-functionStartSystemHDBReplace
INSTANCE_NUMBERwith 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:
- Stop the Compute Engine instance that hosts your SAP HANA database.
- Detach the Hyperdisk volumes that you created.
- Reattach the existing Persistent Disk volumes to the compute instance.
- Start the compute instance.