This guide shows you how to configure the guest operating system (OS) on Compute Engine bare metal instances for the optimal running of SAP HANA workloads, by using Google Cloud's Agent for SAP.
To seamlessly perform the required guest OS configurations on bare metal
instances such as X4, you run the configureinstance command of
Google Cloud's Agent for SAP.
This guide is meant for SAP Basis and SAP system administrators who want to run their SAP workloads on Compute Engine bare metal instances.
Before you begin
Deploy a bare metal instance, such as X4.
For information about the Compute Engine bare metal machine types that you can use to run SAP HANA on Google Cloud, the OS versions that you can use, and information about block storage configuration, see Bare metal machine types for SAP HANA.
For information about how to deploy a bare metal instance, see Create a bare metal instance from a public image.
Make sure that version 3.11 (latest) of Google Cloud's Agent for SAP is installed on your bare metal instance.
For information about how to install the agent on a compute instance, see Install and configure Google Cloud's Agent for SAP on a Compute Engine instance.
Configure the guest OS on your bare metal instance
Connect to your bare metal instance by using SSH or your preferred method.
Check whether the OS on your bare metal instance is optimally configured to run SAP HANA workloads:
sudo /usr/bin/google_cloud_sap_agent configureinstance -check
The command output informs if any OS configurations are needed. From version 3.11, the agent writes a summary of this output to the
/var/log/google-cloud-sap-agent.logfile.For information about the OS packages that X4 instances need to run SAP HANA, see the following file in the agent's read-only repository on GitHub: GoogleCloudPlatform/sapagent/internal/onetime/configureinstance/configurex4.go.
If the preceding command output mentions that OS configurations are required, then apply them:
sudo /usr/bin/google_cloud_sap_agent configureinstance -apply
Restart your bare metal instance.
Optionally, to view information about the OS configurations that the agent performed on your bare metal instance, see the following log file:
/var/log/google-cloud-sap-agent/configureinstance.log
View logs and set up alerts
From version 3.11, the agent writes the output of the configureinstance -check
command writes a summary of the output to the
/var/log/google-cloud-sap-agent.log file.
Because the agent logs are sent to Cloud Logging, you can use them to set up alerts. To do this:
Establish an SSH connection with a compute instance that runs your SAP workload.
Set the agent's log level to
info:sudo /usr/bin/google_cloud_sap_agent configure -loglevel=infoCheck the OS configuration of the compute instance. This step is optional for X4 instances because the agent runs
configureinstance -checkon X4 instances every 5 minutes.sudo /usr/bin/google_cloud_sap_agent configureinstance -checkView log entries in the
/var/log/google-cloud-sap-agent.logfile.The following are example logs for the output of this command:
Pass scenario: If the OS configuration passes all checks, then the output is similar to the following example and includes
"result": "pass":{"level":"info","timestamp":"2026-01-20T22:06:54.501Z","caller":"workloadmanager/systemmetrics.go:202","msg":"Completed check of system configuration settings via ConfigureInstance.","result":"pass","pid":3365118,"context":"WorkloadManagerMetrics"}Failure scenario: If the OS configuration fails any check, then the output is similar to the following example and includes
"result": "fail":{"level":"info","timestamp":"2026-02-03T21:52:38.184Z","caller":"workloadmanager/systemmetrics.go:202","msg":"Completed check of system configuration settings via ConfigureInstance.","pid":43310,"context":"WorkloadManagerMetrics","result":"fail"}
In Cloud Logging, configure a log-based alerting policy based on these logs.
For information about how to set up log based alerts, see Configure log-based alerting policy.
Disable hyperthreading for an X4 instance
In some scenarios, you can improve the performance of OLTP based SAP HANA workloads by disabling hyperthreading on the underlying X4 instances. For more information, see Hyperthreading.
To disable hyperthreading for your X4 instance by using Google Cloud's Agent for SAP, complete the following steps:
Connect to your X4 instance by using SSH or your preferred method.
Disable hyperthreading for your X4 instance:
sudo /usr/bin/google_cloud_sap_agent configureinstance -apply -hyperThreading="off"
Restart your X4 instance.
Best practices
To ensure that the guest OS on your Compute Engine bare metal instance is configured to enable optimal performance of your SAP workload, we recommend the following best practices:
- Use the latest version of Google Cloud's Agent for SAP.
- Run the agent's
configureinstancecommand after activities such as patching or upgrading the OS, updating Google Cloud's Agent for SAP. If you're using X4 instances to run your SAP workload, then set up log based alerts.
From version 3.11, the agent runs the
configureinstance -checkcommand on X4 instances every 5 minutes and writes a summary of the output to the/var/log/google-cloud-sap-agent.logfile. For more information, see View logs and set up alerts.