Configure guest OS on Compute Engine bare metal instances

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

Configure the guest OS on your bare metal instance

  1. Connect to your bare metal instance by using SSH or your preferred method.

  2. 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.log file.

    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.

  3. If the preceding command output mentions that OS configurations are required, then apply them:

    sudo /usr/bin/google_cloud_sap_agent configureinstance -apply
    
  4. Restart your bare metal instance.

  5. 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:

  1. Establish an SSH connection with a compute instance that runs your SAP workload.

  2. Set the agent's log level to info:

    sudo /usr/bin/google_cloud_sap_agent configure -loglevel=info
    
  3. Check the OS configuration of the compute instance. This step is optional for X4 instances because the agent runs configureinstance -check on X4 instances every 5 minutes.

    sudo /usr/bin/google_cloud_sap_agent configureinstance -check
    
  4. View log entries in the /var/log/google-cloud-sap-agent.log file.

    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"}
  5. 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:

  1. Connect to your X4 instance by using SSH or your preferred method.

  2. Disable hyperthreading for your X4 instance:

    sudo /usr/bin/google_cloud_sap_agent configureinstance -apply -hyperThreading="off"
    
  3. 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 configureinstance command 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 -check command on X4 instances every 5 minutes and writes a summary of the output to the /var/log/google-cloud-sap-agent.log file. For more information, see View logs and set up alerts.