SQL Server-Lizenz zu einem vorhandenen Linux-Server hinzufügen
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Linux
Mit der Compute Engine können Sie SQL Server auf Linux-VM-Instanzen installieren und PAYG-Lizenzen (Pay as you go) verwenden. In diesem Dokument wird beschrieben, wie Sie SQL Server auf einer Linux-VM verwenden. Gehen Sie dazu so vor:
Nach dem Hinzufügen eines Lizenzstrings zum Bootlaufwerk der Linux-VM werden Ihnen die Kosten nach Preisen für SQL Server-Images berechnet.
Beschränkungen
SQL Server kann nur unter den folgenden Linux-Distributionen installiert werden:
Red Hat Enterprise Linux (RHEL)
SUSE Linux Enterprise Server (SLES)
Ubuntu
SQL Server-Lizenz zu einem Linux-Server hinzufügen
Mithilfe von SQL Server-Lizenzmetadaten auf einem Bootlaufwerk kann Google Cloud die SQL Server-Lizenznutzung genau verfolgen, in Rechnung stellen und entsprechende Berichte erstellen. Diese Metadaten sind erforderlich, wenn Sie PAYG-SQL Server-Lizenzen verwenden. Fügen Sie einem vorhandenen Bootlaufwerk eine SQL Server-Lizenz hinzu. Gehen Sie dazu so vor:
Ermitteln Sie die Lizenz, die Sie einer VM hinzufügen möchten. Für SQL Server muss die Lizenz sowohl der Version als auch der Edition entsprechen, die Sie ausführen möchten. Eine Liste der gültigen SQL Server-Lizenzstrings finden Sie auf dem Tab Lizenzstrings im Dokument Betriebssystemdetails für SQL Server.
Beenden Sie die VM:
gcloud compute instances stop VM_NAME
Ersetzen Sie VM_NAME durch den Namen der VM-Instanz, die beendet werden soll.
Ermitteln Sie das Bootlaufwerk:
gcloud compute instances describe VM_NAME
Ersetzen Sie VM_NAME durch den Namen der VM.
Überprüfen Sie, ob die Ausgabe in etwa so aussieht:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-19 (UTC)."],[[["\u003cp\u003eCompute Engine allows you to install SQL Server on Linux virtual machines (VMs) with pay-as-you-go (PAYG) licensing.\u003c/p\u003e\n"],["\u003cp\u003eAdding SQL Server license metadata to a Linux VM's boot disk is necessary for accurate billing and license usage tracking.\u003c/p\u003e\n"],["\u003cp\u003eYou can only install SQL Server on Linux distributions such as Red Hat Enterprise Linux (RHEL), SUSE Linux Enterprise Server (SLES), and Ubuntu.\u003c/p\u003e\n"],["\u003cp\u003eThe process to add a SQL Server license involves stopping the VM, detaching the boot disk, cloning it with the license, attaching the new disk as the boot disk, and restarting the VM.\u003c/p\u003e\n"],["\u003cp\u003eOnce a license is added to a VM, it cannot be removed, and billing for SQL Server images is based on the set pricing structure.\u003c/p\u003e\n"]]],[],null,["# Add a SQL Server license to an existing Linux server\n\nLinux\n\n*** ** * ** ***\n\nCompute Engine lets you install SQL Server on Linux virtual machines (VM)\ninstances and use pay-as-you-go (PAYG) licenses. This document describes how to\nuse SQL Server on a Linux VM by doing the following:\n\n1. [Add SQL Server license metadata to a boot disk](#add-sql-server-license)\n2. [Install SQL Server on Linux](#install-sql-server-on-linux)\n\nBilling\n-------\n\nAfter adding a license string to the Linux VM's boot disk, you are billed\naccording to the pricing of [SQL Server images](/compute/disks-image-pricing#sql_server_pricing).\n\nLimitations\n-----------\n\n- You can only install SQL Server on the following Linux distributions:\n\n - Red Hat Enterprise Linux (RHEL)\n - SUSE Linux Enterprise Server (SLES)\n - Ubuntu\n\nAdd a SQL Server license to a Linux Server\n------------------------------------------\n\nSQL Server license metadata on a boot disk allows Google Cloud to accurately\ntrack, bill, and report on SQL Server license usage. This metadata is required\nwhen using PAYG SQL Server licenses. Add a SQL Server license to an existing boot\ndisk using the following procedure:\n| **Caution:** After you add a license to a VM, you cannot remove the license from the VM.\n\n1. Identify the license you want to add to a VM. For SQL Server, the\n license needs to match both the version and edition you want to run. For the\n list of valid SQL Server license strings, see the **License strings** tab in\n the [operating system details for SQL Server](/compute/docs/images/os-details#sql_server)\n document.\n\n2. Stop the VM:\n\n ```\n gcloud compute instances stop VM_NAME\n ```\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of the VM instance to\n stop.\n3. Identify the boot disk:\n\n ```\n gcloud compute instances describe VM_NAME\n ```\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of the VM.\n4. Verify that the output is similar to the following:\n\n disks:\n - autoDelete: true\n boot: true\n deviceName: \u003cvar translate=\"no\"\u003eBOOT_DISK_NAME\u003c/var\u003e\n diskSizeGb: '20'\n guestOsFeatures:\n - type: UEFI_COMPATIBLE\n index: 0\n interface: SCSI\n kind: compute#attachedDisk\n licenses:\n - \u003cvar translate=\"no\"\u003eBOOT_DISK_LICENSE_STRING\u003c/var\u003e\n mode: READ_WRITE\n source: https://www.googleapis.com/compute/v1/projects/\u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e/zones/\u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e/disks/\u003cvar translate=\"no\"\u003eBOOT_DISK_NAME\u003c/var\u003e\n type: PERSISTENT\n\n5. Detach the boot disk:\n\n ```\n gcloud compute instances detach-disk VM_NAME --disk=BOOT_DISK_NAME\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e: the name of the VM\n - \u003cvar translate=\"no\"\u003eBOOT_DISK_NAME\u003c/var\u003e: the name of the boot disk\n6. Clone the boot disk and add the additional license:\n\n ```\n gcloud compute disks create CLONED_BOOT_DISK_NAME \\\n --licenses=SQL_SERVER_LICENSE \\\n --source-disk=BOOT_DISK_NAME \\\n --source-disk-zone=BOOT_DISK_ZONE \\\n --zone=CLONED_BOOT_DISK_ZONE\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCLONED_BOOT_DISK_NAME\u003c/var\u003e: the name you want to give the cloned book disk\n - \u003cvar translate=\"no\"\u003eSQL_SERVER_LICENSE\u003c/var\u003e: the SQL Server license you want to add to the boot disk\n - \u003cvar translate=\"no\"\u003eBOOT_DISK_NAME\u003c/var\u003e: the name of the source boot disk that you want to clone\n - \u003cvar translate=\"no\"\u003eBOOT_DISK_ZONE\u003c/var\u003e: the zone of the source boot disk\n - \u003cvar translate=\"no\"\u003eCLONED_BOOT_DISK_ZONE\u003c/var\u003e: the zone in which you want to create the cloned boot disk\n7. Verify that the new disk has the correct license:\n\n ```\n gcloud compute disks describe CLONED_BOOT_DISK_NAME \\\n --zone=CLONED_BOOT_DISK_ZONE\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCLONED_BOOT_DISK_NAME\u003c/var\u003e: the name of the cloned book disk\n - \u003cvar translate=\"no\"\u003eCLONED_BOOT_DISK_ZONE\u003c/var\u003e: the zone of the cloned boot disk\n8. Attach the new disk as the boot disk for the VM instance:\n\n ```\n gcloud compute instances attach-disk VM_NAME \\\n --disk=CLONED_BOOT_DISK_NAME\n --boot\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e: the name of the VM instance to which you want to attach the cloned boot disk\n - \u003cvar translate=\"no\"\u003eCLONED_BOOT_DISK_NAME\u003c/var\u003e: the name of the cloned book disk\n9. Verify that the VM's boot disk is the new cloned disk with SQL Server\n licensing.\n\n ```\n gcloud compute instances describe VM_NAME\n ```\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of the VM.\n10. Start the VM instance.\n\n ```\n gcloud compute instances start VM_NAME\n ```\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of the VM.\n11. (Optional) When you are sure that you don't want to revert back to the earlier\n boot disk, you can delete the disk.\n\n ```\n gcloud compute disks delete BOOT_DISK_NAME \\\n --zone=BOOT_DISK_ZONE\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eBOOT_DISK_NAME\u003c/var\u003e: the name of the boot disk that you want to delete\n - \u003cvar translate=\"no\"\u003eBOOT_DISK_ZONE\u003c/var\u003e: the zone of the boot disk\n\nInstall SQL Server on Linux\n---------------------------\n\nFor guidance on installing, updating, and uninstalling SQL Server on Linux, see [Installation guidance for SQL Server on Linux](https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-setup?view=sql-server-ver16).\n\nWhat's next\n-----------\n\n- [Learn about licenses](/compute/docs/licenses/about)\n\n- [View the SQL Server tutorials](/compute/docs/tutorials#sql-server)\n\n- [View the supported editions of SQL Server](/compute/docs/images/os-details#sql_server)"]]